/* ============================================================ */
/* 1. VARIABLES & RESET                                         */
/* ============================================================ */
:root {
    --ink: #111827;
    --ink-light: #374151;
    --gold: #C5A059;
    --gold-hover: #B08D4A;
    --bg: #F9F8F6;
    --surface: #FFFFFF;
    --border: #E5E7EB;
    
    --font-display: 'Montserrat', sans-serif;
    --font-sans: 'Inter', system-ui, sans-serif;
    --font-arabic: 'IBM Plex Sans Arabic', sans-serif;
    
    --container: 1320px;
    --padding: 24px;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { max-width: 100vw; overflow-x: hidden; width: 100%; }

body {
    font-family: var(--font-sans);
    background-color: var(--bg);
    color: var(--ink-light);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
[dir="rtl"] body { font-family: var(--font-arabic); }

/* ============================================================ */
/* 2. TYPOGRAPHY & UTILITIES                                    */
/* ============================================================ */
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); font-weight: 700; line-height: 1.1; letter-spacing: -0.03em; }
h1 { font-size: clamp(5rem, 5vw, 4.5rem); }
h2 { font-size: clamp(2rem, 3vw, 3rem); }
h3 { font-size: 1.5rem; }
p { font-size: 1.05rem; color: var(--ink-light); }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { font-family: var(--font-arabic); line-height: 1.3; }

.eyebrow {
    display: block; font-family: var(--font-sans); font-size: 0.8rem;
    font-weight: 600; text-transform: uppercase; letter-spacing: 0.15em;
    color: var(--gold); margin-bottom: 1rem;
}

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--padding); }
.section-padding { padding: 6rem 0; }

/* ============================================================ */
/* 3. BUTTONS                                                   */
/* ============================================================ */
.btn-primary, .btn-outline {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 50px; padding: 0 28px;
    font-family: var(--font-sans); font-weight: 500; font-size: 0.95rem;
    text-decoration: none; cursor: pointer; border-radius: 0;
    transition: all 0.4s var(--ease-out);
}
.btn-primary { background: var(--ink); color: var(--surface); border: 1px solid var(--ink); }
.btn-primary:hover { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.btn-outline { background: transparent; color: var(--ink); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--ink); }

/* ============================================================ */
/* 4. HEADER & NAVIGATION                                       */
/* ============================================================ */
.site-header {
    position: fixed; top: 0; width: 100%; z-index: 1000;
    background: transparent; transition: background 0.4s ease, padding 0.4s ease;
    padding: 1.5rem 0;
}
.site-header.scrolled { background: var(--ink); padding: 1rem 0; box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.nav-container { max-width: var(--container); margin: 0 auto; padding: 0 var(--padding); display: flex; justify-content: space-between; align-items: center; }
.logo-img { height: 50px; width: auto; }

.main-nav { display: flex; align-items: center; }
.mobile-nav-links { display: flex; gap: 2.5rem; align-items: center; }
.mobile-nav-links a, .dropdown-toggle { 
    color: var(--surface); text-decoration: none; font-size: 0.85rem; 
    font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; 
    transition: color 0.3s; background: none; border: none; cursor: pointer;
    font-family: var(--font-sans); display: flex; align-items: center; gap: 6px;
}
.mobile-nav-links a:hover, .mobile-nav-links a.active, .dropdown-toggle:hover { color: var(--gold); }

/* Desktop Dropdown */
.nav-dropdown { position: relative; }
.dropdown-menu {
    display: none; position: absolute; top: 100%; left: 0;
    background: var(--surface); min-width: 200px; box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 1rem 0; border-radius: 4px; z-index: 100; border-top: 2px solid var(--gold);
}
.nav-dropdown:hover .dropdown-menu { display: block; animation: fadeIn 0.3s ease; }
.dropdown-menu a {
    display: block; padding: 0.75rem 1.5rem; color: var(--ink) !important;
    text-transform: none !important; font-size: 0.95rem !important; letter-spacing: normal !important;
}
.dropdown-menu a:hover { background: var(--bg); color: var(--gold) !important; }

.nav-actions { display: flex; align-items: center; gap: 1.5rem; }
#lang-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.1); color: var(--surface); border: none; cursor: pointer;
    transition: all 0.3s ease;
}
#lang-toggle:hover { background: var(--gold); color: var(--ink); }
#lang-toggle svg { width: 22px; height: 22px; fill: currentColor; }
.menu-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--surface); z-index: 1001; position: relative;}

/* Hide mobile footer on desktop */
.mobile-sidebar-footer { display: none; }

/* ============================================================ */
/* 5. FOOTER & MODALS                                           */
/* ============================================================ */
.site-footer { background: #090E17; color: #D1D5DB; padding: 5rem 0 2rem; font-size: 0.95rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1.5fr 1fr; gap: 4rem; margin-bottom: 4rem; }
.footer-col h4 { color: #FFFFFF; font-family: var(--font-sans); font-size: 1rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 1.5rem; font-weight: 600; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 1rem; }
.footer-col a { color: #9CA3AF; text-decoration: none; transition: color 0.3s; }
.footer-col a:hover { color: var(--gold); }
.footer-col p { color: #9CA3AF; margin-bottom: 0.75rem; line-height: 1.7; }
.footer-logo { height: 60px; width: auto; margin-bottom: 1.5rem; }
.social-icons { display: flex; gap: 1rem; }
.social-icons a { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; color: #FFFFFF; transition: all 0.3s; }
.social-icons a:hover { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 2rem; text-align: center; color: #6B7280; font-size: 0.875rem; }

.modal-overlay { position: fixed; inset: 0; background: rgba(17, 24, 39, 0.8); backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center; z-index: 2000; opacity: 0; pointer-events: none; transition: opacity 0.4s ease; }
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-content { background: var(--surface); padding: 3rem; max-width: 500px; text-align: center; transform: translateY(20px); transition: transform 0.4s var(--ease-out); position: relative; }
.modal-overlay.active .modal-content { transform: translateY(0); }
.modal-close { position: absolute; top: 20px; right: 20px; cursor: pointer; font-size: 1.5rem; color: var(--ink-light); }

#back-to-top { position: fixed; bottom: 40px; right: 40px; width: 50px; height: 50px; background: var(--ink); color: var(--surface); border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; pointer-events: none; transition: all 0.3s ease; z-index: 999; font-size: 1.2rem; }
#back-to-top.visible { opacity: 1; pointer-events: auto; }
#back-to-top:hover { background: var(--gold); color: var(--ink); }

/* ============================================================ */
/* 6. ANIMATIONS & RESPONSIVE                                   */
/* ============================================================ */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 1s var(--ease-out), transform 1s var(--ease-out); }
.reveal.visible { opacity: 1; transform: translateY(0); }
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 1100px) {
    .footer-grid { grid-template-columns: 1fr !important; gap: 3rem; }
    .site-header .nav-actions .btn-primary { display: none; }
    .menu-toggle { display: block; }
    body.no-scroll { overflow: hidden; }

    /* Mobile Drawer */
    .main-nav { 
        position: fixed; top: 0; right: -100%;
        width: 100%; max-width: 360px; height: 100vh; 
        background: var(--ink); display: flex; flex-direction: column; 
        padding: 100px 0 0 0; transition: right 0.4s var(--ease-out);
        box-shadow: -10px 0 30px rgba(0,0,0,0.3); z-index: 999; overflow-y: auto; 
    }
    .main-nav.active { right: 0; }
    [dir="rtl"] .main-nav { right: auto; left: -100%; box-shadow: 10px 0 30px rgba(0,0,0,0.3); }
    [dir="rtl"] .main-nav.active { left: 0; }

    .mobile-nav-links { display: flex; flex-direction: column; padding: 0 32px; gap: 1.5rem; align-items: flex-start; width: 100%; }
    .mobile-nav-links a, .dropdown-toggle { color: var(--surface); font-size: 1.4rem; font-family: var(--font-sans); font-weight: 500; text-decoration: none; transition: color 0.3s; display: flex; justify-content: space-between; width: 100%; text-transform: none; letter-spacing: normal; }
    
    /* Mobile Dropdown Accordion */
    .nav-dropdown { width: 100%; }
    .dropdown-menu { position: static; display: none; box-shadow: none; background: transparent; border: none; padding-left: 1rem; width: 100%; margin-top: 1rem; }
    .dropdown-menu a { color: rgba(255,255,255,0.7) !important; padding: 0.5rem 1rem; font-size: 1.1rem !important; }
    .nav-dropdown.active .dropdown-menu { display: flex; flex-direction: column; gap: 0.5rem; }
    .nav-dropdown.active .dropdown-toggle svg { transform: rotate(180deg); }

    /* Mobile Footer */
    .mobile-sidebar-footer { display: flex; flex-direction: column; margin-top: auto; padding: 32px; border-top: 1px solid rgba(255,255,255,0.05); width: 100%; }
    .mobile-enroll-btn { display: flex; align-items: center; justify-content: center; width: 100%; height: 56px; background: var(--gold); color: var(--ink); font-weight: 600; font-size: 1rem; text-decoration: none; border-radius: 0; margin-bottom: 24px; transition: background 0.3s; }
    .mobile-social-links { display: flex; gap: 1rem; justify-content: center; }
    .mobile-social-links a { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,0.08); color: var(--surface); transition: all 0.3s ease; }
    .mobile-social-links a:hover { background: var(--gold); color: var(--ink); transform: translateY(-3px); }
}