* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.2s ease;
    opacity: 1;
    animation: fadeInPage 0.25s ease-out;
}
@keyframes fadeInPage {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* الثيمات - كما هي */
body.theme-dark {
    --bg-body: #0B0F1C;
    --bg-nav: rgba(15, 23, 42, 0.85);
    --bg-card: rgba(15, 23, 42, 0.85);
    --bg-side: #020617;
    --text-primary: #F9FAFB;
    --text-secondary: #E5E7EB;
    --text-muted: #9CA3AF;
    --border-light: rgba(249, 250, 251, 0.12);
    --card-bg: #111827;
    --card-hover: #1F2937;
    --grad-primary: linear-gradient(135deg, #A855F7, #7C3AED, #4C1D95);
    --grad-olympiad: linear-gradient(135deg, #7C3AED, #4C1D95);
    --grad-grade9: linear-gradient(135deg, #A855F7, #EC4899);
    --grad-outstanding: linear-gradient(135deg, #7C3AED, #22D3EE);
    --btn-olympiad: linear-gradient(90deg, #7C3AED, #22D3EE);
    --btn-grade9: linear-gradient(90deg, #A855F7, #EC4899);
    --btn-outstanding: linear-gradient(90deg, #4C1D95, #A3E635);
    --btn-discover: linear-gradient(90deg, #22D3EE, #A855F7);
    --accent-pink: #EC4899;
    --accent-cyan: #22D3EE;
    --accent-lime: #A3E635;
    --shadow-glow: 0 0 16px rgba(34, 211, 238, 0.5);
}
body.theme-light {
    --bg-body: #F3F4F6;
    --bg-nav: rgba(255, 255, 255, 0.9);
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-side: #FFFFFF;
    --text-primary: #111827;
    --text-secondary: #374151;
    ---muted: #6B7280;
    --border-light: rgba(0, 0, 0, 0.1);
    --card-bg: #FFFFFF;
    --card-hover: #F9FAFB;
    --grad-primary: linear-gradient(135deg, #C084FC, #A855F7, #7C3AED);
    --grad-olympiad: linear-gradient(135deg, #8B5CF6, #6D28D9);
    --grad-grade9: linear-gradient(135deg, #F472B6, #DB2777);
    --grad-outstanding: linear-gradient(135deg, #38BDF8, #0EA5E9);
    --btn-olympiad: linear-gradient(90deg, #7C3AED, #06B6D4);
    --btn-grade9: linear-gradient(90deg, #EC4899, #BE185D);
    --btn-outstanding: linear-gradient(90deg, #6D28D9, #84CC16);
    --btn-discover: linear-gradient(90deg, #06B6D4, #C084FC);
    --accent-pink: #DB2777;
    --accent-cyan: #6D28D9;
    --accent-lime: #65A30D;
    --shadow-glow: 0 0 16px rgba(139, 92, 246, 0.4);
}
body.theme-neon {
    --bg-body: #0A0A0F;
    --bg-nav: rgba(0, 0, 0, 0.75);
    --bg-card: rgba(20, 20, 35, 0.9);
    --bg-side: #000000;
    --text-primary: #F0F0FF;
    --text-secondary: #D1D5FF;
    --text-muted: #94A3B8;
    --border-light: #22D3EE;
    --card-bg: #111122;
    --card-hover: #1E1E3A;
    --grad-primary: linear-gradient(135deg, #FF00FF, #00FFFF, #FF44AA);
    --grad-olympiad: linear-gradient(135deg, #FF00FF, #7000FF);
    --grad-grade9: linear-gradient(135deg, #FF44AA, #FF00FF);
    --grad-outstanding: linear-gradient(135deg, #00FFFF, #FF00FF);
    --btn-olympiad: linear-gradient(90deg, #FF00FF, #00FFFF);
    --btn-grade9: linear-gradient(90deg, #FF44AA, #FF00FF);
    --btn-outstanding: linear-gradient(90deg, #00FFAA, #00FFFF);
    --btn-discover: linear-gradient(90deg, #00FFFF, #FF00FF);
    --accent-pink: #FF44FF;
    --accent-cyan: #00FFFF;
    --accent-lime: #AAFF00;
    --shadow-glow: 0 0 20px #FF00FF, 0 0 10px #00FFFF;
}
body {
    background: var(--bg-body);
    color: var(--text-primary);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 72px;
    background: var(--bg-nav);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
    z-index: 1000;
}
.hamburger-btn {
    width: 44px;
    height: 40px;
    background: linear-gradient(90deg, #C084FC, #8B5CF6);
    border-radius: 9999px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.hamburger-btn span {
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    transition: 0.3s;
}
.hamburger-btn.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger-btn.active span:nth-child(2) { opacity: 0; }
.hamburger-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }
.logo-area { display: flex; align-items: center; gap: 8px; }
.logo-icon { font-size: 28px; color: var(--accent-cyan); }
.logo-text {
    font-weight: 800;
    font-size: 25px;
    background: linear-gradient(50deg, #C084FC,#8B5CF6,#3B5CF6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Side menu */
.side-menu {
    position: fixed;
    top: 72px;
    left: -320px;
    width: min(320px, 80%);
    height: calc(100% - 72px);
    background: var(--bg-side);
    border-right: 1px solid var(--border-light);
    z-index: 1100;
    transition: left 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    overflow-y: auto;
}
.side-menu.open { left: 0; }
.side-menu-inner { padding: 24px 20px; }
.menu-list { list-style: none; }
.menu-list li { padding: 14px 0; display: flex; align-items: center; gap: 14px; font-size: 16px; cursor: pointer; color: var(--text-secondary); transition: 0.2s; }
.menu-list li:hover { color: var(--accent-cyan); transform: translateX(4px); }
.divider { height: 1px; background: var(--border-light); margin: 12px 0; }
.theme-panel { margin-top: 40px; border-top: 1px solid var(--border-light); padding-top: 20px; }
.theme-option { margin: 16px 0; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.theme-option input[type="radio"] { appearance: none; width: 18px; height: 18px; border: 2px solid var(--accent-cyan); border-radius: 50%; cursor: pointer; transition: 0.1s; }
.theme-option input[type="radio"]:checked { background: var(--accent-cyan); box-shadow: 0 0 5px var(--accent-cyan); }
.overlay-bg {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(3px);
    z-index: 1050;
    display: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.overlay-bg.active {
    display: block;
    opacity: 1;
}

/* Main layout */
main { padding: 100px 5% 60px; max-width: 1400px; margin: 0 auto; width: 100%; }

/* Hero */
.hero-section {
    background: var(--grad-primary);
    border-radius: 32px;
    padding: 40px 32px;
    margin-bottom: 48px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    animation: waveShift 8s infinite alternate ease-in-out;
    background-size: 200% 200%;
}
@keyframes waveShift {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}
.hero-content h1 { font-size: clamp(28px, 5vw, 42px); max-width: 600px; line-height: 1.2; margin-bottom: 16px; }
.quick-buttons { display: flex; flex-direction: column; gap: 16px; min-width: 240px; }
.quick-btn {
    padding: 14px 20px;
    border-radius: 16px;
    font-weight: bold;
    background: var(--btn-olympiad);
    color: white;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}
.quick-btn:hover { transform: scale(1.02); box-shadow: var(--shadow-glow); }

/* Section Cards */
.section-card {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    background: var(--grad-olympiad);
    border-radius: 28px;
    padding: 28px;
    margin-bottom: 32px;
    gap: 24px;
    transition: all 0.2s ease;
}
.section-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-glow); }
.discover-btn {
    background: var(--btn-discover);
    padding: 10px 24px;
    border-radius: 40px;
    display: inline-block;
    text-decoration: none;
    color: white;
    font-weight: 600;
    transition: all 0.2s ease;
}
.discover-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-glow); }
.subject-icons-grid { display: flex; gap: 18px; font-size: 28px; flex-wrap: wrap; }

/* Suggestions */
.suggestions-strip { background: var(--bg-card); border-radius: 28px; padding: 24px; margin: 32px 0; overflow-x: auto; border: 1px solid var(--border-light); }
.strip-cards { display: flex; gap: 20px; padding: 8px 0; }
.strip-card {
    min-width: 220px;
    background: var(--card-bg);
    border-radius: 24px;
    padding: 20px;
    border-left: 4px solid var(--accent-cyan);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
}
.strip-card:hover { transform: translateY(-4px); background: var(--card-hover); box-shadow: var(--shadow-glow); }

/* Info cards */
.info-card { background: var(--bg-card); border-radius: 28px; padding: 28px; margin-bottom: 28px; border: 1px solid var(--border-light); transition: 0.2s; }
.info-card:hover { transform: translateY(-3px); }

/* Footer */
.main-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    background: var(--bg-side);
    padding: 28px 5%;
    border-top: 1px solid var(--border-light);
    margin-top: 40px;
}
.footer-links a { color: var(--text-muted); text-decoration: none; margin-left: 20px; transition: 0.2s; }
.footer-links a:hover { color: var(--accent-cyan); }
.social-links a { color: var(--text-primary); margin: 0 10px; font-size: 22px; display: inline-block; transition: 0.2s; }
.social-links a:hover { color: var(--accent-pink); transform: translateY(-2px); }

/* Preloader */
.preloader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #0B0F1C 0%, #020617 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    opacity: 1;
    visibility: visible;
}
.logo-spinner {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 30px;
}
.cube {
    position: absolute;
    background: linear-gradient(135deg, #A855F7, #22D3EE);
    border-radius: 12px;
    animation: spin 1.8s infinite ease-in-out;
}
.large-cube-1 { width: 60px; height: 60px; top: 30px; left: 30px; animation-delay: 0s; }
.large-cube-2 { width: 60px; height: 60px; top: 30px; left: 30px; animation-delay: 0.5s; opacity: 0.7; background: linear-gradient(135deg, #22D3EE, #EC4899); }
.small-cube-1 { width: 30px; height: 30px; top: 15px; left: 75px; animation-delay: 0.2s; background: linear-gradient(135deg, #EC4899, #A855F7); }
.small-cube-2 { width: 30px; height: 30px; top: 75px; left: 15px; animation-delay: 0.4s; background: linear-gradient(135deg, #A3E635, #22D3EE); }
@keyframes spin {
    0% { transform: rotate(0deg) scale(1); opacity: 1; border-radius: 12px; }
    50% { transform: rotate(180deg) scale(1.2); opacity: 0.6; border-radius: 20px; }
    100% { transform: rotate(360deg) scale(1); opacity: 1; border-radius: 12px; }
}
.preloader-text {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #F9FAFB, #A855F7, #22D3EE);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: 2px;
    animation: pulseText 1.5s infinite;
}
@keyframes pulseText {
    0% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 0.6; transform: scale(1); }
}
.suggestions-strip .strip-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.strip-card {
    width: 100%;
    text-align: center;
    padding: 12px;
    background: var(--card-bg);
    border-radius: 16px;
    transition: 0.2s;
}
.strip-card:hover {
    transform: translateX(5px);
    background: var(--card-hover);
}
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between; /* أو استخدم flex-start */
}

.nav-right-image {
    height: 45px;          /* حجم مناسب */
    width: auto;
    margin-left: auto;     /* تدفع الصورة إلى أقصى اليمين */
}
/* جعل الفوتر يستخدم Flexbox لصف واحد */
.main-footer {
    display: flex;
    align-items: center;      /* توسيط عمودي */
    justify-content: space-between; /* توزيع العناصر: الأول والثالث على الأطراف، الوسط في المنتصف */
    flex-wrap: wrap;          /* ليتناسب مع الشاشات الصغيرة */
    gap: 20px;
    text-align: center;
}

/* العنصر الأوسط (اللوجو) */
.footer-center-logo {
    flex: 0 0 auto;
}

.footer-logo-img {
    height: 40px;       /* حجم مناسب */
    width: auto;
    display: block;
}

/* تنظيم بقية العناصر */
.footer-logo, .social-links, .footer-links {
    flex: 0 0 auto;
}

/* للشاشات الصغيرة: اجعل العناصر في عمود واللوجو في المنتصف */
@media (max-width: 768px) {
    .main-footer {
        flex-direction: column;
        justify-content: center;
    }
}
/* تنسيق روابط أيقونات التواصل */
.social-links a {
    color: var(--text-secondary); /* أو أي لون تفضله */
    font-size: 1.5rem;
    transition: all 0.3s ease;
    margin: 0 8px;
    display: inline-block;
}

/* تأثير التمرير على الأيقونات */
.social-links a:hover {
    transform: translateY(-3px);
    opacity: 0.8;
}

/* ألوان خاصة لكل منصة عند التمرير (اختياري) */
.social-links a[href*="instagram"]:hover { color: #E4405F; }
.social-links a[href*="facebook"]:hover { color: #1877F2; }
.social-links a[href*="whatsapp"]:hover { color: #25D366; }

/* تنسيق أزرار الفوتر السفلية */
.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    margin: 0 12px;
    transition: 0.3s;
}

.footer-links a:hover {
    text-decoration: underline;
    opacity: 0.8;
}
.team-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}
@media (max-width: 700px) {
    .team-grid {
        grid-template-columns: 1fr;
    }
}
/* بطاقة الاختبار العشوائي المتكاملة مع الثيمات */
.random-quiz-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 28px;
    padding: 28px;
    margin: 32px 0;
    text-align: center;
    transition: 0.2s;
    cursor: pointer;
    backdrop-filter: blur(4px);
}
.random-quiz-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-cyan);
    box-shadow: var(--shadow-glow);
}
.random-quiz-card i {
    font-size: 48px;
    color: var(--accent-cyan);
    margin-bottom: 16px;
}
.random-quiz-card h3 {
    font-size: 1.6rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.random-quiz-card p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}
.random-quiz-card .discover-btn {
    background: var(--btn-discover);
    display: inline-block;
    padding: 8px 24px;
    border-radius: 40px;
    text-decoration: none;
    color: white;
    font-weight: 600;
    transition: 0.2s;
}
.random-quiz-card .discover-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}