﻿/* assets/css/dashboards/operational/customers/retention_style.css */
/* Customer Retention Dashboard Specific Styles - matching revenue patterns */

/* ===================================
   TITLE STANDARDIZATION
   Make metric card titles match chart titles
   =================================== */


.dashboard-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Filter wrapper for tooltip support - matching revenue */
.filter-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

/* Modern Dropdown Styling - matching revenue exactly */
.segment-filter,
.dashboard-date-filter,
.chart-year-filter {
    min-width: 150px;
    padding: 0.625rem 2.5rem 0.625rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--myceo-text-primary);
    background-color: var(--myceo-surface-1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.segment-filter:hover,
.dashboard-date-filter:hover,
.chart-year-filter:hover {
    border-color: var(--myceo-accent-blue);
    box-shadow: 0 2px 4px rgba(10, 36, 87, 0.1);
}

.segment-filter:focus,
.dashboard-date-filter:focus,
.chart-year-filter:focus {
    outline: none;
    border-color: var(--myceo-accent-blue);
    box-shadow: 0 0 0 3px rgba(10, 36, 87, 0.1);
}

/* Adjust segment filter for longer text */
.segment-filter {
    min-width: 200px;
}

/* Chart year filter specific styling */
.chart-year-filter {
    min-width: 80px;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 0.875rem;
}

/* Chart header with filters */
.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.chart-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--myceo-text-primary);
}

.chart-year-filters {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.chart-year-filters label {
    font-size: 0.875rem;
    color: var(--myceo-text-secondary);
    font-weight: 500;
}

/* Dashboard charts grid - matching revenue */
.dashboard-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.dashboard-charts.full-width-charts {
    grid-template-columns: 1fr;
}

.chart-container {
    background: var(--myceo-surface-1);
    border: 1px solid var(--myceo-border-mid);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chart-container.full-width {
    grid-column: 1 / -1;
}

.chart-container.half-width {
    min-height: 400px;
}

.chart-placeholder {
    position: relative;
    min-height: 400px;
}

/* Custom date container - matching revenue */
#custom-date-container {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem;
    background: var(--myceo-surface-1);
    border-radius: 4px;
}

.date-picker-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-picker-group label {
    font-weight: 500;
    color: var(--myceo-text-secondary);
}

.date-picker-group input[type="date"] {
    padding: 0.5rem;
    border: 1px solid var(--myceo-border-mid);
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Cohort Heatmap Table Styles */
.cohort-retention-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.cohort-retention-table th,
.cohort-retention-table td {
    padding: 0.75rem 0.5rem;
    text-align: center;
    border: 1px solid var(--myceo-border-mid);
}

.cohort-retention-table th {
    background-color: var(--myceo-surface-1);
    font-weight: 600;
}

.cohort-retention-table tbody tr:hover {
    background-color: rgba(10, 36, 87, 0.02);
}

/* Sticky column for cohort labels */
.cohort-retention-table td:first-child,
.cohort-retention-table th:first-child {
    position: sticky;
    left: 0;
    z-index: 10;
    background-color: var(--myceo-surface-1);
    font-weight: 600;
}

/* Heatmap Legend */
.heatmap-legend {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--myceo-border-mid);
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--myceo-text-secondary);
}

/* Metric Change Indicators - Updated to stack vertically */
/* Loading States */
.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 2rem auto;
    border: 4px solid var(--myceo-border-mid);
    border-top: 4px solid var(--myceo-accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error and No Data Messages */
.no-data-message,
.chart-error {
    padding: 2rem;
    text-align: center;
    color: var(--myceo-text-secondary);
    font-size: 0.95rem;
}

.chart-error {
    color: var(--myceo-status-critical);
    background-color: rgba(225, 29, 72, 0.16);
    border-radius: 6px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
}

/* Responsive adjustments - matching revenue */
@media (max-width: 768px) {
    .dashboard-controls {
        flex-wrap: wrap;
    }
    
    .dashboard-charts {
        grid-template-columns: 1fr;
    }
    
    .metrics-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .segment-filter,
    .dashboard-date-filter {
        min-width: 100%;
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .chart-year-filters {
        width: 100%;
        justify-content: flex-start;
    }
}
/* ── Tight phones (VERITAS-102 phase 3): two metric columns don't fit
   under 520px — stack them ─────────────────────────────────────────── */
@media (max-width: 520px) {
    .metrics-row {
        grid-template-columns: 1fr;
    }
}
