/* Shared Statistics Card Styling - Used across Portal pages */
/* DO NOT modify individual page stat card styles - modify here instead */

/* Stat Cards Container */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
    max-width: 100%;
}

/* 5-Column Grid (for pages with 5 stats) */
.stat-cards.five-cols {
    grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 1280px) {
    .stat-cards.five-cols {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .stat-cards.five-cols {
        grid-template-columns: repeat(2, 1fr);
    }
}
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/*.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}*/

/* Stat Card Icon */
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Icon Color Variants */
.stat-icon.students {
    background: #e0e7ff;
    color: #4f46e5;
}

.stat-icon.answers {
    background: #e0e7ff;
    color: #4f46e5;
}

.stat-icon.correct {
    background: #dcfce7;
    color: #16a34a;
}

.stat-icon.completed {
    background: #dcfce7;
    color: #16a34a;
}

.stat-icon.lessons {
    background: #f3e8ff;
    color: #9333ea;
}

.stat-icon.upcoming {
    background: #f3e8ff;
    color: #9333ea;
}

.stat-icon.streak {
    background: #fef3c7;
    color: #d97706;
}

.stat-icon.attendance {
    background: #fef3c7;
    color: #d97706;
}

.stat-icon.rate {
    background: #dbeafe;
    color: #2563eb;
}

.stat-icon.score {
    background: #dbeafe;
    color: #2563eb;
}

.stat-icon.groups {
    background: #f3e8ff;
    color: #9333ea;
}

.stat-icon.neutral {
    background: #f3f4f6;
    color: #6b7280;
}

/* Stat Card Content */
.stat-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}




.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
}

.stat-label {
    font-size: 13px;
    color: #666;
    line-height: 1.3;
}

/* Stat Change Indicator (for Dashboard) */
.stat-change {
    font-size: 12px;
    font-weight: 500;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.positive {
    color: #16a34a;
}

.stat-change.negative {
    color: #dc2626;
}

.stat-change.neutral {
    color: #6b7280;
}

/* Person Indicator (for StudentDetails) */
.person-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #f3f4f6;
    border-radius: 50%;
    color: #6b7280;
}




/* Rate Colors (for percentage values) */
.rate-high {
    color: #16a34a;
}

.rate-medium {
    color: #d97706;
}

.rate-low {
    color: #dc2626;
}

/* Responsive Design */
@media (max-width: 1280px) {
    .stat-cards:not(.five-cols) {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .stat-cards.five-cols {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .stat-cards:not(.five-cols) {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stat-cards.five-cols {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .stat-cards {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
    }

    .stat-value {
        font-size: 20px;
    }
}

/* ============================================================
   DARK MODE — Stat card overrides
   Specificity (0,2,0) beats scoped Blazor rules.
   ============================================================ */
[data-theme="dark"],
body.dark {
    .stat-card {
        background: var(--neutral-layer-2, #2d2d2d);
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    }

    .stat-value {
        color: var(--neutral-foreground-rest, #e8e8e8);
    }

    .stat-label {
        color: var(--neutral-foreground-hint, #a0a0a0);
    }

    /* Icon backgrounds — use transparent tints so the hue is preserved */
    .stat-icon.students,
    .stat-icon.answers {
        background: rgba(79, 70, 229, 0.2);
    }

    .stat-icon.correct,
    .stat-icon.completed {
        background: rgba(22, 163, 74, 0.2);
    }

    .stat-icon.lessons,
    .stat-icon.upcoming,
    .stat-icon.groups {
        background: rgba(147, 51, 234, 0.2);
    }

    .stat-icon.streak,
    .stat-icon.attendance {
        background: rgba(217, 119, 6, 0.2);
    }

    .stat-icon.rate,
    .stat-icon.score {
        background: rgba(37, 99, 235, 0.2);
    }

    .stat-icon.neutral {
        background: rgba(107, 114, 128, 0.2);
        color: #9ca3af;
    }

    .person-indicator {
        background: rgba(107, 114, 128, 0.2);
        color: #9ca3af;
    }
}
