/* ===== Shakarim Student AI Advisor - Academic Premium Theme ===== */
/* Fonts: Playfair Display (headlines) + DM Sans (body)          */
/* Colors: Deep Navy #003f87, Emerald #006e2f, Gold #c8a45c      */
/* ============================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,500;1,600&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700;9..40,800;9..40,900&display=swap');

:root {
    --primary: #003f87;
    --primary-light: #1a5bb8;
    --secondary: #006e2f;
    --secondary-light: #008a3c;
    --gold: #c8a45c;
    --gold-light: #e0c878;
    --gold-dark: #a68440;
    --error: #ba1a1a;
    --surface: #faf8f5;
    --on-surface: #1a1a1a;
    --surface-card: #ffffff;
    --muted: #8b8b8b;
    --border: rgba(0, 0, 0, 0.06);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.04), 0 2px 4px rgba(0, 0, 0, 0.02);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.05), 0 4px 8px rgba(0, 0, 0, 0.02);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.06), 0 8px 16px rgba(0, 0, 0, 0.02);
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --radius-2xl: 1.75rem;
    --radius-3xl: 2.5rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', system-ui, sans-serif;
    background-color: var(--surface);
    color: var(--on-surface);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Premium Card ===== */
.premium-card {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-md);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.premium-card:hover {
    box-shadow: var(--shadow-lg);
}

/* ===== Glass Card (for advisor panels) ===== */
.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.glass-card:hover {
    box-shadow: var(--shadow-lg);
    background: rgba(255, 255, 255, 0.92);
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6,
.font-headline {
    font-family: 'Playfair Display', Georgia, serif;
    letter-spacing: -0.02em;
}

.font-body {
    font-family: 'DM Sans', system-ui, sans-serif;
}

/* ===== Material Symbols ===== */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
}

/* ===== Lang Buttons ===== */
.lang-btn {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    transition: all 0.2s;
    cursor: pointer;
    letter-spacing: 0.05em;
    color: var(--muted);
    background: transparent;
    border: none;
}

.lang-btn.active {
    background: var(--primary);
    color: white;
}

.lang-btn:not(.active):hover {
    background: rgba(0, 0, 0, 0.05);
}

/* ===== Risk Badges ===== */
.risk-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border: 1px solid transparent;
}

.risk-badge.high {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.risk-badge.medium {
    background: #fffbeb;
    color: #d97706;
    border-color: #fde68a;
}

.risk-badge.low {
    background: #f0fdf4;
    color: #16a34a;
    border-color: #bbf7d0;
}

/* ===== Status Dots ===== */
.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.high { background: #dc2626; }
.status-dot.medium { background: #d97706; }
.status-dot.low { background: #16a34a; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

.hide-scrollbar::-webkit-scrollbar { width: 0; height: 0; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ===== Inputs ===== */
input[type="text"],
input[type="password"],
input[type="number"] {
    font-family: 'DM Sans', system-ui, sans-serif;
}

/* ===== Animations ===== */
@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.tab-content {
    display: none;
    opacity: 0;
}

.tab-content.active {
    display: block;
    animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.shimmer {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .premium-card {
        border-radius: var(--radius-xl);
        padding: 1.25rem !important;
    }
    .glass-card {
        border-radius: var(--radius-xl);
    }
    
    /* Header mobile */
    header .max-w-7xl {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        height: 3.5rem !important;
    }
    header img {
        height: 2rem !important;
    }
    
    /* Hero section mobile */
    #results > section:first-child {
        flex-direction: column !important;
        gap: 1.5rem !important;
    }
    
    #student_name {
        font-size: 2.25rem !important;
        line-height: 1 !important;
    }
    
    /* GPA cards - full width on mobile, side by side on tablet */
    #gpa_risk_card {
        min-width: 100% !important;
        width: 100% !important;
    }
    
    #gpa_chart_card {
        min-width: 100% !important;
        width: 100% !important;
    }
    
    /* Hero flex: GPA Trend + GPA Widget stacked */
    #results > section:first-child {
        display: flex;
        flex-direction: column;
    }
    
    /* AI Section mobile */
    #ai_gauge_row {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    #risk_gauge_container {
        flex-direction: row !important;
        align-items: center !important;
        gap: 1rem !important;
    }
    
    #risk_gauge_svg {
        width: 5rem !important;
        height: 5rem !important;
    }
    
    #ai_gpa_projection {
        font-size: 0.8125rem !important;
    }
    
    #ai_learning_style_desc {
        font-size: 0.75rem !important;
    }
    
    /* Risk breakdown mini bars */
    #risk_breakdown > div {
        flex-wrap: wrap !important;
    }
    
    #risk_breakdown span:first-child {
        width: 5rem !important;
    }
    
    /* Course card grid - 2 cols on tablet */
    #risk_list {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
    
    /* Filter area */
    #results section .flex-col.md\:flex-row {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    #subject_search {
        width: 100% !important;
    }
    
    /* AI expand button mobile */
    #ai_expand_btn button {
        padding: 0.5rem 1rem !important;
        font-size: 0.6875rem !important;
    }
    
    /* Footer */
    footer .max-w-7xl {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Course details page */
    .course-tab {
        padding: 0.375rem 0.75rem !important;
        font-size: 0.5625rem !important;
    }
    
    /* KPI widget mobile */
    #kpi_list > div {
        gap: 0.5rem !important;
    }
    
    /* GP chart - ensure container fits */
    #gpa_chart_container {
        height: 110px !important;
    }
}

@media (max-width: 480px) {
    /* Small phones */
    header .max-w-7xl {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    #results {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    #results section {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    #student_name {
        font-size: 1.75rem !important;
    }
    
    #risk_list {
        grid-template-columns: 1fr !important;
    }
    
    #gpa_chart_container {
        height: 95px !important;
    }
    
    #ai_container {
        padding: 1rem !important;
    }
    
    #ai_meta_bar {
        gap: 0.375rem !important;
    }
    
    #risk_score_badge, #learning_style_badge {
        font-size: 0.5625rem !important;
        padding: 0.125rem 0.5rem !important;
    }
    
    #ai_summary {
        max-height: 150px !important;
    }
}

/* ===== Celebration Popup ===== */
#celebration_popup {
    animation: slideUpFade 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== Decorative Gold Accent Line ===== */
.gold-accent {
    width: 40px;
    height: 2px;
    background: var(--gold);
    border-radius: 2px;
}

/* ===== Section Divider ===== */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,0,0,0.06), transparent);
    border: none;
    margin: 1.5rem 0;
}
