@import url('https://fonts.googleapis.com/css2?family=Readex+Pro:wght@300;400;500;600;700&family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&family=Cairo:wght@600;700&display=swap');

/* ================================================
   ROOT VARIABLES — Modern Design System
   ================================================ */
:root {
    /* Core colors — Calming Deep Midnight Palette */
    --bg-primary: #080d1a;
    --bg-secondary: #0d1527;
    --bg-tertiary: #131f38;
    --bg-card: rgba(13, 21, 38, 0.75);

    /* Accent palette */
    --gold-light: #fde68a;
    --gold: #fbbf24;
    --gold-deep: #d97706;
    --gold-glow: rgba(251, 191, 36, 0.35);

    /* Semantic colors */
    --blue: #3b82f6;
    --blue-light: #60a5fa;
    --purple: #8b5cf6;
    --purple-light: #a78bfa;
    --emerald: #10b981;
    --emerald-light: #34d399;
    --red: #ef4444;
    --orange: #f97316;

    /* Text — Improved contrast & eye comfort */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-dim: #94a3b8;
    --white: #ffffff;

    /* Borders & surfaces */
    --border: rgba(251, 191, 36, 0.15);
    --border-hover: rgba(251, 191, 36, 0.4);
    --glass: rgba(255, 255, 255, 0.04);
    --glass-hover: rgba(255, 255, 255, 0.08);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 8px 25px rgba(0,0,0,0.4);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.5);
    --shadow-gold: 0 0 30px rgba(251,191,36,0.25);
    --shadow-glow: 0 0 60px rgba(251,191,36,0.12);

    /* Typography — Calm, highly legible educational font stack */
    --font-primary: 'Readex Pro', 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 9999px;

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    /* Legacy aliases (keep JS compatibility) */
    --bg-color: var(--bg-primary);
    --primary-gold: var(--gold);
    --secondary-gold: var(--gold-deep);
    --text-color: var(--text-primary);
    --card-bg: var(--bg-card);
    --card-border: var(--border);
    --accent-emerald: var(--emerald);
    --primary-blue: var(--blue);
    --primary-purple: var(--purple);
    --primary-orange: var(--orange);
}

/* ================================================
   BASE RESET & GLOBAL
   ================================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 17.5px;
}
@media (min-width: 1024px) {
    html {
        font-size: 18.5px;
    }
}

button, a, .game-card, .course-card, .btn, .ans-btn, .option-btn, .content-item {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-primary);
    line-height: 1.75;
    direction: rtl;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    letter-spacing: 0;
    transition: background-color 0.4s ease, color 0.4s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    letter-spacing: 0 !important;
    font-weight: 700;
}

p, span, a, button, input, select, textarea {
    letter-spacing: 0 !important;
}

p {
    font-weight: 400;
    line-height: 1.75;
}

/* Modern Ambient Mesh & Physics Dot Matrix */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(rgba(148, 163, 184, 0.08) 1.2px, transparent 1.2px),
        radial-gradient(ellipse 85% 60% at 15% 10%, rgba(56, 189, 248, 0.11) 0%, transparent 60%),
        radial-gradient(ellipse 70% 55% at 85% 85%, rgba(139, 92, 246, 0.10) 0%, transparent 60%),
        radial-gradient(ellipse 60% 45% at 50% 50%, rgba(251, 191, 36, 0.07) 0%, transparent 70%),
        radial-gradient(ellipse 50% 40% at 20% 90%, rgba(16, 185, 129, 0.06) 0%, transparent 65%);
    background-size: 32px 32px, 100% 100%, 100% 100%, 100% 100%, 100% 100%;
    pointer-events: none;
    z-index: 0;
}

body > * {
    position: relative;
    z-index: 1;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ================================================
   TOP BAR
   ================================================ */
.top-bar {
    background: rgba(8, 13, 26, 0.92);
    border-bottom: 1px solid rgba(251,191,36,0.12);
    padding: 10px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    backdrop-filter: blur(20px);
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 0;
    padding-bottom: 0;
}

.top-bar i {
    color: var(--gold);
    margin-left: 6px;
}

/* ================================================
   NAVBAR — Clean & Responsive
   ================================================ */
.navbar {
    background: rgba(8, 13, 26, 0.84);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.navbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0.35;
    pointer-events: none;
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0;
    gap: 12px;
    height: 62px;        /* fixed height — no wrapping ever */
    flex-wrap: nowrap;   /* never wrap the 3 zones */
    overflow: visible;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--gold);
    font-size: 1.25rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.logo i {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 8px rgba(251,191,36,0.5));
    animation: atomSpin 20s linear infinite;
}

@keyframes atomSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Center Nav Links */
.nav-links {
    display: flex;
    list-style: none;
    gap: 0;
    padding: 0;
    margin: 0;
    align-items: center;
    flex-wrap: nowrap;   /* NEVER wrap */
    flex-shrink: 1;
    overflow: hidden;
    justify-content: center;
    flex: 0 1 auto;      /* shrink if needed but don't grow beyond content */
}

.nav-links li {
    flex-shrink: 0;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 7px 11px;
    border-radius: var(--radius-full);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-links a i {
    font-size: 0.85rem;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--gold);
    background: rgba(251,191,36,0.1);
}

.nav-links a.highlight-link {
    color: var(--gold) !important;
    background: rgba(251,191,36,0.08);
    border: 1px solid rgba(251,191,36,0.2);
}

.nav-links a.highlight-link:hover {
    background: rgba(251,191,36,0.16);
    box-shadow: 0 0 18px rgba(251,191,36,0.18);
}

.nav-links a.nav-classroom-btn {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.25)) !important;
    border: 1px solid rgba(16, 185, 129, 0.45) !important;
    color: #34d399 !important;
}

.nav-links a.nav-classroom-btn:hover {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35) !important;
}

/* Right Actions Group */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;      /* never shrink — always visible */
    flex-wrap: nowrap;   /* NEVER wrap */
}

/* Attendance / Grades action buttons */
.nav-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    border: none;
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
}

.attendance-btn {
    background: linear-gradient(135deg, #059669, #047857);
    color: white;
    box-shadow: 0 3px 12px rgba(5,150,105,0.3);
}

.attendance-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(5,150,105,0.45);
}

.grades-btn {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    box-shadow: 0 3px 12px rgba(37,99,235,0.3);
}

.grades-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(37,99,235,0.45);
}

/* Theme toggle button — High visibility */
.theme-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1.5px solid var(--gold);
    background: rgba(251, 191, 36, 0.12);
    color: var(--gold);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
    box-shadow: 0 2px 12px rgba(251, 191, 36, 0.25);
}

.theme-btn:hover {
    background: var(--gold);
    color: #030712;
    border-color: var(--gold-light);
    transform: scale(1.08) rotate(15deg);
    box-shadow: 0 4px 20px rgba(251, 191, 36, 0.45);
}

/* Hamburger button */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--glass);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    padding: 0;
}

.hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: var(--transition);
}

.hamburger:hover {
    border-color: var(--gold);
    background: rgba(251,191,36,0.08);
}

.hamburger:hover span {
    background: var(--gold);
}

.hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Nav Dropdown */
.mobile-nav {
    display: none;
    flex-direction: column;
    background: rgba(5, 8, 20, 0.98);
    border-top: 1px solid var(--border);
    padding: 8px 0;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav.open {
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    transition: var(--transition-fast);
    border-right: 3px solid transparent;
}

.mobile-nav a:hover {
    color: var(--gold);
    background: rgba(251,191,36,0.06);
    border-right-color: var(--gold);
    padding-right: 30px;
}

.mobile-nav a i {
    width: 18px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--gold);
    opacity: 0.7;
}

.mobile-nav-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 20px;
}

.mobile-nav-green {
    color: #34d399 !important;
}

.mobile-nav-green i {
    color: #34d399 !important;
    opacity: 1 !important;
}

.mobile-nav-blue {
    color: #60a5fa !important;
}

.mobile-nav-blue i {
    color: #60a5fa !important;
    opacity: 1 !important;
}


/* ================================================
   HERO SEARCH & STUDENT TOOLKIT (ENHANCED UX)
   ================================================ */
.hero-search-bar {
    max-width: 620px;
    margin: 0 auto 28px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(251, 191, 36, 0.35);
    border-radius: 50px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 0 15px rgba(251, 191, 36, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-search-bar:hover {
    border-color: var(--primary-gold);
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.45), 0 0 25px rgba(251, 191, 36, 0.25);
    background: rgba(15, 23, 42, 0.9);
}

.hero-search-icon {
    font-size: 1.15rem;
    color: var(--primary-gold);
    transition: transform 0.3s ease;
}

.hero-search-bar:hover .hero-search-icon {
    transform: scale(1.15);
}

.hero-search-placeholder {
    color: #94a3b8;
    font-size: 0.98rem;
    flex: 1;
    text-align: right;
    user-select: none;
}

.hero-search-kbd {
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: var(--primary-gold);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

/* Student Toolkit Hub */
.student-toolkit {
    max-width: 960px;
    margin: 25px auto 0;
    padding: 16px 20px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.toolkit-header-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #94a3b8;
    margin-bottom: 12px;
}

.toolkit-header-label i {
    color: var(--primary-gold);
}

.toolkit-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

.toolkit-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid transparent;
    text-decoration: none;
    background: rgba(30, 41, 59, 0.8);
    color: #e2e8f0;
}

.toolkit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

.toolkit-btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.toolkit-btn-primary:hover {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.toolkit-btn-amber {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fbbf24;
}

.toolkit-btn-amber:hover {
    background: rgba(245, 158, 11, 0.22);
    border-color: #fbbf24;
    color: #fef08a;
}

.toolkit-btn-cyan {
    background: rgba(6, 182, 212, 0.12);
    border-color: rgba(6, 182, 212, 0.35);
    color: #38bdf8;
}

.toolkit-btn-cyan:hover {
    background: rgba(6, 182, 212, 0.22);
    border-color: #38bdf8;
    color: #e0f2fe;
}

.toolkit-btn-rose {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
    color: #f87171;
}

.toolkit-btn-rose:hover {
    background: rgba(239, 68, 68, 0.22);
    border-color: #ef4444;
    color: #fee2e2;
}

.toolkit-btn-purple {
    background: rgba(168, 85, 247, 0.12);
    border-color: rgba(168, 85, 247, 0.35);
    color: #c084fc;
}

.toolkit-btn-purple:hover {
    background: rgba(168, 85, 247, 0.22);
    border-color: #c084fc;
    color: #faf5ff;
}

.toolkit-btn-emerald {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(5, 150, 105, 0.22));
    border-color: rgba(16, 185, 129, 0.45);
    color: #34d399;
}

.toolkit-btn-emerald:hover {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    border-color: #10b981;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

.toolkit-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 4px;
}

@media (max-width: 768px) {
    .hero-search-bar {
        margin: 0 12px 20px;
        padding: 10px 16px;
    }
    .hero-search-placeholder {
        font-size: 0.88rem;
    }
    .hero-search-kbd {
        display: none;
    }
    .student-toolkit {
        margin: 20px 10px 0;
        padding: 12px;
    }
    .toolkit-divider {
        display: none;
    }
    .toolkit-btn {
        font-size: 0.8rem;
        padding: 7px 12px;
    }
}

.gsr-badge-type.type-lesson {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ================================================
   HERO SECTION
   ================================================ */
.hero {
    position: relative;
    padding: 120px 0 100px;
    text-align: center;
    overflow: hidden;
    background:
        radial-gradient(ellipse 100% 80% at 50% 0%, rgba(251,191,36,0.11) 0%, transparent 60%),
        radial-gradient(ellipse 80% 60% at 20% 100%, rgba(56,189,248,0.11) 0%, transparent 60%),
        linear-gradient(180deg, #0d172e 0%, var(--bg-primary) 100%);
}

/* Animated grid background */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(251,191,36,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(251,191,36,0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
}

/* Particles container */
#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Hero Watermark Mascot */
.hero-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(520px, 90vw);
    height: min(520px, 90vw);
    background-image: url('hero_mascot.jpg');
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.17;
    border-radius: 50%;
    filter: drop-shadow(0 0 50px rgba(56, 189, 248, 0.45));
    mask-image: radial-gradient(circle at center, rgba(0,0,0,1) 35%, rgba(0,0,0,0) 75%);
    -webkit-mask-image: radial-gradient(circle at center, rgba(0,0,0,1) 35%, rgba(0,0,0,0) 75%);
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.welcome-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(251,191,36,0.08);
    color: var(--gold);
    padding: 8px 22px;
    border-radius: var(--radius-full);
    font-size: 0.88rem;
    font-weight: 700;
    border: 1px solid rgba(251,191,36,0.2);
    margin-bottom: 28px;
    box-shadow: 0 0 30px rgba(251,191,36,0.1), inset 0 1px 0 rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
    animation: badgePulse 3s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 20px rgba(251,191,36,0.1), inset 0 1px 0 rgba(255,255,255,0.05); }
    50% { box-shadow: 0 0 35px rgba(251,191,36,0.25), inset 0 1px 0 rgba(255,255,255,0.05); }
}

.hero h1 {
    font-size: clamp(2rem, 4.5vw, 3.4rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    line-height: 1.35;
    letter-spacing: 0;
}

.hero h1 span {
    background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-deep));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 12px rgba(251,191,36,0.2));
}

.hero p {
    font-size: 1.12rem;
    color: var(--text-secondary);
    max-width: 680px;
    margin: 0 auto 35px;
    line-height: 1.85;
    font-weight: 400;
}

.hero-buttons {
    margin-bottom: 20px;
}

/* ================================================
   BUTTONS
   ================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 700;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 0.92rem;
    position: relative;
    overflow: hidden;
    white-space: normal;   /* allow wrapping if text is too long */
    text-align: center;
    line-height: 1.3;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: var(--transition);
}

.btn:hover::after {
    opacity: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-deep));
    color: #0a0a0a;
    box-shadow: 0 4px 20px rgba(251,191,36,0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(251,191,36,0.45);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    border: 1.5px solid var(--border);
    color: var(--gold);
    background: var(--glass);
    backdrop-filter: blur(10px);
}

.btn-outline:hover {
    border-color: var(--gold);
    background: rgba(251,191,36,0.1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
}

.btn-sm {
    padding: 7px 16px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

.btn-secondary {
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
    border: 1.5px solid rgba(255,255,255,0.1);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.25);
}

.btn-full {
    width: 100%;
    justify-content: center;
    margin-top: 10px;
    border-radius: var(--radius-md);
    font-weight: 800;
}

/* ================================================
   COURSES SECTION
   ================================================ */
.courses-section {
    padding: 100px 0;
}

.py-5 {
    padding-top: 80px;
    padding-bottom: 80px;
}

.section-header {
    margin-bottom: 60px;
    text-align: center;
}

.text-center {
    text-align: center;
}

.section-header h2 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 900;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ================================================
   COURSES GRID & CARDS
   ================================================ */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);   /* always 4 equal columns */
    gap: 20px;
    margin-top: 40px;
    align-items: stretch;                    /* all rows same height */
}

.course-card {
    background: rgba(13, 21, 38, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;              /* stretch inner content */
    flex-direction: column;
    align-items: stretch;
    height: 100%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* push buttons to bottom so all cards align horizontally */
.course-card > div:last-child,
.course-card > .btn:last-child,
.course-card > button:last-child {
    margin-top: auto !important;
    width: 100%;
}

.course-stats-bar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 12px;
    font-size: 0.78rem;
    color: #cbd5e1;
    font-weight: 600;
}

/* Course card buttons — compact and centered */
.course-card .btn {
    font-size: 0.78rem;
    padding: 9px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* Override: allow text to show on wider screens */
@media (min-width: 1200px) {
    .course-card .btn {
        font-size: 0.82rem;
        padding: 9px 10px;
    }
}

/* Shimmer top border on hover */
.course-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    transform: scaleX(0);
    transition: var(--transition-slow);
}

.course-card:hover::before {
    transform: scaleX(1);
}

/* Glow effect */
.course-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(251,191,36,0.05) 0%, transparent 70%);
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
}

.course-card:hover::after {
    opacity: 1;
}

.course-card:hover {
    transform: translateY(-8px);
    border-color: rgba(251,191,36,0.4);
    box-shadow: 0 20px 60px rgba(0,0,0,0.45), 0 0 35px rgba(251,191,36,0.2);
    background: rgba(18, 28, 52, 0.88);
}

.course-card h3 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 18px 0 10px;
}

.course-card p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-bottom: 20px;
    line-height: 1.7;
}

/* Course icon */
.course-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    margin: 0 auto 8px;
    position: relative;
    transition: var(--transition);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.course-card:hover .course-icon {
    transform: scale(1.1) rotate(-5deg);
}

.bg-blue {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 8px 25px rgba(37,99,235,0.35);
}

.bg-purple {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    box-shadow: 0 8px 25px rgba(124,58,237,0.35);
}

.bg-orange {
    background: linear-gradient(135deg, #ea580c, #c2410c);
    box-shadow: 0 8px 25px rgba(234,88,12,0.35);
}

/* Course features list */
.course-features {
    list-style: none;
    text-align: right;
    margin: 0 0 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    flex: 1;       /* grows to fill card height → buttons always at bottom */
}

.course-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.course-features li:hover {
    background: rgba(251,191,36,0.06);
    color: var(--text-primary);
}

.course-features li i {
    color: var(--gold);
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* ============================================================
   VIP Panoramic Virtual Lab Banner (Option 1)
   ============================================================ */
.virtual-lab-banner {
    grid-column: 1 / -1;
    margin-top: 10px;
    background: radial-gradient(circle at 10% 20%, rgba(255, 65, 108, 0.16), transparent 45%),
                radial-gradient(circle at 90% 80%, rgba(56, 189, 248, 0.12), transparent 45%),
                linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.92));
    border: 1px solid rgba(255, 65, 108, 0.38);
    border-radius: 24px;
    padding: 24px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.virtual-lab-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff416c, #f97316, #38bdf8);
    opacity: 0.85;
}

.virtual-lab-banner:hover {
    border-color: #ff416c;
    transform: translateY(-4px);
    box-shadow: 0 18px 45px rgba(255, 65, 108, 0.28), 0 0 25px rgba(255, 65, 108, 0.15);
}

.vlab-right {
    display: flex;
    align-items: center;
    gap: 22px;
    flex: 1;
    min-width: 0;
}

.vlab-icon-box {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: linear-gradient(135deg, #FF416C, #FF4B2B);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2rem;
    box-shadow: 0 10px 25px rgba(255, 65, 108, 0.45);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.virtual-lab-banner:hover .vlab-icon-box {
    transform: scale(1.08) rotate(-5deg);
}

.vlab-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: right;
}

.vlab-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.vlab-title-row h3 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: 0;
}

.vlab-badge {
    background: linear-gradient(135deg, #ff416c, #f97316);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 3px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(255, 65, 108, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.vlab-desc {
    margin: 0;
    font-size: 0.88rem;
    color: #94a3b8;
    line-height: 1.5;
}

.vlab-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.vlab-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 4px 11px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.virtual-lab-banner:hover .vlab-pill {
    background: rgba(255, 65, 108, 0.12);
    border-color: rgba(255, 65, 108, 0.35);
    color: #ffccd5;
}

.vlab-left {
    flex-shrink: 0;
}

.vlab-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.vlab-btn {
    background: linear-gradient(135deg, #FF416C, #FF4B2B) !important;
    color: #fff !important;
    border: none !important;
    padding: 13px 24px !important;
    border-radius: 14px !important;
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    box-shadow: 0 6px 20px rgba(255, 65, 108, 0.45) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    cursor: pointer;
    transition: all 0.25s ease !important;
    white-space: nowrap !important;
}

.vlab-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 65, 108, 0.65) !important;
}

.vlab-btn-games {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45) !important;
}

.vlab-btn-games:hover {
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.65) !important;
}

/* ================================================
   VIRTUAL LAB CATEGORY TABS & SWITCHER
   ================================================ */
.vlab-cat-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.vlab-cat-btn {
    flex: 1;
    min-width: 140px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-dim);
    padding: 10px 18px;
    border-radius: 12px;
    font-family: var(--font-primary);
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.vlab-cat-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.vlab-cat-btn.active[data-cat="sims"] {
    background: linear-gradient(135deg, #ff416c, #ff4b2b);
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(255, 65, 108, 0.35);
    border-color: rgba(255, 65, 108, 0.5);
}

.vlab-cat-btn.active[data-cat="games"] {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
    border-color: rgba(245, 158, 11, 0.5);
}

.vlab-cat-btn.active[data-cat="all"] {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35);
    border-color: rgba(59, 130, 246, 0.5);
}

.vlab-cat-count {
    font-size: 0.74rem;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.18);
    font-weight: 800;
}

.vlab-cat-btn:not(.active) .vlab-cat-count {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-dim);
}

.vlab-section-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 14px 0;
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
}

.vlab-section-divider .vlab-badge {
    margin-right: auto;
}

@media (max-width: 991px) {
    .virtual-lab-banner {
        flex-direction: column;
        align-items: flex-start;
        padding: 22px 24px;
        gap: 18px;
    }
    .vlab-right {
        width: 100%;
        gap: 16px;
    }
    .vlab-left {
        width: 100%;
    }
    .vlab-actions {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    .vlab-btn {
        width: 100% !important;
        justify-content: center;
        padding: 14px 20px !important;
    }
}

@media (max-width: 640px) {
    .virtual-lab-banner {
        padding: 18px 16px;
        border-radius: 20px;
        gap: 14px;
    }
    .vlab-right {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        gap: 12px;
    }
    .vlab-icon-box {
        width: 52px;
        height: 52px;
        border-radius: 14px;
        font-size: 1.45rem;
    }
    .vlab-title-row h3 {
        font-size: 1.1rem;
    }
    .vlab-badge {
        font-size: 0.68rem;
        padding: 2px 9px;
    }
    .vlab-desc {
        font-size: 0.8rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .vlab-pills {
        gap: 5px;
    }
    .vlab-pill {
        font-size: 0.68rem;
        padding: 3px 8px;
    }
}

/* ================================================
   MODAL SYSTEM
   ================================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: rgba(3, 7, 18, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 99999;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(145deg, #0d1629, #080d1a);
    width: 95%;
    max-width: 1000px;
    margin: 3% auto;
    border-radius: var(--radius-xl);
    padding: 0;
    border: 1px solid var(--border);
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 40px 100px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.03);
    animation: modalSlideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ================================================
   EXPANSIVE COURSE MODAL (شاشة المقرر الكاملة المستغلة للمساحة)
   ================================================ */
#courseModal .modal-content {
    width: 96vw !important;
    max-width: 1440px !important;
    height: 94vh !important;
    max-height: 94vh !important;
    margin: 3vh auto !important;
    border-radius: 22px;
    background: #080d1a !important;
    border: 1px solid rgba(251, 191, 36, 0.25);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.8), 0 0 40px rgba(59, 130, 246, 0.15);
    display: flex;
    flex-direction: column;
}

@media (min-width: 769px) and (max-width: 1200px) {
    #courseModal .modal-content {
        width: 98vw !important;
        max-width: 98vw !important;
        height: 96vh !important;
        max-height: 96vh !important;
        margin: 2vh auto !important;
        border-radius: 16px !important;
    }
}

#courseModal .modal-header-fancy {
    padding: 16px 24px;
    background: rgba(13, 21, 39, 0.96);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#courseModal .modal-body {
    flex: 1 1 0%;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 24px 28px;
    background: #070d18;
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    padding: 20px 28px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.02);
}

.modal-header h2 {
    color: var(--gold);
    margin: 0;
    font-size: 1.4rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header-fancy {
    background: linear-gradient(135deg, rgba(10,20,50,0.9), rgba(5,10,25,0.9));
    padding: 30px;
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.modal-header-fancy::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), var(--gold-deep), transparent);
}

.modal-header-fancy h2 {
    color: var(--gold);
    margin: 0;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 900;
}

.modal-body {
    padding: 28px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex-grow: 1;
}

.modal-body::-webkit-scrollbar {
    width: 5px;
}

.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
    background: rgba(251,191,36,0.3);
    border-radius: 10px;
}

.modal-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Close button */
.close-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    border: 1px solid rgba(255,255,255,0.08);
    line-height: 1;
}

.close-btn:hover {
    background: rgba(251,191,36,0.15);
    color: var(--gold);
    border-color: rgba(251,191,36,0.3);
    transform: rotate(90deg);
}

/* ================================================
   MODAL GRID & CONTENT ITEMS
   ================================================ */
.modal-section-title {
    color: var(--gold);
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    margin: 28px 0 18px;
    font-size: 1.1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-section-title:first-child {
    margin-top: 0;
}

.modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.content-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    padding: 18px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.content-item::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--gold), var(--gold-deep));
    transform: scaleY(0);
    transition: var(--transition);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.content-item:hover::before {
    transform: scaleY(1);
}

.content-item:hover {
    background: rgba(251,191,36,0.06);
    border-color: rgba(251,191,36,0.3);
    transform: translateX(-4px);
    box-shadow: var(--shadow-md);
}

.content-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    box-shadow: var(--shadow-sm);
}

.content-info {
    flex-grow: 1;
}

.content-info h4 {
    margin: 0 0 4px 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
}

.content-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.item-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 0.68rem;
    padding: 2px 8px;
    background: rgba(251,191,36,0.1);
    color: var(--gold);
    border-radius: var(--radius-full);
    font-weight: 700;
}

/* ================================================
   SIMULATION MODAL
   ================================================ */
.sim-modal-content {
    max-width: 1100px !important;
    height: 92vh;
    display: flex;
    flex-direction: column;
}

@keyframes simSpin {
    to { transform: rotate(360deg); }
}


.iframe-container {
    flex: 1;
    overflow: hidden;
    background: #000;
}

.iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.fullscreen-btn-modal {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--gold);
    cursor: pointer;
    font-size: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.fullscreen-btn-modal:hover {
    background: rgba(251,191,36,0.15);
    border-color: var(--gold);
}

/* ================================================
   WHITEBOARD MODAL
   ================================================ */
.wb-modal-content {
    max-width: 95% !important;
    width: 95% !important;
    height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
}

.wb-toolbar {
    padding: 12px 20px;
    background: rgba(5, 10, 20, 0.95);
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.wb-tool {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.wb-tool:hover {
    transform: scale(1.15);
    border-color: rgba(255,255,255,0.5);
}

.wb-tool.active {
    border-color: white;
    box-shadow: 0 0 12px rgba(255,255,255,0.4);
}

.wb-canvas-container {
    flex-grow: 1;
    background: white;
    cursor: crosshair;
    position: relative;
    overflow: hidden;
}

#wbCanvas {
    display: block;
    background: white;
}

/* ================================================
   CLASSROOM & PROJECTOR SPLIT MODE (العرض الصفي)
   ================================================ */
.classroom-modal-content {
    max-width: 98vw !important;
    width: 98vw !important;
    height: 94vh;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    background: #080d1a !important;
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.8), 0 0 40px rgba(59, 130, 246, 0.15);
    overflow: hidden;
}

.classroom-header {
    padding: 10px 18px;
    background: rgba(13, 21, 39, 0.96);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    z-index: 10;
}

.classroom-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.classroom-tag {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.classroom-select {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: #f8fafc;
    border-radius: 10px;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-family: var(--font-primary);
    font-weight: 600;
    outline: none;
    cursor: pointer;
    max-width: 280px;
}

.classroom-view-toggles {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 3px;
    gap: 4px;
}

.cr-mode-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-primary);
}

.cr-mode-btn:hover {
    color: #ffffff;
}

.cr-mode-btn.active {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.4);
}

.classroom-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cr-tool-btn {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    font-family: var(--font-primary);
}

.cr-tool-btn:hover {
    background: rgba(51, 65, 85, 0.9);
    border-color: var(--gold);
    color: #ffffff;
}

.cr-tool-btn.active {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #fca5a5;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}

.laser-dot-icon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
    display: inline-block;
}

.cr-zoom-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cr-mini-btn {
    width: 32px;
    height: 32px;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.cr-mini-btn:hover {
    background: rgba(251, 191, 36, 0.2);
    color: var(--gold);
}

.classroom-stage {
    flex: 1;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    position: relative;
    background: #060a14;
    min-height: 0;
}

.classroom-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transition: flex 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0;
}

#classroomSimPane {
    border-left: 2px solid rgba(255, 255, 255, 0.08);
}

.cr-pane-bar {
    padding: 8px 16px;
    background: rgba(15, 23, 42, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    font-weight: 700;
    color: #e2e8f0;
}

.cr-link-btn {
    color: #38bdf8;
    text-decoration: none;
    font-size: 0.85rem;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(56, 189, 248, 0.1);
    transition: all 0.2s;
}

.cr-link-btn:hover {
    background: rgba(56, 189, 248, 0.25);
    color: #ffffff;
}

.classroom-iframe-wrapper {
    flex: 1;
    position: relative;
    background: #000;
    overflow: hidden;
    min-height: 0;
}

.classroom-iframe-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.cr-wb-bar {
    gap: 10px;
    flex-wrap: wrap;
}

.cr-colors {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cr-color-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s;
}

.cr-color-btn:hover {
    transform: scale(1.15);
}

.cr-color-btn.active {
    border-color: #ffffff;
    box-shadow: 0 0 8px currentColor;
    transform: scale(1.15);
}

.cr-wb-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
}

.cr-formula-select {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    outline: none;
    font-family: var(--font-primary);
}

.cr-action-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
}

.cr-action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.cr-action-btn.active {
    background: rgba(245, 158, 11, 0.25);
    border-color: var(--gold);
    color: var(--gold);
}

.cr-canvas-container {
    flex: 1;
    position: relative;
    background: #0b1120;
    background-image: 
        radial-gradient(rgba(255, 255, 255, 0.08) 1.2px, transparent 1.2px);
    background-size: 26px 26px;
    cursor: crosshair;
    overflow: hidden;
    min-height: 0;
}

#classroomCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Floating Laser Pointer Overlay */
.cr-laser-pointer {
    position: fixed;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ff0055;
    box-shadow: 0 0 16px 6px rgba(255, 0, 85, 0.75), 0 0 35px 15px rgba(255, 0, 85, 0.4);
    pointer-events: none;
    z-index: 10002;
    display: none;
    transform: translate(-50%, -50%);
    transition: opacity 0.15s ease;
}

/* ================================================
   FOOTER
   ================================================ */
footer {
    padding: 60px 0 30px;
    border-top: 1px solid var(--border);
    margin-top: 60px;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0.3;
}

.footer-content {
    display: grid;
    grid-template-columns: minmax(280px, 360px) 1fr;
    gap: 40px;
    margin-bottom: 35px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--gold);
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 16px;
}

.footer-logo i {
    font-size: 1.5rem;
}

.footer-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.8;
}

.footer-links h4,
.footer-credits h4 {
    color: var(--gold);
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Modern Course Cards in Footer ── */
.footer-courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.footer-course-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.footer-course-chip:hover {
    background: rgba(251, 191, 36, 0.08);
    border-color: rgba(251, 191, 36, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.fc-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    border: 1px solid transparent;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.footer-course-chip:hover .fc-icon {
    transform: scale(1.1);
}

.fc-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.fc-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
}

.fc-desc {
    font-size: 0.76rem;
    color: var(--text-dim);
}

.fc-arrow {
    font-size: 0.8rem;
    color: var(--text-dim);
    transition: transform 0.2s ease, color 0.2s ease;
    opacity: 0.6;
}

.footer-course-chip:hover .fc-arrow {
    transform: translateX(-4px);
    color: var(--gold);
    opacity: 1;
}

/* ── Footer Supervisor & Email Badge ── */
.footer-supervisor-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 20px;
    border-radius: 50px;
    margin: 0 auto 24px;
    flex-wrap: wrap;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.25s ease;
}

.footer-supervisor-card:hover {
    border-color: rgba(56, 189, 248, 0.35);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.f-sup-name {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 700;
}

.f-sup-divider {
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.8rem;
    user-select: none;
}

.f-sup-email {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #38bdf8;
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 600;
    direction: ltr;
    unicode-bidi: isolate;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.2);
    transition: all 0.2s ease;
}

.f-sup-email:hover {
    background: #38bdf8;
    color: #0b1120 !important;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.35);
    transform: translateY(-1px);
}

.f-sup-email:hover i {
    color: #0b1120 !important;
}

.footer-links ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-links ul li a:hover {
    color: var(--gold);
    padding-right: 5px;
}

.footer-credits p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.footer-email-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.25s ease;
    direction: ltr;
}

.footer-email-link:hover {
    background: rgba(56, 189, 248, 0.22);
    border-color: #38bdf8;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.3);
    transform: translateY(-1px);
}

body[data-theme="dark"] .footer-email-link {
    background: rgba(30, 64, 175, 0.08);
    border-color: rgba(30, 64, 175, 0.3);
    color: #1e40af;
}

body[data-theme="dark"] .footer-email-link:hover {
    background: #1e40af;
    color: #ffffff;
    border-color: #1e40af;
    box-shadow: 0 4px 14px rgba(30, 64, 175, 0.25);
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.05);
    color: var(--text-dim);
    font-size: 0.85rem;
}

/* ================================================
   EVIDENCE SECTION
   ================================================ */
.evidence-section {
    background: linear-gradient(to bottom, var(--bg-primary), var(--bg-secondary));
    padding: 100px 0;
    position: relative;
}

.evidence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
    margin-top: 60px;
}

.evidence-card {
    background: rgba(10, 15, 30, 0.7);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 30px;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    backdrop-filter: blur(20px);
}

.evidence-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--gold-deep));
    transform: scaleX(0);
    transition: var(--transition);
    transform-origin: right;
}

.evidence-card:hover {
    transform: translateY(-10px);
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(251,191,36,0.35);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), var(--shadow-gold);
}

.evidence-card:hover::after {
    transform: scaleX(1);
}

.evidence-card.highlighted {
    border-color: var(--gold);
    background: rgba(251,191,36,0.04);
}

.evidence-badge {
    position: absolute;
    top: 18px;
    left: 18px;
    background: rgba(251,191,36,0.12);
    color: var(--gold);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 800;
    border: 1px solid rgba(251,191,36,0.2);
}

.evidence-percentage {
    position: absolute;
    top: 18px;
    right: 18px;
    background: linear-gradient(135deg, var(--gold), var(--gold-deep));
    color: #0a0a0a;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.78rem;
    box-shadow: 0 4px 15px rgba(251,191,36,0.35);
    z-index: 2;
}

.evidence-icon {
    width: 80px;
    height: 80px;
    background: rgba(251,191,36,0.08);
    color: var(--gold);
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 24px;
    transition: var(--transition);
    border: 1px solid rgba(251,191,36,0.15);
}

.evidence-card:hover .evidence-icon {
    transform: rotate(10deg) scale(1.1);
    background: linear-gradient(135deg, var(--gold), var(--gold-deep));
    color: #0a0a0a;
    border-color: transparent;
}

.evidence-card h3 {
    color: var(--text-primary);
    margin-bottom: 14px;
    font-size: 1.4rem;
    font-weight: 800;
}

.evidence-card p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-bottom: 24px;
    line-height: 1.7;
}

.evidence-list {
    list-style: none;
    width: 100%;
    text-align: right;
    margin-bottom: 28px;
    flex-grow: 1;
}

.evidence-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-size: 0.9rem;
    transition: var(--transition-fast);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
}

.evidence-card:hover .evidence-list li {
    background: rgba(255,255,255,0.02);
}

.evidence-list li:hover {
    background: rgba(251,191,36,0.08) !important;
    color: var(--text-primary);
    transform: translateX(-4px);
}

.evidence-list li i {
    color: var(--gold);
    font-size: 0.78rem;
    flex-shrink: 0;
}

/* ================================================
   COMPACT EVIDENCE CARDS (in modal)
   ================================================ */
.ev-compact {
    position: relative;
    cursor: pointer;
}

.ev-pct-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: linear-gradient(135deg, var(--gold), var(--gold-deep));
    color: #0a0a0a;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    box-shadow: 0 3px 10px rgba(251,191,36,0.3);
    z-index: 2;
}

.ev-upload-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(251,191,36,0.06);
    border: 1px solid var(--border);
    color: var(--gold);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    margin-top: 10px;
    transition: var(--transition);
}

.ev-upload-chip.has-files {
    background: rgba(251,191,36,0.15);
    border-color: rgba(251,191,36,0.4);
    box-shadow: 0 0 10px rgba(251,191,36,0.15);
}

.ev-section-title {
    color: var(--gold);
    font-size: 0.98rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0 8px;
    border-bottom: 1px solid var(--border);
    margin: 18px 0 14px;
}

.ev-section-title:first-child {
    margin-top: 0;
}

/* ================================================
   UPLOAD ZONE
   ================================================ */
.upload-zone {
    width: 100%;
    margin-top: 14px;
    border: 2px dashed rgba(251,191,36,0.25);
    border-radius: var(--radius-md);
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(251,191,36,0.02);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--gold);
    background: rgba(251,191,36,0.06);
    transform: scale(1.01);
    box-shadow: 0 0 25px rgba(251,191,36,0.1);
}

.upload-zone i {
    font-size: 1.8rem;
    color: var(--gold);
    opacity: 0.7;
}

.upload-zone span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.upload-zone span strong {
    color: var(--gold);
}

.upload-zone small {
    font-size: 0.72rem;
    color: var(--text-dim);
}

.upload-counter {
    position: absolute;
    top: 8px;
    left: 10px;
    background: var(--gold);
    color: #0a0a0a;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    display: none;
}

.upload-counter.has-files {
    display: block;
}

/* ================================================
   UPLOADED FILES LIST
   ================================================ */
.uploaded-files-list {
    width: 100%;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.uploaded-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(251,191,36,0.1);
    border-radius: var(--radius-sm);
    padding: 9px 14px;
    transition: var(--transition);
    cursor: pointer;
}

.uploaded-file-item:hover {
    background: rgba(251,191,36,0.06);
    border-color: rgba(251,191,36,0.3);
}

.uploaded-file-item .file-icon {
    font-size: 1.1rem;
    min-width: 22px;
    text-align: center;
}

.file-icon.pdf   { color: #ef4444; }
.file-icon.img   { color: var(--emerald); }
.file-icon.word  { color: var(--blue); }
.file-icon.other { color: var(--purple); }

.uploaded-file-item .file-name {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
}

.uploaded-file-item .file-size {
    font-size: 0.7rem;
    color: var(--text-dim);
    white-space: nowrap;
}

.uploaded-file-item .file-delete {
    color: #ef4444;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    border: none;
    background: none;
    line-height: 1;
}

.uploaded-file-item .file-delete:hover {
    background: rgba(239,68,68,0.15);
}

/* ================================================
   GLOBAL SEARCH (GSR)
   ================================================ */
.gsr-box {
    background: linear-gradient(145deg, #080e20, #060b18);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 95%;
    max-width: 720px;
    margin: 5vh auto;
    overflow: hidden;
    box-shadow: 0 40px 100px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.03);
    display: flex;
    flex-direction: column;
    max-height: 88vh;
    animation: modalSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gsr-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    background: rgba(251,191,36,0.02);
}

.gsr-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    transition: var(--transition);
}

.gsr-input-wrap:focus-within {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(251,191,36,0.1);
    background: rgba(251,191,36,0.03);
}

.gsr-icon {
    color: var(--gold);
    font-size: 1rem;
    flex-shrink: 0;
    opacity: 0.8;
}

.gsr-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 1.05rem;
    direction: rtl;
}

.gsr-input::placeholder {
    color: var(--text-dim);
    opacity: 0.7;
}

.gsr-clear {
    background: rgba(251,191,36,0.12);
    border: none;
    color: var(--gold);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    transition: var(--transition);
}

.gsr-clear:hover {
    background: rgba(251,191,36,0.25);
}

.gsr-close {
    color: var(--text-secondary);
    font-size: 1.7rem;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
    transition: var(--transition);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
}

.gsr-close:hover {
    color: var(--gold);
    background: rgba(251,191,36,0.1);
    transform: rotate(90deg);
}

.gsr-stats {
    padding: 8px 24px;
    font-size: 0.8rem;
    color: var(--text-dim);
    border-bottom: 1px solid rgba(251,191,36,0.06);
    min-height: 32px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gsr-results {
    overflow-y: auto;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.gsr-results::-webkit-scrollbar {
    width: 4px;
}

.gsr-results::-webkit-scrollbar-thumb {
    background: rgba(251,191,36,0.25);
    border-radius: 10px;
}

.gsr-welcome {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-dim);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.gsr-welcome strong { color: var(--gold); }
.gsr-welcome small { opacity: 0.5; font-size: 0.85rem; }

.gsr-result-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(251,191,36,0.1);
    background: rgba(255,255,255,0.02);
    cursor: pointer;
    transition: var(--transition);
    text-align: right;
}

.gsr-result-card:hover {
    background: rgba(251,191,36,0.07);
    border-color: rgba(251,191,36,0.3);
    transform: translateX(-4px);
    box-shadow: var(--shadow-sm);
}

.gsr-result-icon {
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: white;
    flex-shrink: 0;
}

.gsr-result-info { flex: 1; overflow: hidden; }

.gsr-result-info h4 {
    color: var(--text-primary);
    font-size: 0.95rem;
    margin: 0 0 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 700;
}

.gsr-result-info p {
    color: var(--text-secondary);
    font-size: 0.78rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gsr-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.gsr-badge-course {
    font-size: 0.63rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge-phys1 { background: rgba(59,130,246,0.18); color: var(--blue-light); }
.badge-phys2 { background: rgba(139,92,246,0.18); color: var(--purple-light); }
.badge-phys3 { background: rgba(249,115,22,0.18); color: #fb923c; }

.gsr-badge-type {
    font-size: 0.6rem;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.type-sim  { background: rgba(239,68,68,0.15); color: #f87171; }
.type-game { background: rgba(16,185,129,0.15); color: var(--emerald-light); }

.gsr-no-results {
    text-align: center;
    padding: 40px;
    color: var(--text-dim);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* ================================================
   SEARCH FAB
   ================================================ */
#globalSearchFab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    left: auto;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-deep));
    color: #0a0a0a;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: 0 8px 25px rgba(251,191,36,0.4), 0 0 0 0 rgba(251,191,36,0.4);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    animation: fabPulse 3s ease-in-out infinite;
}

@keyframes fabPulse {
    0%, 100% { box-shadow: 0 8px 25px rgba(251,191,36,0.4), 0 0 0 0 rgba(251,191,36,0.2); }
    50% { box-shadow: 0 8px 30px rgba(251,191,36,0.5), 0 0 0 8px rgba(251,191,36,0); }
}

#globalSearchFab:hover {
    transform: scale(1.12);
    box-shadow: 0 12px 35px rgba(251,191,36,0.55);
}

/* ================================================
   SIMULATION SEARCH BAR
   ================================================ */
.sim-search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    margin-bottom: 20px;
    transition: var(--transition);
}

.sim-search-wrap:focus-within {
    border-color: var(--gold);
    background: rgba(251,191,36,0.04);
    box-shadow: 0 0 0 3px rgba(251,191,36,0.08);
}

.sim-search-icon {
    color: var(--gold);
    font-size: 0.95rem;
    opacity: 0.7;
    flex-shrink: 0;
}

.sim-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    direction: rtl;
}

.sim-search-input::placeholder {
    color: var(--text-dim);
    opacity: 0.7;
}

.sim-search-clear {
    background: rgba(251,191,36,0.12);
    border: none;
    color: var(--gold);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    transition: var(--transition);
    flex-shrink: 0;
}

.sim-search-clear:hover {
    background: rgba(251,191,36,0.25);
}

.sim-no-results {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    color: var(--text-dim);
    text-align: center;
    width: 100%;
}

/* ================================================
   ANIMATIONS
   ================================================ */
.fade-in {
    animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { transform: translateY(24px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ================================================
   GAMES SECTION
   ================================================ */
.games-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 800;
}

.games-count-badge {
    margin-right: auto;
    background: linear-gradient(135deg, var(--gold), var(--orange));
    color: #0a0a0a;
    font-size: 0.72rem;
    font-weight: 900;
    padding: 3px 12px;
    border-radius: var(--radius-full);
    box-shadow: 0 2px 12px rgba(251,191,36,0.35);
    animation: pulseBadge 2.5s ease-in-out infinite;
}

@keyframes pulseBadge {
    0%, 100% { box-shadow: 0 2px 12px rgba(251,191,36,0.35); }
    50% { box-shadow: 0 2px 22px rgba(251,191,36,0.6); }
}

.games-intro-text {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin: -10px 0 18px;
    padding: 12px 16px;
    background: rgba(251,191,36,0.04);
    border-radius: var(--radius-sm);
    border-right: 3px solid var(--gold);
    display: flex;
    align-items: center;
    gap: 8px;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
    margin-bottom: 10px;
}

.game-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 22px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 200px;
}

.game-card-bg {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 4px;
    opacity: 0.9;
    transition: height 0.35s ease;
    z-index: 0;
}

.game-card:hover {
    transform: translateY(-8px) scale(1.01);
    border-color: rgba(255,255,255,0.2);
    box-shadow: 0 24px 50px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.06);
}

.game-card:hover .game-card-bg {
    height: 6px;
}

.game-card:active {
    transform: translateY(-4px) scale(0.99);
}

.game-card-icon {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    transition: transform 0.35s ease;
    z-index: 1;
    position: relative;
}

.game-card:hover .game-card-icon {
    transform: rotate(-8deg) scale(1.12);
}

.game-card-body {
    flex: 1;
    z-index: 1;
    position: relative;
}

.game-badge {
    display: inline-block;
    font-size: 0.66rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.12);
    margin-bottom: 8px;
}

.game-title {
    color: white;
    font-size: 0.98rem;
    font-weight: 700;
    margin: 0 0 6px;
    line-height: 1.4;
}

.game-desc {
    color: rgba(255,255,255,0.55);
    font-size: 0.8rem;
    margin: 0;
    line-height: 1.6;
}

.game-play-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.16);
    width: fit-content;
    transition: all 0.25s ease;
    z-index: 1;
    position: relative;
    font-family: var(--font-primary);
}

.game-play-btn i {
    font-size: 0.68rem;
    transition: transform 0.25s ease;
}

.game-card:hover .game-play-btn {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.35);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.game-card:hover .game-play-btn i {
    transform: scale(1.3);
}

/* ================================================
   PWA INSTALL BUTTON
   ================================================ */
#pwa-install-btn {
    display: none;
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    color: white;
    border: none;
    border-radius: var(--radius-full);
    padding: 13px 22px;
    font-family: var(--font-primary);
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(37,99,235,0.4);
    z-index: 9999;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

#pwa-install-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(37,99,235,0.5);
}

/* ================================================
   TIMER MODAL
   ================================================ */
#timerModal .modal-content {
    max-width: 300px;
    text-align: center;
}

#timerDisplay {
    font-size: 3rem;
    font-weight: 900;
    margin: 20px 0;
    font-family: 'Courier New', monospace;
    color: var(--blue-light);
    text-shadow: 0 0 20px rgba(96,165,250,0.4);
}

#timerInput {
    width: 70px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--glass);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    text-align: center;
}

/* ================================================
   ATTENDANCE & GRADES MODALS
   ================================================ */
#attendanceModal h2,
#gradesModal h2 {
    color: var(--gold) !important;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table th {
    background: rgba(251,191,36,0.08);
    color: var(--gold);
    font-weight: 800;
    padding: 12px;
    text-align: right;
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--text-secondary);
}

.table tbody tr:hover td {
    background: rgba(255,255,255,0.02);
    color: var(--text-primary);
}

/* ================================================
   THEME SWITCHING
   The JS toggles data-theme="dark" on/off.
   Default (no attr) = Dark Mode (current design)
   data-theme="dark"  = Light Mode for daytime use
   ================================================ */

body[data-theme="dark"] {
    --bg-primary: #f0f4f8;
    --bg-secondary: #e2e8f0;
    --bg-tertiary: #cbd5e1;
    --bg-card: rgba(255, 255, 255, 0.85);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-dim: #94a3b8;
    --border: rgba(30, 64, 175, 0.15);
    --border-hover: rgba(30, 64, 175, 0.4);
    --glass: rgba(255, 255, 255, 0.7);
    --glass-hover: rgba(255, 255, 255, 0.9);

    background-color: var(--bg-primary);
    color: var(--text-primary);
}

body[data-theme="dark"]::before {
    background-image:
        radial-gradient(rgba(30, 64, 175, 0.08) 1.2px, transparent 1.2px),
        radial-gradient(ellipse 85% 60% at 15% 10%, rgba(59, 130, 246, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 70% 55% at 85% 85%, rgba(139, 92, 246, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 50% 50%, rgba(245, 158, 11, 0.05) 0%, transparent 70%);
    background-size: 32px 32px, 100% 100%, 100% 100%, 100% 100%;
}

body[data-theme="dark"] #particles-js {
    opacity: 0.18;
    filter: invert(1);
}

body[data-theme="dark"] .navbar {
    background: rgba(240, 244, 248, 0.94);
    border-bottom-color: rgba(30, 64, 175, 0.15);
}

body[data-theme="dark"] .nav-classroom-btn {
    background: linear-gradient(135deg, #059669, #10b981) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3) !important;
}

body[data-theme="dark"] .top-bar {
    background: rgba(226, 232, 240, 0.98);
    border-bottom-color: rgba(30, 64, 175, 0.1);
    color: #475569;
}

body[data-theme="dark"] .logo,
body[data-theme="dark"] .centered-logo {
    color: #1e40af;
}

body[data-theme="dark"] .nav-links a {
    color: #475569;
}

body[data-theme="dark"] .nav-links a:hover,
body[data-theme="dark"] .nav-links a.active {
    color: #1e40af;
    background: rgba(30, 64, 175, 0.08);
}

body[data-theme="dark"] .hero {
    background:
        radial-gradient(ellipse 100% 80% at 50% 0%, rgba(30,64,175,0.06) 0%, transparent 60%),
        linear-gradient(180deg, #dbe4f3 0%, #f0f4f8 100%);
}

body[data-theme="dark"] .hero-watermark {
    opacity: 0.12;
    filter: drop-shadow(0 0 30px rgba(30, 64, 175, 0.25));
}

body[data-theme="dark"] .hero::before {
    background-image:
        linear-gradient(rgba(30,64,175,0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(30,64,175,0.06) 1px, transparent 1px);
}

body[data-theme="dark"] .hero h1 {
    color: #0f172a;
}

body[data-theme="dark"] .hero h1 span {
    background: linear-gradient(135deg, #1e40af, #3b82f6, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body[data-theme="dark"] .hero p {
    color: #475569;
}

/* ── Day Mode Hero Search Bar ── */
body[data-theme="dark"] .hero-search-bar {
    background: rgba(255, 255, 255, 0.92);
    border: 1.5px solid rgba(30, 64, 175, 0.25);
    box-shadow: 0 8px 30px rgba(30, 64, 175, 0.08), 0 2px 6px rgba(0, 0, 0, 0.03);
}
body[data-theme="dark"] .hero-search-bar:hover {
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 12px 35px rgba(37, 99, 235, 0.16);
}
body[data-theme="dark"] .hero-search-placeholder {
    color: #64748b;
}
body[data-theme="dark"] .hero-search-icon {
    color: #2563eb;
}
body[data-theme="dark"] .hero-search-kbd {
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.2);
    color: #1e40af;
}

/* ── Day Mode Student Toolkit ── */
body[data-theme="dark"] .student-toolkit {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(30, 64, 175, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}
body[data-theme="dark"] .toolkit-header-label {
    color: #1e293b;
    border-bottom: 1px solid rgba(30, 64, 175, 0.1);
}
body[data-theme="dark"] .toolkit-header-label i {
    color: #2563eb;
}
body[data-theme="dark"] .toolkit-btn {
    background: rgba(241, 245, 249, 0.95);
    border: 1px solid rgba(30, 64, 175, 0.15);
    color: #1e293b;
}
body[data-theme="dark"] .toolkit-btn:hover {
    background: #ffffff;
    border-color: #2563eb;
    color: #1e40af;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.15);
}
body[data-theme="dark"] .toolkit-btn-primary {
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.25);
    color: #1e40af;
}
body[data-theme="dark"] .toolkit-btn-amber {
    background: rgba(217, 119, 6, 0.1);
    border-color: rgba(217, 119, 6, 0.25);
    color: #b45309;
}
body[data-theme="dark"] .toolkit-btn-cyan {
    background: rgba(2, 132, 199, 0.1);
    border-color: rgba(2, 132, 199, 0.25);
    color: #0369a1;
}
body[data-theme="dark"] .toolkit-btn-rose {
    background: rgba(225, 29, 72, 0.1);
    border-color: rgba(225, 29, 72, 0.25);
    color: #be123c;
}
body[data-theme="dark"] .toolkit-btn-purple {
    background: rgba(124, 58, 237, 0.1);
    border-color: rgba(124, 58, 237, 0.25);
    color: #6d28d9;
}
body[data-theme="dark"] .toolkit-btn-emerald {
    background: rgba(5, 150, 105, 0.1);
    border-color: rgba(5, 150, 105, 0.25);
    color: #047857;
}
body[data-theme="dark"] .toolkit-divider {
    background: rgba(30, 64, 175, 0.15);
}

body[data-theme="dark"] .welcome-badge {
    background: rgba(30, 64, 175, 0.08);
    color: #1e40af;
    border-color: rgba(30, 64, 175, 0.2);
}

/* ── Day Mode Course Cards ── */
body[data-theme="dark"] .course-card {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(30, 64, 175, 0.14) !important;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.05) !important;
}

body[data-theme="dark"] .course-card:hover {
    border-color: #2563eb !important;
    background: #ffffff !important;
    box-shadow: 0 16px 40px rgba(37, 99, 235, 0.15) !important;
}

body[data-theme="dark"] .course-card h3 {
    color: #0f172a !important;
}

body[data-theme="dark"] .course-card p {
    color: #475569 !important;
}

body[data-theme="dark"] .course-stats-bar {
    background: #f1f5f9 !important;
    border: 1px solid rgba(30, 64, 175, 0.12) !important;
    color: #334155 !important;
}

body[data-theme="dark"] .course-card .btn-primary {
    background: linear-gradient(135deg, #1e40af, #2563eb) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.25) !important;
}

body[data-theme="dark"] .course-card .btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af) !important;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4) !important;
}

/* ── Day Mode Virtual Lab Banner ── */
body[data-theme="dark"] .virtual-lab-banner {
    background: linear-gradient(135deg, #ffffff, #f8fafc) !important;
    border: 1px solid rgba(30, 64, 175, 0.18) !important;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.06) !important;
}
body[data-theme="dark"] .vlab-text h3 {
    color: #0f172a !important;
}
body[data-theme="dark"] .vlab-desc {
    color: #475569 !important;
}
body[data-theme="dark"] .vlab-desc strong {
    color: #1e293b !important;
}
body[data-theme="dark"] .vlab-pill {
    background: #f1f5f9 !important;
    border-color: rgba(30, 64, 175, 0.15) !important;
    color: #334155 !important;
}
body[data-theme="dark"] .vlab-badge {
    background: rgba(245, 158, 11, 0.12) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
    color: #b45309 !important;
}

/* ── Day Mode Mobile Nav ── */
body[data-theme="dark"] .mobile-nav {
    background: rgba(255, 255, 255, 0.98) !important;
    border-bottom: 2px solid rgba(30, 64, 175, 0.15) !important;
}
body[data-theme="dark"] .mobile-nav a {
    color: #1e293b !important;
    border-bottom: 1px solid rgba(30, 64, 175, 0.08) !important;
}

/* ── Day Mode Classroom Modal ── */
body[data-theme="dark"] .classroom-modal-content {
    background: #f8fafc !important;
    border-color: rgba(30, 64, 175, 0.25) !important;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25) !important;
}
body[data-theme="dark"] .classroom-header {
    background: #f1f5f9 !important;
    border-bottom-color: rgba(30, 64, 175, 0.15) !important;
}
body[data-theme="dark"] .classroom-select {
    background: #ffffff !important;
    border-color: rgba(30, 64, 175, 0.25) !important;
    color: #0f172a !important;
}
body[data-theme="dark"] .cr-mode-btn {
    color: #475569 !important;
}
body[data-theme="dark"] .cr-mode-btn.active {
    background: #1e40af !important;
    color: #ffffff !important;
}
body[data-theme="dark"] .cr-tool-btn {
    background: #ffffff !important;
    border-color: rgba(30, 64, 175, 0.2) !important;
    color: #1e293b !important;
}
body[data-theme="dark"] .cr-pane-bar {
    background: #f1f5f9 !important;
    border-bottom-color: rgba(30, 64, 175, 0.15) !important;
    color: #0f172a !important;
}
body[data-theme="dark"] .cr-canvas-container {
    background: #ffffff !important;
    background-image: radial-gradient(rgba(30, 64, 175, 0.12) 1.2px, transparent 1.2px) !important;
}
body[data-theme="dark"] .cr-formula-select {
    background: #ffffff !important;
    border-color: rgba(30, 64, 175, 0.25) !important;
    color: #1e40af !important;
}
body[data-theme="dark"] .cr-action-btn {
    background: #ffffff !important;
    border-color: rgba(30, 64, 175, 0.15) !important;
    color: #1e293b !important;
}

/* ── Day Mode Expansive Course Modal ── */
body[data-theme="dark"] #courseModal .modal-content {
    background: #ffffff !important;
    border: 1px solid rgba(30, 64, 175, 0.2) !important;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.1) !important;
}

body[data-theme="dark"] #courseModal .modal-header-fancy {
    background: #f1f5f9 !important;
    border-bottom: 1px solid rgba(30, 64, 175, 0.15) !important;
}

body[data-theme="dark"] #courseModal .modal-header-fancy h2 {
    color: #0f172a !important;
}

body[data-theme="dark"] #courseModal .modal-body {
    background: #f8fafc !important;
}

body[data-theme="dark"] #courseModal .ch-card,
body[data-theme="dark"] #courseModal .lesson-card-item {
    background: #ffffff !important;
    border-color: rgba(30, 64, 175, 0.18) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04) !important;
}

body[data-theme="dark"] #courseModal .ch-card h4,
body[data-theme="dark"] #courseModal .lesson-card-item h4 {
    color: #0f172a !important;
}

body[data-theme="dark"] #courseModal .ch-card p,
body[data-theme="dark"] #courseModal .lesson-card-item p {
    color: #475569 !important;
}

body[data-theme="dark"] #courseModal .ch-progress-box {
    background: #ffffff !important;
    border-color: rgba(30, 64, 175, 0.18) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04) !important;
}

body[data-theme="dark"] #courseModal .ch-progress-title {
    color: #0f172a !important;
}

body[data-theme="dark"] #courseModal .ch-section-title {
    color: #0f172a !important;
}

body[data-theme="dark"] .section-header h2 {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body[data-theme="dark"] .section-header p {
    color: #475569;
}

body[data-theme="dark"] footer {
    background: #e2e8f0;
    border-top-color: rgba(30,64,175,0.15);
}

body[data-theme="dark"] .footer-logo {
    color: #1e40af;
}

body[data-theme="dark"] .footer-info p,
body[data-theme="dark"] .footer-credits p,
body[data-theme="dark"] .footer-links ul li a {
    color: #475569;
}

body[data-theme="dark"] .footer-course-chip {
    background: #ffffff !important;
    border: 1.5px solid rgba(30, 64, 175, 0.14) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

body[data-theme="dark"] .footer-course-chip:hover {
    background: #ffffff !important;
    border-color: rgba(30, 64, 175, 0.35) !important;
    box-shadow: 0 8px 20px rgba(30, 64, 175, 0.12) !important;
}

body[data-theme="dark"] .fc-title {
    color: #0f172a !important;
}

body[data-theme="dark"] .fc-desc {
    color: #64748b !important;
}

body[data-theme="dark"] .footer-supervisor-card {
    background: #ffffff !important;
    border: 1.5px solid rgba(30, 64, 175, 0.16) !important;
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.06) !important;
}

body[data-theme="dark"] .f-sup-name {
    color: #0f172a !important;
}

body[data-theme="dark"] .f-sup-divider {
    color: rgba(30, 64, 175, 0.25) !important;
}

body[data-theme="dark"] .f-sup-email {
    background: rgba(30, 64, 175, 0.06) !important;
    border-color: rgba(30, 64, 175, 0.2) !important;
    color: #1e40af !important;
}

body[data-theme="dark"] .f-sup-email:hover {
    background: #1e40af !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(30, 64, 175, 0.25) !important;
}

body[data-theme="dark"] .f-sup-email:hover i {
    color: #ffffff !important;
}

body[data-theme="dark"] .modal-content {
    background: linear-gradient(145deg, #f0f4f8, #e8edf5);
    border-color: rgba(30,64,175,0.15);
    box-shadow: 0 40px 100px rgba(0,0,0,0.15), 0 0 0 1px rgba(30,64,175,0.08);
}

body[data-theme="dark"] #reviewModal {
    background: rgba(15, 23, 42, 0.6) !important;
}

body[data-theme="dark"] .review-modal-content {
    background: #f8fafc !important;
    border-color: rgba(30, 64, 175, 0.25) !important;
    box-shadow: 0 30px 80px rgba(30, 64, 175, 0.2) !important;
}

body[data-theme="dark"] .review-modal-content > div:first-child {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%) !important;
    border-bottom-color: rgba(30, 64, 175, 0.2) !important;
}

body[data-theme="dark"] #reviewModalTitle {
    color: #0f172a !important;
}

body[data-theme="dark"] #reviewModalTitle + span {
    color: #475569 !important;
}

body[data-theme="dark"] #reviewExternalBtn {
    background: #ffffff !important;
    border-color: rgba(30, 64, 175, 0.3) !important;
    color: #1e40af !important;
}

body[data-theme="dark"] #reviewExternalBtn:hover {
    background: #1e40af !important;
    color: #ffffff !important;
}

body[data-theme="dark"] .modal-header-fancy {
    background: linear-gradient(135deg, #dbe4f3, #c7d4eb);
    border-bottom-color: rgba(30,64,175,0.2);
}

body[data-theme="dark"] .modal-header {
    background: rgba(30,64,175,0.04);
    border-bottom-color: rgba(30,64,175,0.12);
}

/* ── Modal body text ── */
body[data-theme="dark"] .modal-body {
    color: #1e293b;
}

body[data-theme="dark"] .modal-section-title {
    color: #1e40af;
    border-bottom-color: rgba(30,64,175,0.2);
}

body[data-theme="dark"] .modal-section-title i {
    color: #1e40af;
}

/* ── Content items inside modal ── */
body[data-theme="dark"] .content-item {
    background: rgba(255,255,255,0.65);
    border-color: rgba(30,64,175,0.12);
}

body[data-theme="dark"] .content-item:hover {
    background: rgba(255,255,255,0.95);
    border-color: rgba(30,64,175,0.35);
    box-shadow: 0 8px 24px rgba(30,64,175,0.1);
}

body[data-theme="dark"] .content-info h4 {
    color: #0f172a;
}

body[data-theme="dark"] .content-info p {
    color: #475569;
}

body[data-theme="dark"] .item-tag {
    background: rgba(30,64,175,0.08);
    color: #1e40af;
}

/* ── Evidence modal ── */
body[data-theme="dark"] .ev-section-title {
    color: #1e40af;
    border-bottom-color: rgba(30,64,175,0.15);
}

body[data-theme="dark"] .uploaded-file-item {
    background: rgba(255,255,255,0.6);
    border-color: rgba(30,64,175,0.1);
    color: #0f172a;
}

body[data-theme="dark"] .uploaded-file-item .file-name {
    color: #1e293b;
}

body[data-theme="dark"] .upload-zone {
    border-color: rgba(30,64,175,0.2);
    background: rgba(30,64,175,0.02);
}

body[data-theme="dark"] .upload-zone:hover {
    border-color: rgba(30,64,175,0.5);
    background: rgba(30,64,175,0.05);
}

body[data-theme="dark"] .upload-zone span {
    color: #475569;
}

/* ── Close button ── */
body[data-theme="dark"] .close-btn {
    background: rgba(30,64,175,0.06);
    border-color: rgba(30,64,175,0.12);
    color: #475569;
}

body[data-theme="dark"] .close-btn:hover {
    background: rgba(30,64,175,0.12);
    color: #1e40af;
    border-color: rgba(30,64,175,0.3);
}

/* ── Scrollbar in light modal ── */
body[data-theme="dark"] .modal-body::-webkit-scrollbar-thumb {
    background: rgba(30,64,175,0.25);
}


body[data-theme="dark"] .theme-btn {
    background: rgba(30, 64, 175, 0.12);
    border: 1.5px solid #1e40af;
    color: #1e40af;
    box-shadow: 0 2px 12px rgba(30, 64, 175, 0.25);
}

body[data-theme="dark"] .theme-btn:hover {
    background: #1e40af;
    color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 4px 20px rgba(30, 64, 175, 0.45);
}

body[data-theme="dark"] .gsr-box {
    background: linear-gradient(145deg, #f8fafc, #f0f4f8);
    border-color: rgba(30,64,175,0.15);
}

body[data-theme="dark"] .gsr-input {
    color: #0f172a;
}

body[data-theme="dark"] .gsr-result-card {
    background: rgba(255,255,255,0.6);
    border-color: rgba(30,64,175,0.1);
}

body[data-theme="dark"] .gsr-result-card:hover {
    background: rgba(255,255,255,0.9);
}

body[data-theme="dark"] .gsr-result-info h4 {
    color: #0f172a;
}

/* ================================================
   LIGHT MODE — UNIVERSAL TEXT FIX
   Covers all dynamically generated content in modals
   ================================================ */
body[data-theme="dark"] .modal-body *:not(.content-icon):not(.content-icon *):not(.item-tag):not(.btn):not(.btn *):not(i):not(.ev-pct-badge):not(.ev-upload-chip) {
    color: inherit;
}

body[data-theme="dark"] .modal-body h3,
body[data-theme="dark"] .modal-body h4,
body[data-theme="dark"] .modal-body h5,
body[data-theme="dark"] .modal-body p,
body[data-theme="dark"] .modal-body span:not(.item-tag):not(.ev-pct-badge) {
    color: #1e293b;
}

body[data-theme="dark"] .modal-body .content-info h4 {
    color: #0f172a !important;
    font-weight: 700;
}

body[data-theme="dark"] .modal-body .content-info p {
    color: #475569 !important;
}

body[data-theme="dark"] .modal-body .modal-section-title {
    color: #1e40af !important;
}

body[data-theme="dark"] .modal-body .modal-section-title i {
    color: #1e40af !important;
}

/* ── Course modal header text ── */
body[data-theme="dark"] .modal-header-fancy h2 {
    color: #1e40af;
}

body[data-theme="dark"] .modal-header h2 {
    color: #1e40af;
}

/* Legacy dark-mode class fallback */
body.dark-mode {
    --bg-primary: #010409;
    --bg-secondary: #06090f;
}

/* ================================================
   THEME ICON ANIMATION
   ================================================ */
.theme-btn i {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s ease;
}

.theme-btn:hover i {
    transform: rotate(20deg) scale(1.2);
}

/* ================================================
   SCROLLBAR
   ================================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: rgba(251,191,36,0.25);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(251,191,36,0.45);
}

/* ================================================
   INTERACTIVE PEN CURSOR
   ================================================ */

/* Custom cursor elements not in HTML — keep default cursor visible */
/* @media (hover: hover) and (pointer: fine) {
    * { cursor: none !important; }
} */

#cursor-dot {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--gold);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
    transition: width 0.18s ease, height 0.18s ease, opacity 0.18s ease;
    box-shadow:
        0 0 6px  rgba(251,191,36,0.9),
        0 0 16px rgba(251,191,36,0.6),
        0 0 30px rgba(251,191,36,0.25);
    mix-blend-mode: screen;
    will-change: transform;
}

#cursor-ring {
    position: fixed;
    width: 36px;
    height: 36px;
    border: 2px solid rgba(251,191,36,0.5);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99998;
    transform: translate(-50%, -50%);
    transition: width 0.22s ease, height 0.22s ease, border-color 0.22s ease;
    will-change: transform;
}

#cursor-pen {
    position: fixed;
    pointer-events: none;
    z-index: 99997;
    font-size: 17px;
    color: var(--gold);
    filter: drop-shadow(0 0 5px rgba(251,191,36,0.85));
    opacity: 0.9;
    transform-origin: bottom left;
    will-change: transform;
}

body.cursor-hover #cursor-ring {
    width: 52px;
    height: 52px;
    border-color: rgba(251,191,36,0.85);
}

body.cursor-hover #cursor-dot {
    width: 5px;
    height: 5px;
}

body.cursor-click #cursor-dot {
    width: 20px;
    height: 20px;
    opacity: 0.3;
}

.cursor-trail {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 99994;
    transform: translate(-50%, -50%);
    animation: trailFade 0.5s ease-out forwards;
}

@keyframes trailFade {
    0%   { opacity: 0.8; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0;   transform: translate(-50%, -50%) scale(0.1); }
}

.cursor-spark {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 99996;
    transform: translate(-50%, -50%);
    animation: sparkBurst 0.6s ease-out forwards;
}

@keyframes sparkBurst {
    0%   { opacity: 1;   transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0;   transform: translate(var(--sx), var(--sy)) scale(0); }
}

/* Touch / Mobile: hide pen cursor */
@media (hover: none) {
    #cursor-dot, #cursor-ring, #cursor-pen { display: none !important; }
    * { cursor: auto !important; }
}

/* ================================================
   DRAWING OVERLAY — Page Annotation Layer
   ================================================ */

/* Full-screen canvas */
#drawCanvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 88888;
    display: none;
    touch-action: none;
    /* pointer-events toggled by JS */
}

body.draw-mode-active #drawCanvas {
    display: block;
    pointer-events: all;
}

body.draw-mode-active * {
    /* prevent text selection while drawing */
    user-select: none !important;
    -webkit-user-select: none !important;
}

/* ── Floating Toggle Button ── */
.draw-mode-toggle {
    position: fixed;
    bottom: 90px;          /* above the search FAB */
    left: 28px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(15,25,50,0.92), rgba(5,10,25,0.95));
    border: 2px solid rgba(251,191,36,0.35);
    color: var(--gold);
    font-size: 1.15rem;
    cursor: pointer !important;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99990;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4), 0 0 0 0 rgba(251,191,36,0);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(12px);
}

.draw-mode-toggle:hover {
    transform: scale(1.12);
    border-color: var(--gold);
    box-shadow: 0 6px 28px rgba(0,0,0,0.5), 0 0 20px rgba(251,191,36,0.3);
}

.draw-mode-toggle.active {
    background: linear-gradient(135deg, var(--gold), var(--gold-deep));
    border-color: var(--gold-light);
    color: #0a0a0a;
    box-shadow: 0 6px 28px rgba(251,191,36,0.5), 0 0 40px rgba(251,191,36,0.25);
    animation: drawBtnPulse 2s ease-in-out infinite;
}

@keyframes drawBtnPulse {
    0%, 100% { box-shadow: 0 6px 28px rgba(251,191,36,0.5), 0 0 0 0 rgba(251,191,36,0.4); }
    50%       { box-shadow: 0 6px 28px rgba(251,191,36,0.5), 0 0 0 12px rgba(251,191,36,0); }
}

/* ── Drawing Toolbar Panel ── */
.draw-toolbar {
    position: fixed;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 99991;
    background: linear-gradient(145deg, rgba(5,10,28,0.97), rgba(3,7,18,0.99));
    border: 1px solid rgba(251,191,36,0.25);
    border-radius: 20px;
    padding: 16px 14px;
    min-width: 190px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.03);
    backdrop-filter: blur(20px);
    animation: toolbarSlideIn 0.35s cubic-bezier(0.34,1.56,0.64,1);
    direction: rtl;
}

@keyframes toolbarSlideIn {
    from { opacity: 0; transform: translateY(-50%) translateX(30px) scale(0.92); }
    to   { opacity: 1; transform: translateY(-50%) translateX(0)    scale(1); }
}

.draw-toolbar.collapsed {
    min-width: 0;
    padding: 8px 10px;
}

.draw-toolbar.collapsed .draw-tb-header span,
.draw-toolbar.collapsed .draw-tb-section {
    display: none;
}

.draw-tb-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gold);
    font-weight: 800;
    font-size: 0.9rem;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(251,191,36,0.15);
}

.draw-tb-header i { font-size: 1rem; }

.draw-tb-section {
    margin-bottom: 12px;
}

.draw-tb-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-bottom: 6px;
    font-weight: 600;
}

/* Color Swatches */
.draw-color-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.draw-color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer !important;
    transition: transform 0.18s ease, border-color 0.18s ease;
    padding: 0;
    flex-shrink: 0;
}

.draw-color-swatch:hover { transform: scale(1.2); }

.draw-color-swatch.active {
    border-color: #fff;
    transform: scale(1.18);
    box-shadow: 0 0 8px rgba(255,255,255,0.4);
}

.draw-color-custom {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.2);
    padding: 0;
    cursor: pointer !important;
    background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red);
    overflow: hidden;
}

/* Slider */
.draw-slider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 4px;
    background: rgba(251,191,36,0.2);
    outline: none;
    cursor: pointer !important;
}

.draw-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--gold);
    cursor: pointer;
    box-shadow: 0 0 6px rgba(251,191,36,0.6);
}

/* Tool buttons */
.draw-tools-row {
    display: flex;
    gap: 6px;
}

.draw-tool-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 7px 4px;
    border-radius: 10px;
    border: 1px solid rgba(251,191,36,0.15);
    background: rgba(255,255,255,0.03);
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-size: 0.65rem;
    font-weight: 700;
    cursor: pointer !important;
    transition: all 0.2s ease;
}

.draw-tool-btn i { font-size: 0.85rem; }

.draw-tool-btn:hover {
    background: rgba(251,191,36,0.08);
    color: var(--gold);
    border-color: rgba(251,191,36,0.3);
}

.draw-tool-btn.active {
    background: rgba(251,191,36,0.15);
    color: var(--gold);
    border-color: rgba(251,191,36,0.5);
    box-shadow: 0 0 10px rgba(251,191,36,0.15);
}

/* Action buttons */
.draw-action-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-family: var(--font-primary);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer !important;
    transition: all 0.2s ease;
    margin-bottom: 5px;
    justify-content: center;
}

.draw-undo-btn {
    background: rgba(96,165,250,0.1);
    color: #60a5fa;
    border-color: rgba(96,165,250,0.2);
}
.draw-undo-btn:hover { background: rgba(96,165,250,0.2); }

.draw-clear-btn {
    background: rgba(248,113,113,0.1);
    color: #f87171;
    border-color: rgba(248,113,113,0.2);
}
.draw-clear-btn:hover { background: rgba(248,113,113,0.2); }

.draw-save-btn {
    background: rgba(52,211,153,0.1);
    color: #34d399;
    border-color: rgba(52,211,153,0.2);
}
.draw-save-btn:hover { background: rgba(52,211,153,0.2); }

/* Collapse button */
.draw-tb-collapse {
    position: absolute;
    top: 50%;
    left: -14px;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(5,10,25,0.95);
    border: 1px solid rgba(251,191,36,0.3);
    color: var(--gold);
    font-size: 0.7rem;
    cursor: pointer !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.draw-tb-collapse:hover { background: rgba(251,191,36,0.15); }

/* Draw cursor crosshair when in draw mode */
body.draw-mode-active #drawCanvas { cursor: crosshair !important; }

/* ================================================
   RESPONSIVE DESIGN SYSTEM (ALL DEVICES & SCREENS)
   ================================================ */

/* ── 4K & Ultra-wide Screens (>= 1600px) ── */
@media (min-width: 1600px) {
    .container {
        max-width: 1540px;
    }
    .hero {
        padding: 130px 0 100px;
    }
    .courses-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 32px;
    }
}

/* ── 4K Smart TVs & School Classroom Smartboards (>= 2000px) ── */
@media (min-width: 2000px) {
    .container {
        max-width: 1850px;
    }
    html {
        font-size: 19px;
    }
    .hero {
        padding: 150px 0 110px;
    }
    .hero h1 {
        font-size: 3.4rem;
    }
    .hero p {
        font-size: 1.3rem;
    }
    .courses-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 36px;
    }
    .modal-content {
        max-width: 1500px;
    }
}

/* ── Standard Laptops (1025px to 1240px) ── */
@media (min-width: 1025px) and (max-width: 1240px) {
    .nav-links a {
        padding: 6px 8px;
        font-size: 0.8rem;
        gap: 4px;
    }
    .logo {
        font-size: 1.05rem;
    }
}

/* ── Tablets & Mobile Devices (<= 1024px) ── */
@media (max-width: 1024px) {
    /* Navbar: switch to clean mobile drawer & hamburger */
    .nav-links {
        display: none !important;
    }

    .hamburger {
        display: flex !important;
    }

    .mobile-nav {
        display: flex;
    }

    .nav-content {
        flex-direction: row;
        gap: 10px;
        padding: 10px 0;
        min-height: 56px;
    }

    .logo {
        font-size: 1.15rem;
    }

    .hero-search-bar {
        max-width: 90%;
    }
}

/* ── Portrait Tablets (<= 768px) ── */
@media (max-width: 768px) {
    .logo {
        font-size: 1.05rem;
    }

    .logo i {
        font-size: 1.3rem;
    }

    .hero {
        padding: 75px 0 50px;
    }

    .hero h1 {
        font-size: 1.85rem;
        line-height: 1.35;
    }

    .hero p {
        font-size: 0.95rem;
        padding: 0 10px;
    }

    .courses-grid {
        grid-template-columns: repeat(2, 1fr);  /* 2 columns on tablet */
        gap: 16px;
    }

    .evidence-grid,
    .modal-grid {
        grid-template-columns: 1fr;
    }

    .evidence-section {
        padding: 50px 0;
    }

    .modal-content {
        margin: 3% auto;
        width: 96%;
        max-height: 94vh;
        border-radius: var(--radius-lg);
    }

    .attendance-list-container,
    .grades-list-container,
    .table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .gsr-box {
        width: 96%;
        margin: 6vh auto;
        border-radius: var(--radius-lg);
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    #globalSearchFab {
        bottom: 20px;
        right: 20px;
        left: auto;
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }

    /* Classroom Mode Mobile Fullscreen Adaptations */
    .classroom-modal-content {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        max-height: 100vh !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }

    .classroom-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 8px 12px;
    }

    .classroom-header-right,
    .classroom-header-left {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        flex-wrap: wrap;
        gap: 6px;
    }

    .classroom-select {
        max-width: 100%;
        flex: 1;
        min-width: 140px;
    }

    .classroom-stage {
        flex-direction: column;
    }

    #classroomSimPane {
        border-left: none;
        border-bottom: 2px solid rgba(255, 255, 255, 0.1);
        min-height: 48%;
    }

    #classroomBoardPane {
        min-height: 48%;
    }
}

/* ── Mobile Phones (<= 600px) ── */
@media (max-width: 600px) {
    .games-grid,
    .courses-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .game-card {
        min-height: auto;
    }

    .container {
        padding: 0 12px;
    }

    .logo span {
        display: inline;
        font-size: 0.95rem;
    }

    .hero-search-bar {
        margin: 0 8px 16px;
        padding: 8px 14px;
    }

    .hero-search-placeholder {
        font-size: 0.8rem;
    }

    .hero-search-kbd {
        display: none;
    }

    /* Hero Student Toolkit on Small Phones */
    .student-toolkit {
        margin: 15px 4px 0;
        padding: 10px 8px;
    }

    .toolkit-groups {
        gap: 6px;
        display: flex;
        flex-wrap: wrap;
    }

    .toolkit-divider {
        display: none;
    }

    .toolkit-btn {
        font-size: 0.76rem;
        padding: 7px 9px;
        flex: 1 1 calc(50% - 6px);
        justify-content: center;
    }

    /* Sim Modal Controls Mobile */
    .modal-header {
        padding: 12px 14px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .modal-controls {
        gap: 6px;
        flex-wrap: wrap;
    }

    #simClassroomBtn span,
    #simReportBtn span,
    #simOpenTabBtn span {
        display: none !important;
    }

    #simClassroomBtn,
    #simReportBtn,
    #simOpenTabBtn {
        padding: 6px 10px !important;
    }

    /* Review Modal Mobile */
    .review-modal-content {
        width: 100% !important;
        height: 100% !important;
        border-radius: 0 !important;
    }
    #reviewExternalBtn span {
        display: none !important;
    }

    /* Course Modal Mobile Fullscreen Adaptation */
    #courseModal {
        padding: 0 !important;
        overflow: hidden !important;
    }
    #courseModal .modal-content {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100% !important;
        height: 100dvh !important;
        max-height: 100% !important;
        max-height: 100dvh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
        display: flex !important;
        flex-direction: column !important;
    }

    #courseModal .modal-header-fancy {
        padding: 12px 14px !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 50 !important;
        flex-shrink: 0 !important;
    }

    #courseModal .modal-body {
        padding: 14px 10px !important;
        flex: 1 1 0% !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* All Modal Grids to Single Column on Mobile */
    #stratCardsGrid,
    .strat-grid,
    #reportsListGrid,
    #constantsGrid,
    .formula-course-grid,
    .ch-cards-grid,
    .ch-lessons-grid,
    [id^="chapterLessonsGrid_"] {
        grid-template-columns: 1fr !important;
    }

    /* Lab Report Sheet */
    .lab-report-sheet {
        padding: 14px 10px;
    }

    .rep-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .rep-header-center,
    .rep-header-left {
        text-align: right;
    }

    .rep-student-card {
        grid-template-columns: 1fr;
    }

    /* Whiteboard Toolbar */
    .wb-toolbar {
        padding: 8px 10px;
        gap: 6px;
    }
}

/* ── Extra Small Phones (<= 380px) ── */
@media (max-width: 380px) {
    .logo span {
        font-size: 0.85rem;
    }
    .toolkit-btn {
        flex: 1 1 100%;
    }
    .modal-header h2 {
        font-size: 1.15rem;
    }
}

/* ================================================
   EXTRA FIX — ensure action buttons never stack
   ================================================ */
.nav-actions {
    flex-direction: row !important;
}

/* ================================================
   STRATEGIES MODAL & CARDS
   ================================================ */
.strat-tab {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 7px 16px;
    border-radius: 20px;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
}
.strat-tab:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
    color: #10b981;
}
.strat-tab.active {
    background: linear-gradient(135deg, #059669, #10b981);
    border-color: #10b981;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}
.strat-card {
    background: var(--card-bg, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.strat-card:hover {
    transform: translateY(-4px);
    border-color: #10b981;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35), 0 0 15px rgba(16, 185, 129, 0.15);
}
.strat-card-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}
.strat-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.strat-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 12px;
    margin-bottom: 5px;
}
.strat-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
    margin: 0;
    line-height: 1.35;
}
.strat-body {
    font-size: 0.88rem;
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 14px;
}
.strat-box {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
    border-right: 3px solid #10b981;
}
.strat-box strong {
    color: var(--text);
    display: block;
    margin-bottom: 3px;
    font-size: 0.82rem;
}
.strat-box span {
    font-size: 0.82rem;
    color: var(--text-dim);
}
.strat-tool {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.08);
    padding: 6px 10px;
    border-radius: 8px;
    margin-top: auto;
}

/* ================================================
   UNIVERSAL LAB REPORT & PRINT SYSTEM (PDF READY)
   ================================================ */
.lab-report-modal-content {
    background: rgba(15, 23, 42, 0.95);
    width: 95%;
    max-width: 900px;
    margin: 3vh auto;
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.6);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 94vh;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.lab-report-action-bar {
    background: #0f172a;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #334155;
    flex-wrap: wrap;
    gap: 12px;
}

.lab-report-bar-title {
    font-weight: 800;
    font-size: 1.05rem;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lab-report-bar-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-print-report {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: #ffffff;
    border: none;
    padding: 9px 22px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.92rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.4);
    transition: all 0.25s ease;
}

.btn-print-report:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.6);
}

.btn-close-report {
    background: #334155;
    color: #cbd5e1;
    border: none;
    padding: 9px 18px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}

.btn-close-report:hover {
    background: #475569;
    color: #ffffff;
}

.lab-report-sheet {
    background: #ffffff;
    color: #0f172a;
    padding: 30px 40px;
    overflow-y: auto;
    font-family: var(--font-primary);
    line-height: 1.6;
}

/* Header */
.rep-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px double #0f172a;
    padding-bottom: 14px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 14px;
}

.rep-header-right {
    text-align: right;
}

.rep-sub {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 700;
}

.rep-main {
    font-size: 1.15rem;
    font-weight: 900;
    color: #0f172a;
}

.rep-supervisor {
    font-size: 0.85rem;
    color: #0284c7;
    font-weight: 800;
}

.rep-header-center {
    text-align: center;
}

.rep-emblem {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #f0f9ff;
    border: 2px solid #0284c7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #0284c7;
    margin: 0 auto 4px;
}

.rep-badge-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: #334155;
}

.rep-header-left {
    text-align: left;
    font-size: 0.85rem;
    color: #334155;
    line-height: 1.7;
}

/* Student card */
.rep-student-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 18px;
    margin-bottom: 18px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.rep-input-group label {
    font-size: 0.8rem;
    color: #64748b;
    display: block;
    font-weight: 700;
    margin-bottom: 3px;
}

.rep-input {
    width: 100%;
    border: none;
    border-bottom: 1.5px solid #cbd5e1;
    background: transparent;
    padding: 4px 0;
    font-weight: 800;
    font-size: 0.95rem;
    color: #0f172a;
    font-family: inherit;
    outline: none;
}

.rep-input:focus {
    border-bottom-color: #0284c7;
}

/* Title banner */
.rep-title-banner {
    text-align: center;
    background: #f0f9ff;
    border: 1.5px solid #bae6fd;
    border-radius: 12px;
    padding: 10px 16px;
    margin-bottom: 18px;
}

.rep-banner-label {
    font-size: 0.82rem;
    color: #0369a1;
    font-weight: 800;
}

.rep-title-banner h2 {
    font-size: 1.25rem;
    font-weight: 900;
    color: #0c4a6e;
    margin: 2px 0 0;
}

/* Info boxes */
.rep-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}

@media (max-width: 650px) {
    .rep-info-grid {
        grid-template-columns: 1fr;
    }
}

.rep-info-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
}

.rep-box-title {
    font-size: 0.88rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rep-box-title i {
    color: #0284c7;
}

.rep-info-box p {
    font-size: 0.84rem;
    color: #475569;
    margin: 0;
    line-height: 1.5;
}

/* Formulas */
.rep-formula-section {
    margin-bottom: 16px;
}

.rep-formula-box {
    background: #f1f5f9;
    padding: 8px 14px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    font-weight: 800;
    direction: ltr;
    text-align: center;
    color: #0f172a;
    border-right: 4px solid #0284c7;
}

/* Table */
.rep-table-section {
    margin-bottom: 16px;
}

.rep-table-wrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: center;
}

.rep-table-wrap th {
    background: #f1f5f9;
    color: #1e293b;
    font-weight: 800;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
}

.rep-table-wrap td {
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    color: #334155;
    font-weight: 600;
}

/* Conclusion */
.rep-conclusion-section {
    margin-bottom: 18px;
}

.rep-textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 0.88rem;
    color: #0f172a;
    background: #fafafa;
    outline: none;
    resize: vertical;
}

.rep-textarea:focus {
    border-color: #0284c7;
    background: #fff;
}

/* Evaluation & Stamp */
.rep-evaluation-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 2px dashed #cbd5e1;
    padding-top: 14px;
    margin-top: 10px;
    flex-wrap: wrap;
    gap: 16px;
}

.rep-score-box {
    background: #fefce8;
    border: 1.5px solid #fde047;
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 0.95rem;
    font-weight: 900;
    color: #854d0e;
}

.rep-stamp-box {
    border: 2px dashed #94a3b8;
    border-radius: 12px;
    padding: 6px 18px;
    text-align: center;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rep-signature {
    text-align: left;
    font-size: 0.88rem;
    color: #1e293b;
}

.sig-line {
    margin-top: 4px;
    color: #64748b;
}

/* Report Picker Cards */
.rep-picker-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.rep-picker-card:hover {
    border-color: #0284c7;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.25);
}

.rep-picker-title {
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.rep-picker-sub {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.rep-picker-btn {
    background: rgba(2, 132, 199, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.rep-picker-card:hover .rep-picker-btn {
    background: #0284c7;
    color: #ffffff;
}

/* ── PRINT MEDIA RULES FOR A4 PDF ── */
@media print {
    body * {
        visibility: hidden !important;
    }
    #universalLabReportModal,
    #universalLabReportModal * {
        visibility: visible !important;
    }
    #universalLabReportModal {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
        display: block !important;
    }
    .lab-report-modal-content {
        max-height: none !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
    }
    .no-print {
        display: none !important;
    }
    .lab-report-sheet {
        padding: 8mm 12mm !important;
        margin: 0 !important;
        box-shadow: none !important;
        background: #ffffff !important;
        color: #000000 !important;
        overflow: visible !important;
    }
    .rep-input {
        border-bottom: 1px solid #000 !important;
        color: #000 !important;
    }
    .rep-textarea {
        border: 1px solid #ccc !important;
        background: #fff !important;
        color: #000 !important;
    }
}

/* ================================================
   HIDE NETLIFY BADGE & DRAWER
   ================================================ */
#nl-badge-frame,
iframe[id^="nl-badge"],
iframe[title*="Netlify"],
iframe[src*="netlify"],
.netlify-badge,
.nl-wrap,
#netlify-drawer,
[data-netlify-site-id] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    clip-path: path("M0 0Z") !important;
    width: 0 !important;
    height: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
}
