/* ============================================
   Analytics Dashboard Styles
   ============================================ */

.analytics-container {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Header Section */
.analytics-header {
    margin-bottom: 2rem;
    text-align: center;
}

.analytics-header h1 {
    font-size: 2.5rem;
    color: #1f2937;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.analytics-header h1 i {
    color: #4f46e5;
    margin-right: 1rem;
}

.analytics-header .subtitle {
    font-size: 1.1rem;
    color: #6b7280;
    margin: 0;
}

/* KPIs Grid */
.kpis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.kpi-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.kpi-card.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    to {
        left: 100%;
    }
}

.kpi-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}

.kpi-card:nth-child(1) .kpi-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.kpi-card:nth-child(2) .kpi-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.kpi-card:nth-child(3) .kpi-icon {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.kpi-card:nth-child(4) .kpi-icon {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

.kpi-card:nth-child(5) .kpi-icon {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
    color: white;
}

.kpi-card:nth-child(6) .kpi-icon {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #333;
}

.kpi-content {
    flex: 1;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.kpi-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.chart-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.chart-card.wide {
    grid-column: span 2;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f3f4f6;
}

.chart-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-header h3 i {
    color: #4f46e5;
}

.chart-filters {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
    font-weight: 500;
}

.filter-btn:hover {
    border-color: #4f46e5;
    color: #4f46e5;
}

.filter-btn.active {
    background: #4f46e5;
    border-color: #4f46e5;
    color: white;
}

.chart-body {
    position: relative;
    min-height: 300px;
}

.chart-body canvas {
    max-height: 350px;
}

/* Empty State */
.empty-state {
    background: white;
    border-radius: 12px;
    padding: 4rem 2rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.empty-state i {
    color: #d1d5db;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: #1f2937;
    margin: 0;
}

.empty-state p {
    font-size: 1rem;
    color: #6b7280;
    max-width: 400px;
    margin: 0 auto 1.5rem;
}

.empty-state .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #4f46e5;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.empty-state .btn:hover {
    background: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .chart-card.wide {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .analytics-container {
        padding: 1rem;
    }

    .analytics-header h1 {
        font-size: 2rem;
    }

    .kpis-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .kpi-card {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }

    .kpi-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .kpi-value {
        font-size: 1.75rem;
    }

    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .chart-filters {
        width: 100%;
        justify-content: center;
    }

    .filter-btn {
        flex: 1;
        padding: 0.5rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .kpis-grid {
        grid-template-columns: 1fr;
    }

    .analytics-header h1 {
        font-size: 1.5rem;
    }

    .analytics-header .subtitle {
        font-size: 0.9rem;
    }
}

/* Dark Mode Support (opcional) */
@media (prefers-color-scheme: dark) {
    .analytics-container {
        background: #111827;
    }

    .analytics-header h1,
    .kpi-value,
    .chart-header h3,
    .empty-state h3 {
        color: #f9fafb;
    }

    .analytics-header .subtitle,
    .kpi-label,
    .empty-state p {
        color: #9ca3af;
    }

    .kpi-card,
    .chart-card,
    .empty-state {
        background: #1f2937;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    }

    .chart-header {
        border-bottom-color: #374151;
    }

    .filter-btn {
        background: #374151;
        border-color: #4b5563;
        color: #d1d5db;
    }

    .filter-btn:hover {
        border-color: #6366f1;
        color: #818cf8;
    }

    .filter-btn.active {
        background: #4f46e5;
        border-color: #4f46e5;
        color: white;
    }
}