        :root {
            --primary: #2563eb;
            --primary-dark: #1e3a8a;
            --primary-light: #eff6ff;
            --accent: #f59e0b;
            --bg-body: #ffffff;
            --text-main: #0f172a;
            --text-sub: #64748b;
            --card-radius: 24px;
            --shadow-soft: 0 10px 30px -10px rgba(37, 99, 235, 0.1);
            --shadow-hover: 0 20px 40px -5px rgba(37, 99, 235, 0.15);
            --font-head: 'Tajawal', sans-serif;
            --font-body: 'Alexandria', sans-serif;
        }

        /* --- BASIC SETUP --- */
        html, body {
            font-family: var(--font-body);
            color: var(--text-main);
            background-color: var(--bg-body);
            overflow-x: hidden !important;
            width: 100%;
            max-width: 100%;
            scroll-behavior: smooth;
        }
        
        h1, h2, h3, h4, h5, .brand-font { font-family: var(--font-head); }
        .last-no-border:last-child { border-bottom: none !important; margin-bottom: 0 !important; }

        /* --- ANIMATIONS (LIVELINESS) --- */
        @keyframes float { 0% { transform: translateY(0px); } 50% { transform: translateY(-10px); } 100% { transform: translateY(0px); } }
        @keyframes pulse-glow { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); } 70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
        @keyframes move-bg { 0% { transform: translate(0, 0); } 100% { transform: translate(20px, 20px); } }

        .floating { animation: float 4s ease-in-out infinite; }
        .hover-scale { transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
        .hover-scale:hover { transform: scale(1.03); }
        
        /* Reveal on Scroll Class */
        .reveal { opacity: 0; transform: translateY(30px); transition: all 0.8s ease-out; }
        .reveal.active { opacity: 1; transform: translateY(0); }

        /* --- BACKGROUND ELEMENTS --- */
        .bg-blobs { position: fixed; width: 100%; height: 100%; z-index: -1; pointer-events: none; overflow: hidden; }
        .blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.5; animation: move-bg 10s infinite alternate linear; }
        .blob-1 { top: -10%; right: -15%; width: 500px; height: 500px; background: rgba(37, 99, 235, 0.08); }
        .blob-2 { bottom: -10%; left: -10%; width: 400px; height: 400px; background: rgba(245, 158, 11, 0.08); animation-duration: 15s; }

        /* --- LOADER --- */
        #loader { position: fixed; inset: 0; background: white; z-index: 9999; display: flex; justify-content: center; align-items: center; transition: opacity 0.5s; }
        .spinner { width: 45px; height: 45px; border: 4px solid var(--primary-light); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
        @keyframes spin { 100% { transform: rotate(360deg); } }

        /* --- NAVBAR --- */
        .navbar-royal { background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(0,0,0,0.05); padding: 12px 0; transition: 0.3s; }
        .navbar-brand { color: var(--primary) !important; font-weight: 800; font-size: 1.3rem; letter-spacing: -0.5px; }
        .nav-link { font-size: 0.95rem; font-weight: 600; padding: 8px 18px !important; border-radius: 50px; transition: all 0.2s; position: relative; }
        .nav-link:hover, .nav-link.active { color: var(--primary) !important; background: var(--primary-light); }

        /* --- HERO --- */
        .hero { padding: 110px 0 50px; overflow: hidden; }
        .hero-title { font-size: 2.8rem; font-weight: 900; line-height: 1.3; margin-bottom: 15px; background: linear-gradient(135deg, var(--text-main) 0%, #334155 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
        .hero-title span { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
        
        .hero-visual-card { 
            background: rgba(255,255,255,0.9); backdrop-filter: blur(10px);
            border-radius: 24px; padding: 30px; 
            border: 1px solid rgba(255,255,255,0.5); box-shadow: var(--shadow-soft); 
            margin-top: 30px; max-width: 400px; margin-left: auto; margin-right: auto;
            position: relative;
        }
        .hero-visual-card::before { content: ''; position: absolute; inset: -2px; border-radius: 26px; background: linear-gradient(45deg, var(--primary), transparent, var(--accent)); z-index: -1; opacity: 0.3; }

        /* --- STATS --- */
        .stat-box { background: white; border-radius: 18px; padding: 20px 10px; text-align: center; border: 1px solid #f1f5f9; box-shadow: var(--shadow-soft); transition: transform 0.3s; }
        .stat-box:hover { transform: translateY(-5px); border-color: var(--primary-light); }
        .stat-num { font-size: 1.8rem; font-weight: 800; color: var(--primary); font-family: var(--font-head); display: inline-block; }

        /* --- LEADERBOARD --- */
        .rank-badge { width: 35px; height: 35px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: 800; font-size: 1rem; flex-shrink: 0; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
        .rank-1 { background: linear-gradient(135deg, #fbbf24, #d97706); color: white; }
        .rank-2 { background: linear-gradient(135deg, #94a3b8, #475569); color: white; }
        .rank-3 { background: linear-gradient(135deg, #d97706, #78350f); color: white; }
        .rank-other { background: #f1f5f9; color: #64748b; }
        
        .student-row { transition: all 0.3s ease; border-radius: 16px; border: 1px solid #f1f5f9; cursor: pointer; background: white; margin-bottom: 10px; position: relative; overflow: hidden; }
        .student-row:hover { transform: translateX(-5px); box-shadow: var(--shadow-soft); border-color: var(--primary-light); }
        .student-row::after { content: ''; position: absolute; top: 0; right: 0; width: 4px; height: 100%; background: var(--primary); opacity: 0; transition: 0.3s; }
        .student-row:hover::after { opacity: 1; }
        
        .score-bar { height: 6px; border-radius: 10px; background: #e2e8f0; overflow: hidden; width: 70px; }
        .score-fill { height: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--primary), var(--primary-dark)); }

        .nav-pills-custom { background: #f8fafc; padding: 5px; border-radius: 50px; display: inline-flex; border: 1px solid #e2e8f0; }
        .nav-pills-custom .nav-link { background: transparent; border: none; color: var(--text-sub) !important; border-radius: 40px; padding: 8px 20px; font-weight: 600; }
        .nav-pills-custom .nav-link.active { background: white; color: var(--primary) !important; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }

        /* --- CARDS --- */
        .group-card { background: white; border-radius: 20px; overflow: hidden; border: 1px solid #f8fafc; height: 100%; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); box-shadow: var(--shadow-soft); position: relative; }
        .group-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-hover); border-color: rgba(37, 99, 235, 0.1); }
        
        .group-header { background: linear-gradient(to bottom, #f8fafc, #fff); padding: 25px 20px 15px; }
        
        .status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-left: 5px; }
        .status-badge { position: absolute; top: 20px; left: 20px; padding: 6px 12px; border-radius: 30px; font-size: 0.75rem; font-weight: 800; display: flex; align-items: center; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
        .status-open { background: #dcfce7; color: #15803d; }
        .status-open .status-dot { background: #22c55e; animation: pulse-glow 2s infinite; }
        .status-closed { background: #fee2e2; color: #b91c1c; }
        .status-closed .status-dot { background: #ef4444; }

        .filter-btn { background: white; border: 1px solid #e2e8f0; padding: 8px 20px; border-radius: 50px; color: var(--text-sub); font-size: 0.9rem; margin: 3px; transition: 0.3s; }
        .filter-btn:hover, .filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); transform: scale(1.05); }


        .modal-book-dialog { max-width: 460px; }
        .book-modal-icon { width: 92px; height: 92px; display: inline-flex; align-items: center; justify-content: center; }
        .book-modal-schedule {
            background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
            border: 1px solid #e2e8f0;
            border-radius: 20px;
            padding: 14px;
            margin-bottom: 18px;
        }
        .modal-schedule-list { display: flex; flex-direction: column; gap: 10px; }
        .modal-schedule-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 12px 14px;
            border-radius: 16px;
            background: #fff;
            border: 1px solid #e5e7eb;
        }
        .modal-schedule-day {
            color: var(--text-main);
            font-weight: 800;
            font-size: 0.98rem;
            white-space: nowrap;
        }
        .modal-schedule-time {
            color: var(--primary);
            font-weight: 900;
            font-size: 0.98rem;
            text-align: left;
        }
        .modal-schedule-empty {
            color: var(--text-sub);
            text-align: center;
            font-weight: 700;
            line-height: 1.8;
            padding: 10px 4px;
        }

        /* --- MOBILE ADJUSTMENTS --- */
        @media (max-width: 768px) {
            .hero { text-align: center; padding-top: 90px; }
            .hero-title { font-size: 1.9rem; }
            .hero-btns { flex-direction: column; width: 100%; }
            .stats-wrapper { margin-top: 0 !important; } 
            .nav-pills-custom { width: 100%; display: flex; flex-direction: column; border-radius: 20px; }
            .hero-visual-card { transform: none !important; margin-top: 20px; animation: float 6s ease-in-out infinite; }
            .container { padding-left: 20px; padding-right: 20px; }
            .modal-book-dialog {
                max-width: calc(100vw - 24px);
                margin: 0.75rem auto;
            }
            .book-modal-schedule { padding: 12px; border-radius: 18px; }
            .modal-schedule-item {
                flex-direction: column;
                align-items: flex-start;
                gap: 6px;
                padding: 12px;
            }
            .modal-schedule-time {
                text-align: right;
                white-space: normal;
                line-height: 1.6;
            }
            #bookModal .modal-body { padding: 1.25rem !important; }
            #bookModal .btn { min-height: 48px; }
        }
    

