﻿/* ===== متغيرات أساسية – ألوان نقية مع تأثيرات Vision Pro ===== */
        :root {
            --bg-primary: #ffffff;
            --bg-secondary: #f2f2f5;
            --text-primary: #1d1d1f;
            --text-secondary: #4a4a4e;
            --text-muted: #86868b;
            --accent: #9a836a;        /* لون ترابي هادئ */
            --accent-light: #d6c6b6;
            --accent-glow: rgba(154, 131, 106, 0.3);
            --border-light: rgba(0, 0, 0, 0.05);
            --card-bg: rgba(255, 255, 255, 0.6);
            --glass-bg: rgba(255, 255, 255, 0.3);
            --glass-border: rgba(255, 255, 255, 0.4);
            --shadow-sm: 0 20px 40px -20px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
            --shadow-hover: 0 40px 60px -20px rgba(0, 0, 0, 0.25), 0 0 0 2px var(--accent-light) inset, 0 0 30px var(--accent-glow);
            --transition-liquid: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
            --content-width: min(1400px, 90vw);
            --header-height: 85px;
            --radius-sm: 30px;
            --radius-md: 45px;
            --radius-lg: 60px;
            --radius-xl: 80px;
            --radius-full: 1000px;
        }

        [data-theme="dark"] {
            --bg-primary: #0c0c0e;
            --bg-secondary: #1a1a1e;
            --text-primary: #f5f5f7;
            --text-secondary: #d1d1d6;
            --text-muted: #8e8e93;
            --accent: #cbb8a4;
            --accent-light: #9a836a;
            --accent-glow: rgba(203, 184, 164, 0.3);
            --border-light: rgba(255, 255, 255, 0.1);
            --card-bg: rgba(30, 30, 35, 0.6);
            --glass-bg: rgba(20, 20, 25, 0.3);
            --glass-border: rgba(255, 255, 255, 0.1);
            --shadow-sm: 0 20px 40px -20px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
            --shadow-hover: 0 40px 60px -20px rgba(0, 0, 0, 0.8), 0 0 0 2px var(--accent-light) inset, 0 0 40px var(--accent-glow);
        }

        /* ===== تحسين الأداء وإعادة الضبط ===== */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        html {
            scroll-behavior: smooth;
        }

        body {
            background-color: var(--bg-primary);
            color: var(--text-primary);
            font-family: 'Inter', 'Tajawal', sans-serif;
            font-weight: 300;
            line-height: 1.6;
            direction: rtl;
            -webkit-font-smoothing: antialiased;
            transition: background-color 0.4s, color 0.4s;
            position: relative;
            overflow-x: hidden;
        }

        /* خلفية متحركة سائلة (فقاعات خفيفة) */
        body::before {
            content: '';
            position: fixed;
            inset: 0;
            background: radial-gradient(circle at 30% 30%, var(--accent-glow) 0%, transparent 30%),
                        radial-gradient(circle at 80% 70%, rgba(154, 131, 106, 0.1) 0%, transparent 35%),
                        repeating-linear-gradient(45deg, rgba(255,255,255,0.02) 0px, rgba(255,255,255,0.02) 2px, transparent 2px, transparent 6px);
            pointer-events: none;
            z-index: -1;
            opacity: 0.8;
            animation: none;
            will-change: transform, filter;
        }

        @keyframes liquidMove {
            0% { transform: scale(1) translate(0, 0); filter: blur(0px); }
            100% { transform: scale(1.05) translate(-2%, -1%); filter: blur(2px); }
        }

        .container {
            max-width: var(--content-width);
            margin: 0 auto;
            padding: 0 2rem;
            position: relative;
            z-index: 2;
        }

        /* ===== الخطوط ===== */
        h1, h2, h3, h4, h5, h6 {
            font-family: 'Amiri', serif;
            font-weight: 500;
            line-height: 1.2;
            color: var(--text-primary);
        }

        p, .article-summary, .text-secondary {
            font-family: 'Inter', 'Tajawal', sans-serif;
            color: var(--text-secondary);
        }

        /* ===== روابط وأزرار سائلة ===== */
        a {
            text-decoration: none;
            color: inherit;
        }

        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.7rem;
            padding: 1rem 2.5rem;
            background: var(--accent);
            color: white;
            border-radius: var(--radius-full);
            font-weight: 500;
            font-size: 1rem;
            border: none;
            cursor: pointer;
            transition: all var(--transition-liquid);
            box-shadow: 0 4px 20px var(--accent-glow);
            backdrop-filter: blur(15px);
            position: relative;
            overflow: hidden;
            will-change: transform, box-shadow;
        }

        .btn::before {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(120deg, transparent, rgba(255,255,255,0.4), transparent);
            transform: translateX(-100%);
            transition: transform 0.6s;
        }

        .btn:hover::before {
            transform: translateX(100%);
        }

        .btn:hover {
            background: var(--accent-light);
            transform: scale(1.02) translateY(-2px);
            box-shadow: 0 15px 40px var(--accent-glow);
        }

        .btn-outline {
            background: transparent;
            border: 1px solid rgba(255,255,255,0.4);
            color: white;
            backdrop-filter: blur(20px);
        }

        .btn-outline:hover {
            background: rgba(255,255,255,0.2);
            border-color: white;
            color: white;
        }

        .btn-sm {
            padding: 0.5rem 1.5rem;
            font-size: 0.95rem;
            background: var(--accent);
            color: white;
            border-radius: var(--radius-full);
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            transition: all 0.3s;
        }

        .btn-sm:hover {
            background: var(--accent-light);
            gap: 0.8rem;
        }

        /* ===== هيدر زجاجي فائق مع تأثير سائل ===== */
        .header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.8rem 2rem;
            background: var(--glass-bg);
            backdrop-filter: blur(30px);
            -webkit-backdrop-filter: blur(30px);
            border: 1px solid var(--glass-border);
            border-radius: var(--radius-full);
            margin: 1.5rem 0 2rem;
            box-shadow: var(--shadow-sm);
            position: sticky;
            top: 1.5rem;
            z-index: 100;
            height: var(--header-height);
            transition: all 0.4s;
            will-change: backdrop-filter, box-shadow;
        }

        .header.scrolled {
            background: var(--card-bg);
            backdrop-filter: blur(40px);
            box-shadow: 0 15px 40px -15px rgba(0,0,0,0.2);
        }

        .logo {
            font-family: 'Amiri', serif;
            font-size: 2.2rem;
            font-weight: 600;
            background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            transition: all 0.3s;
        }

        .nav-links {
            display: flex;
            gap: 3rem;
        }

        .nav-links a {
            font-size: 1rem;
            color: var(--text-secondary);
            position: relative;
            padding-bottom: 0.25rem;
            transition: color 0.3s;
        }

        .nav-links a::after {
            content: '';
            position: absolute;
            bottom: 0;
            right: 0;
            width: 0;
            height: 2px;
            background: var(--accent);
            transition: width 0.4s cubic-bezier(0.65, 0, 0.35, 1);
        }

        .nav-links a:hover {
            color: var(--text-primary);
        }

        .nav-links a:hover::after {
            width: 100%;
        }

        .nav-links a.active {
            color: var(--accent);
        }

        .nav-links a.active::after {
            width: 100%;
        }

        .header-actions {
            display: flex;
            gap: 0.8rem;
        }

        .header-actions button,
        .header-actions a {
            background: var(--card-bg);
            border: 1px solid var(--glass-border);
            color: var(--text-secondary);
            width: 45px;
            height: 45px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.4s;
            backdrop-filter: blur(10px);
            cursor: pointer;
            font-size: 1.2rem;
            will-change: transform, background;
        }

        .header-actions button:hover,
        .header-actions a:hover {
            background: var(--accent);
            color: white;
            border-color: var(--accent);
            transform: scale(1.1) rotate(5deg);
        }

        /* ===== هيرو مع صورة خلفية ===== */
        .quizzes-hero {
            margin: 2rem 0 4rem;
            border-radius: var(--radius-xl);
            overflow: hidden;
            position: relative;
            min-height: 500px;
            display: flex;
            align-items: center;
            background-image: url('https://images.unsplash.com/photo-1490126125528-a0ccaee06c04?q=80&w=2070&auto=format&fit=crop'); /* صورة خلفية افتراضية */
            background-size: cover;
            background-position: center;
            box-shadow: var(--shadow-sm);
            transition: box-shadow var(--transition-liquid);
            will-change: box-shadow;
        }

        .quizzes-hero:hover {
            box-shadow: var(--shadow-hover);
        }

        .quizzes-hero::before {
            content: '';
            position: absolute;
            inset: 0;
            background: radial-gradient(circle at 20% 30%, rgba(255,255,255,0.3) 0%, rgba(0,0,0,0.4) 100%);
            z-index: 1;
            mix-blend-mode: overlay;
        }

        .hero-content {
            padding: 4rem;
            color: white;
            max-width: 700px;
            position: relative;
            z-index: 2;
            text-shadow: 0 4px 30px rgba(0,0,0,0.5);
            backdrop-filter: blur(10px);
            background: rgba(0,0,0,0.1);
            border-radius: var(--radius-lg);
            margin: 3rem;
            border: 1px solid rgba(255,255,255,0.2);
        }

        .hero-title {
            font-size: clamp(2.5rem, 6vw, 3.5rem);
            font-weight: 600;
            line-height: 1;
            margin-bottom: 0.5em;
            color: white;
        }

        .hero-description {
            font-size: 1.4rem;
            margin-bottom: 1.5em;
            color: rgba(255,255,255,0.95);
        }

        .hero-stats {
            display: flex;
            justify-content: center;
            gap: 2rem;
            margin-top: 2rem;
        }

        .hero-stat {
            text-align: center;
            background: rgba(255,255,255,0.1);
            backdrop-filter: blur(10px);
            padding: 1rem 2rem;
            border-radius: var(--radius-full);
            border: 1px solid rgba(255,255,255,0.2);
        }

        .hero-stat .number {
            font-size: 2rem;
            font-weight: 700;
            color: white;
            display: block;
        }

        .hero-stat .label {
            font-size: 0.9rem;
            color: rgba(255,255,255,0.8);
        }

        /* ===== Breadcrumbs ===== */
        .breadcrumbs {
            padding: 1.5rem 0;
            margin: 1rem 0;
            border-bottom: 1px solid var(--border-light);
        }

        .breadcrumbs ol {
            display: flex;
            align-items: center;
            list-style: none;
            flex-wrap: wrap;
            gap: 0.8rem;
        }

        .breadcrumbs li {
            display: flex;
            align-items: center;
            gap: 0.8rem;
            color: var(--text-secondary);
        }

        .breadcrumbs a {
            color: var(--text-secondary);
            transition: color 0.3s;
        }

        .breadcrumbs a:hover {
            color: var(--accent);
        }

        .breadcrumbs .separator {
            color: var(--border-light);
            font-size: 0.8rem;
        }

        .breadcrumbs .current {
            color: var(--accent);
            font-weight: 600;
            background: rgba(193, 154, 107, 0.1);
            padding: 0.4rem 1rem;
            border-radius: var(--radius-full);
        }

        /* ===== قسم التصنيفات ===== */
        .quiz-categories {
            padding: 4rem 0;
        }

        .section-header {
            text-align: center;
            margin-bottom: 3rem;
        }

        .section-header h2 {
            font-size: 2.5rem;
            color: var(--accent);
            margin-bottom: 1rem;
        }

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

        .quiz-toolbar {
            display: grid;
            grid-template-columns: 1.5fr 1fr 1fr 1fr auto;
            gap: 0.8rem;
            margin-bottom: 1.2rem;
        }

        .quiz-toolbar input,
        .quiz-toolbar select {
            width: 100%;
            padding: 0.85rem 1rem;
            border-radius: var(--radius-full);
            border: 1px solid var(--border-light);
            background: var(--card-bg);
            color: var(--text-primary);
            font-family: inherit;
        }

        .quiz-toolbar .btn-sm {
            justify-content: center;
            white-space: nowrap;
        }

        .ad-slot {
            border: 1px dashed var(--accent-light);
            border-radius: var(--radius-md);
            background: linear-gradient(135deg, rgba(154, 131, 106, 0.08), rgba(154, 131, 106, 0.02));
            padding: 1rem;
            text-align: center;
            color: var(--text-secondary);
            font-size: 0.9rem;
        }

        .ad-slot-label {
            display: inline-block;
            margin-bottom: 0.4rem;
            padding: 0.2rem 0.6rem;
            border-radius: 999px;
            background: rgba(154, 131, 106, 0.15);
            color: var(--accent);
            font-size: 0.72rem;
            letter-spacing: 0.06em;
            font-weight: 600;
        }

        .ad-slot-wide {
            margin: 1.4rem 0;
        }

        .categories-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 2rem;
        }

        .category-card {
            background: var(--card-bg);
            backdrop-filter: blur(15px);
            border: 1px solid var(--glass-border);
            border-radius: var(--radius-lg);
            padding: 2rem;
            text-align: center;
            transition: all 0.5s;
            box-shadow: var(--shadow-sm);
            will-change: transform, box-shadow;
        }

        .category-card:hover {
            transform: translateY(-8px);
            box-shadow: var(--shadow-hover);
        }

        .category-icon {
            width: 70px;
            height: 70px;
            background: rgba(154, 131, 106, 0.1);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 1.5rem;
            transition: all 0.3s;
        }

        .category-card:hover .category-icon {
            background: var(--accent);
            transform: scale(1.1);
        }

        .category-icon i {
            font-size: 2rem;
            color: var(--accent);
            transition: all 0.3s;
        }

        .category-card:hover .category-icon i {
            color: white;
        }

        .category-card h4 {
            font-size: 1.3rem;
            margin-bottom: 0.5rem;
            color: var(--text-primary);
        }

        .category-card p {
            color: var(--text-secondary);
            font-size: 0.95rem;
        }

        /* ===== شريط الإحصائيات ===== */
        .quiz-stats-bar {
            background: var(--card-bg);
            backdrop-filter: blur(15px);
            border: 1px solid var(--glass-border);
            border-radius: var(--radius-lg);
            padding: 3rem;
            margin: 3rem 0;
        }

        /* ===== قسم المتصدرين في الكويزات ===== */
        .quiz-leaderboard {
            margin: 3rem 0;
            background: var(--card-bg);
            backdrop-filter: blur(15px);
            border: 1px solid var(--glass-border);
            border-radius: var(--radius-lg);
            padding: 2.5rem;
            box-shadow: var(--shadow-sm);
        }

        .leaderboard-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
            gap: 1.2rem;
        }

        .leaderboard-card {
            background: rgba(154, 131, 106, 0.08);
            border: 1px solid var(--border-light);
            border-radius: var(--radius-md);
            padding: 1.25rem;
            transition: all 0.3s ease;
        }

        .leaderboard-card:hover {
            transform: translateY(-4px);
            border-color: var(--accent-light);
        }

        .leaderboard-rank {
            width: 42px;
            height: 42px;
            border-radius: 50%;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            color: #fff;
            margin-bottom: 0.8rem;
            background: var(--accent);
        }

        .leaderboard-rank.rank-1 { background: linear-gradient(135deg, #f5b400, #f08a00); }
        .leaderboard-rank.rank-2 { background: linear-gradient(135deg, #b8c2cc, #8a94a0); }
        .leaderboard-rank.rank-3 { background: linear-gradient(135deg, #c68642, #9b5d2a); }

        .leaderboard-name {
            font-size: 1.1rem;
            color: var(--text-primary);
            margin-bottom: 0.4rem;
            font-weight: 600;
        }

        .leaderboard-meta {
            color: var(--text-secondary);
            font-size: 0.9rem;
            display: grid;
            gap: 0.25rem;
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 2rem;
            text-align: center;
        }

        .stat-item .number {
            font-size: 2.5rem;
            font-weight: 700;
            color: var(--accent);
            display: block;
        }

        .stat-item .label {
            color: var(--text-secondary);
            font-size: 1rem;
        }

        /* ===== شبكة الكويزات ===== */
        .quiz-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
            gap: 2.5rem;
            margin: 2rem 0 4rem;
        }

        .quiz-card-apple {
            background: var(--card-bg);
            backdrop-filter: blur(15px);
            border: 1px solid var(--glass-border);
            border-radius: var(--radius-lg);
            overflow: hidden;
            transition: all 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2);
            box-shadow: var(--shadow-sm);
            will-change: transform, box-shadow;
            opacity: 1;
            transform: none;
        }

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

        .quiz-card-apple:hover {
            transform: translateY(-12px) scale(1.01);
            box-shadow: var(--shadow-hover);
        }

        .quiz-badge {
            position: absolute;
            top: 1rem;
            left: 1rem;
            background: var(--accent);
            color: white;
            padding: 0.4rem 1rem;
            border-radius: var(--radius-full);
            font-size: 0.85rem;
            font-weight: 500;
            z-index: 2;
            backdrop-filter: blur(5px);
        }

        .quiz-image {
            position: relative;
            width: 100%;
            height: 200px;
            overflow: hidden;
        }

        .quiz-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.7s;
            will-change: transform;
        }

        .quiz-card-apple:hover .quiz-image img {
            transform: scale(1.08);
        }

        .image-overlay {
            position: absolute;
            inset: 0;
            background: linear-gradient(to top, rgba(0,0,0,0.3), transparent);
            z-index: 1;
        }

        .quiz-content {
            padding: 2rem;
        }

        .quiz-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 0.85rem;
            color: var(--text-muted);
            margin-bottom: 0.8rem;
        }

        .quiz-difficulty {
            display: flex;
            align-items: center;
            gap: 0.3rem;
            background: rgba(154, 131, 106, 0.1);
            padding: 0.2rem 0.8rem;
            border-radius: var(--radius-full);
            color: var(--accent);
        }

        .quiz-content h3 {
            font-size: 1.4rem;
            margin-bottom: 0.5rem;
            color: var(--text-primary);
        }

        .quiz-description {
            font-size: 0.95rem;
            color: var(--text-secondary);
            margin-bottom: 1.5rem;
            line-height: 1.6;
            display: -webkit-box;
            line-clamp: 2;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .quiz-stats {
            display: flex;
            gap: 1rem;
            margin-bottom: 1.5rem;
            padding: 1rem;
            background: rgba(154, 131, 106, 0.05);
            border-radius: var(--radius-md);
            transition: transform 0.3s;
        }

        .quiz-card-apple:hover .quiz-stats {
            transform: translateY(-5px);
        }

        .stat {
            text-align: center;
            flex: 1;
        }

        .stat-number {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--accent);
        }

        .stat-label {
            font-size: 0.8rem;
            color: var(--text-muted);
        }

        .quiz-actions {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .quiz-category {
            background: rgba(154, 131, 106, 0.1);
            color: var(--accent);
            padding: 0.3rem 1rem;
            border-radius: var(--radius-full);
            font-size: 0.85rem;
        }

        .quiz-start-btn {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem 1.5rem;
            background: var(--accent);
            color: white;
            border-radius: var(--radius-full);
            font-weight: 500;
            font-size: 0.9rem;
            border: none;
            cursor: pointer;
            transition: all 0.3s;
        }

        .quiz-start-btn:hover {
            background: var(--accent-light);
            transform: translateY(-2px);
        }

        /* ===== حالة عدم وجود كويزات ===== */
        .no-quizzes {
            grid-column: 1 / -1;
            text-align: center;
            padding: 4rem 2rem;
            background: var(--card-bg);
            backdrop-filter: blur(15px);
            border-radius: var(--radius-lg);
            border: 1px solid var(--border-light);
        }

        .no-quizzes i {
            font-size: 4rem;
            color: var(--accent);
            margin-bottom: 1rem;
        }

        .no-quizzes h4 {
            font-size: 1.8rem;
            margin-bottom: 0.5rem;
            color: var(--text-primary);
        }

        .no-quizzes p {
            color: var(--text-secondary);
        }

        /* ===== Footer متطور ===== */
        .footer {
            margin-top: 5rem;
            padding: 4rem 0 2rem;
            border-top: 1px solid var(--border-light);
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 2.5rem;
        }

        .footer-col h4 {
            font-size: 1.5rem;
            margin-bottom: 1.2rem;
            font-weight: 600;
            color: var(--text-primary);
        }

        .footer-col p, .footer-col a {
            color: var(--text-muted);
            line-height: 2;
            display: block;
            transition: all 0.3s;
        }

        .footer-col a:hover {
            color: var(--accent);
            transform: translateX(-5px);
        }

        .social-links {
            display: flex;
            gap: 1.2rem;
            margin-top: 1.5rem;
        }

        .social-links a {
            background: var(--card-bg);
            border: 1px solid var(--glass-border);
            width: 50px;
            height: 50px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.3rem;
            color: var(--text-muted);
            transition: all 0.4s;
            will-change: transform, background;
        }

        .social-links a:hover {
            background: var(--accent);
            color: white;
            transform: translateY(-5px) scale(1.1);
            border-color: var(--accent);
        }

        .copyright {
            grid-column: 1 / -1;
            text-align: center;
            padding-top: 2rem;
            margin-top: 2rem;
            border-top: 1px solid var(--border-light);
            color: var(--text-muted);
            font-size: 0.95rem;
        }

        /* ===== Scroll Progress ===== */
        .scroll-progress {
            position: fixed;
            top: 0;
            right: 0;
            width: 0%;
            height: 3px;
            background: linear-gradient(to left, var(--accent), var(--accent-light));
            z-index: 1001;
            transition: width 0.1s ease;
        }

        /* ===== Loading Screen ===== */
        .loading-screen {
            position: fixed;
            inset: 0;
            background: var(--bg-primary);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            z-index: 9999;
            transition: opacity 0.5s ease, visibility 0.5s ease;
        }

        .loading-screen.hidden {
            opacity: 0;
            visibility: hidden;
        }

        .loader {
            width: 50px;
            height: 50px;
            border: 3px solid var(--border-light);
            border-top-color: var(--accent);
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-bottom: 1rem;
        }

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

        /* ===== Back to Top ===== */
        .back-to-top {
            position: fixed;
            bottom: 30px;
            left: 30px;
            width: 50px;
            height: 50px;
            background: var(--accent);
            color: white;
            border: none;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            opacity: 0;
            visibility: hidden;
            transform: translateY(20px);
            transition: all var(--transition-liquid);
            z-index: 999;
            box-shadow: 0 5px 20px var(--accent-glow);
        }

        .back-to-top.visible {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        .back-to-top:hover {
            background: var(--accent-light);
            transform: translateY(-5px);
            box-shadow: 0 8px 30px var(--accent-glow);
        }

        /* ===== تحسينات للشاشات الصغيرة ===== */
        @media (max-width: 992px) {
            .header {
                flex-wrap: wrap;
                height: auto;
                padding: 0.8rem 1rem;
                border-radius: 50px;
            }
            .nav-links {
                order: 3;
                width: 100%;
                justify-content: center;
                margin-top: 1rem;
                gap: 1.2rem;
            }
            .hero-stats {
                flex-direction: column;
                gap: 1rem;
            }
            .quiz-grid {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 768px) {
            .container { padding: 0 1rem; }
            .hero-content {
                padding: 2rem;
                margin: 1.5rem;
            }
            .quiz-toolbar {
                grid-template-columns: 1fr;
            }
            .hero-title {
                font-size: 2rem;
            }
            .hero-description {
                font-size: 1.2rem;
            }
            .footer {
                grid-template-columns: 1fr;
                text-align: center;
            }
            .social-links {
                justify-content: center;
            }
        }

        @media (prefers-reduced-motion: reduce) {
            * {
                animation-duration: 0.01ms !important;
                transition-duration: 0.01ms !important;
            }
        }

