/**
 * Modal Stats - The Linkers System
 *
 * Estilos para el modal de estadísticas detalladas del dashboard Linker
 * - Modal overlay con backdrop oscuro
 * - 4 tabs: Resumen, Leads, Comisiones, Actividad
 * - Cards de stats, progress bars, insights
 *
 * @package    The_Linkers_System
 * @subpackage Assets/CSS
 * @version    1.1.0
 * @since      2025-11-26
 */

/* ============================================================================
   MODAL OVERLAY
   ============================================================================ */

.tls-stats-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ✅ REGLA QUE FALTABA - Mostrar modal cuando está activo */
.tls-stats-overlay.active {
    display: flex;
}

/* ============================================================================
   MODAL CONTAINER
   ============================================================================ */

.tls-stats-dialog {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: tlsModalIn 0.3s ease;
}

@keyframes tlsModalIn {
    from { 
        opacity: 0; 
        transform: scale(0.95) translateY(-20px); 
    }
    to { 
        opacity: 1; 
        transform: scale(1) translateY(0); 
    }
}

/* ============================================================================
   MODAL HEADER
   ============================================================================ */

.tls-stats-header {
    background: linear-gradient(135deg, #FF5C39 0%, #FF8A6B 100%);
    color: #ffffff;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tls-stats-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.tls-stats-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.tls-stats-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================================================
   MODAL TABS
   ============================================================================ */

.tls-stats-tabs {
    display: flex;
    background: #F8F9FA;
    border-bottom: 1px solid #E9ECEF;
}

.tls-stats-tab {
    flex: 1;
    padding: 14px 16px;
    text-align: center;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    color: #6C757D;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.tls-stats-tab:hover {
    background: #F1F3F4;
    color: #1A1A2E;
}

.tls-stats-tab.active {
    color: #FF5C39;
    border-bottom-color: #FF5C39;
    background: #ffffff;
}

/* ============================================================================
   MODAL BODY
   ============================================================================ */

.tls-stats-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.tls-stats-content {
    display: none;
}

.tls-stats-content.active {
    display: block;
}

/* ============================================================================
   STATS GRID (dentro del modal)
   ============================================================================ */

.tls-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.tls-stat-box {
    background: linear-gradient(135deg, rgba(0, 102, 196, 0.05), rgba(0, 174, 239, 0.05));
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.tls-stat-box-value {
    font-size: 28px;
    font-weight: 700;
    color: #FF5C39;
    margin-bottom: 4px;
}

.tls-stat-box-label {
    font-size: 13px;
    color: #6C757D;
}

/* ============================================================================
   PROGRESS BARS
   ============================================================================ */

.tls-progress-section {
    margin-bottom: 20px;
}

.tls-progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.tls-progress-bar {
    height: 8px;
    background: #E9ECEF;
    border-radius: 4px;
    overflow: hidden;
}

.tls-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.tls-progress-fill.orange { background: #FF5C39; }
.tls-progress-fill.blue { background: #0066C4; }
.tls-progress-fill.green { background: #28A745; }
.tls-progress-fill.yellow { background: #FFC107; }

/* ============================================================================
   SECTION TITLES
   ============================================================================ */

.tls-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #1A1A2E;
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #E9ECEF;
}

/* ============================================================================
   INSIGHT CARDS
   ============================================================================ */

.tls-insight-card {
    background: #FFFBF5;
    border-left: 4px solid #FF5C39;
    padding: 16px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 16px;
}

.tls-insight-card h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #1A1A2E;
}

.tls-insight-card p {
    margin: 0;
    font-size: 13px;
    color: #6C757D;
}

/* ============================================================================
   CARDS CLICKEABLES - VER MÁS
   ============================================================================ */

.tls-metric-card[onclick] {
    cursor: pointer;
}

.tls-metric-vermas {
    position: absolute;
    bottom: 12px;
    right: 16px;
    font-size: 12px;
    color: #FF5C39;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    font-weight: 500;
}

.tls-metric-card[onclick]:hover .tls-metric-vermas {
    opacity: 1;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 600px) {
    .tls-stats-row {
        grid-template-columns: 1fr;
    }
    
    .tls-stats-tabs {
        flex-wrap: wrap;
    }
    
    .tls-stats-tab {
        flex: 1 1 50%;
    }
    
    .tls-stats-dialog {
        max-height: 95vh;
        margin: 10px;
    }
    
    .tls-stats-body {
        padding: 16px;
        max-height: calc(95vh - 140px);
    }
}

/* FIN MODAL STATS */
