/* Analytics Dashboard Styles */

.analytics-dashboard {
    padding: 20px;
    max-width: 1600px;
    margin: 0 auto;
}

/* Dashboard Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.dashboard-header h1 {
    margin: 0 0 5px 0;
    font-size: 28px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dashboard-header p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.header-actions select {
    min-width: 150px;
}

/* Quick Stats Grid */
.quick-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.stat-card.blue .stat-icon {
    background: linear-gradient(135deg, #4F46E5 0%, #6366F1 100%);
}

.stat-card.green .stat-icon {
    background: linear-gradient(135deg, #10B981 0%, #34D399 100%);
}

.stat-card.orange .stat-icon {
    background: linear-gradient(135deg, #F59E0B 0%, #FBBF24 100%);
}

.stat-card.purple .stat-icon {
    background: linear-gradient(135deg, #8B5CF6 0%, #A78BFA 100%);
}

.stat-content {
    flex: 1;
}

.stat-content h3 {
    margin: 0 0 5px 0;
    font-size: 32px;
    font-weight: 700;
    color: #1e293b;
}

.stat-content p {
    margin: 0 0 8px 0;
    color: #64748b;
    font-size: 14px;
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
}

.stat-change.positive {
    color: #10B981;
    background: rgba(16, 185, 129, 0.1);
}

.stat-change.negative {
    color: #EF4444;
    background: rgba(239, 68, 68, 0.1);
}

.stat-change.neutral {
    color: #F59E0B;
    background: rgba(245, 158, 11, 0.1);
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.chart-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.chart-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: #e9ecef;
    color: #1e293b;
}

.chart-body {
    padding: 20px;
    height: 300px;
}

.chart-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.chart-legend {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #64748b;
}

.chart-legend i {
    font-size: 10px;
    margin-right: 4px;
}

/* Modules Summary */
.modules-summary {
    margin-bottom: 40px;
}

.modules-summary h2 {
    margin: 0 0 20px 0;
    font-size: 22px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.module-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.module-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.module-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    margin-bottom: 16px;
}

.module-icon.blue {
    background: linear-gradient(135deg, #4F46E5 0%, #6366F1 100%);
}

.module-icon.purple {
    background: linear-gradient(135deg, #8B5CF6 0%, #A78BFA 100%);
}

.module-icon.green {
    background: linear-gradient(135deg, #10B981 0%, #34D399 100%);
}

.module-icon.orange {
    background: linear-gradient(135deg, #F59E0B 0%, #FBBF24 100%);
}

.module-icon.indigo {
    background: linear-gradient(135deg, #6366F1 0%, #818CF8 100%);
}

.module-icon.teal {
    background: linear-gradient(135deg, #14B8A6 0%, #2DD4BF 100%);
}

.module-card h4 {
    margin: 0 0 16px 0;
    font-size: 18px;
    color: #1e293b;
}

.module-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.module-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.module-stat:last-child {
    border-bottom: none;
}

.module-stat .label {
    font-size: 13px;
    color: #64748b;
}

.module-stat .value {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

/* Recent Activities */
.recent-activities {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.recent-activities h2 {
    margin: 0 0 20px 0;
    font-size: 22px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.activities-timeline {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #f1f5f9;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4F46E5;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-content p {
    margin: 0 0 4px 0;
    color: #1e293b;
    font-size: 14px;
}

.activity-time {
    font-size: 12px;
    color: #94a3b8;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .charts-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
    
    .quick-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .header-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .quick-stats-grid {
        grid-template-columns: 1fr;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .modules-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading Animation */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #94a3b8;
}

.loading-screen i {
    font-size: 32px;
    margin-bottom: 12px;
}
