@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Tajawal:wght@300;400;500;700;800&display=swap');

/* ================================================
   ROOT VARIABLES — Modern Design System
   ================================================ */
:root {
    /* Core colors */
    --bg-primary: #030712;
    --bg-secondary: #0a0f1e;
    --bg-tertiary: #0f172a;
    --bg-card: rgba(15, 23, 42, 0.8);

    /* 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 */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-dim: #64748b;
    --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 */
    --font-primary: 'Cairo', 'Tajawal', 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: 16px;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-primary);
    line-height: 1.7;
    direction: rtl;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Animated background mesh */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(59,130,246,0.06) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 80%, rgba(139,92,246,0.06) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 50% 50%, rgba(251,191,36,0.04) 0%, transparent 70%);
    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(3, 7, 18, 0.95);
    border-bottom: 1px solid rgba(251,191,36,0.1);
    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(3, 7, 18, 0.88);
    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);
}

/* 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 */
.theme-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--glass);
    color: var(--gold);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: var(--transition);
    flex-shrink: 0;
}

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

/* 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: 420px;
}

.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 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.08) 0%, transparent 60%),
        radial-gradient(ellipse 80% 60% at 20% 100%, rgba(59,130,246,0.08) 0%, transparent 60%),
        linear-gradient(180deg, #060d1f 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;
}

.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(2.2rem, 5vw, 4rem);
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 24px;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.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 20px rgba(251,191,36,0.3));
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 40px;
    line-height: 1.8;
}

.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(10, 15, 30, 0.7);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 22px;
    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: center;
}

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

/* 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.35);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), var(--shadow-gold);
    background: rgba(15, 23, 42, 0.9);
}

.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;
}

/* ================================================
   MODAL SYSTEM
   ================================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 7, 18, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 2000;
    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);
}

@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;
    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;
}

.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;
}

/* ================================================
   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: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.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);
}

.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-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;
    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:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(59,130,246,0.08) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 80%, rgba(139,92,246,0.06) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 50% 50%, rgba(251,191,36,0.05) 0%, transparent 70%);
}

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

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::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;
}

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

body[data-theme="dark"] .course-card {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(30, 64, 175, 0.12);
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

body[data-theme="dark"] .course-card:hover {
    border-color: rgba(30, 64, 175, 0.3);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 16px 40px rgba(0,0,0,0.12);
}

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

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

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"] .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"] .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.08);
    border-color: rgba(30,64,175,0.2);
    color: #1e40af;
}

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
   ================================================ */

/* Hide default cursor on desktop only */
@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;
    letter-spacing: 0.03em;
}

/* 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
   ================================================ */
@media (max-width: 768px) {
    /* Navbar: show hamburger, hide desktop links */
    .nav-links {
        display: none;
    }

    .nav-action-btn span {
        display: none; /* hide text, keep icon on tablet */
    }

    .hamburger {
        display: flex;
    }

    .mobile-nav {
        display: flex;
    }

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

    .logo {
        font-size: 1.1rem;
    }

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

    .hero {
        padding: 80px 0 60px;
    }

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

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

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

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

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

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

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

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

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

@media (max-width: 600px) {
    .games-grid,
    .courses-grid {
        grid-template-columns: 1fr;
    }

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

    .container {
        padding: 0 14px;
    }

    .logo span {
        display: none; /* show only atom icon on very small screens */
    }

    .nav-action-btn span {
        display: none;
    }

    .nav-action-btn {
        padding: 7px 9px;
    }
}

/* ================================================
   INTERMEDIATE BREAKPOINT — 900px to 1100px
   Hide action button text, keep icons
   ================================================ */
@media (max-width: 1100px) and (min-width: 769px) {
    .nav-action-btn span {
        display: none;
    }

    .nav-action-btn {
        padding: 8px 10px;
    }

    .nav-links a {
        padding: 7px 9px;
        font-size: 0.82rem;
    }

    .logo {
        font-size: 1.1rem;
    }
}

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