:root {
    /* Color Palette */
    --primary-color: #064E3B; /* Emerald Green */
    --primary-light: #10B981;
    --secondary-color: #D4AF37; /* Gold */
    --accent-color: #F3E5AB; /* Sand/Cream */
    --text-dark: #1F2937;
    --text-light: #F9FAFB;
    --bg-main: #FAF9F6;
    --white: #FFFFFF;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* RTL Support */
[dir="rtl"] {
    font-family: 'El Messiri', 'Amiri', serif;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
}

[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6 {
    font-family: 'El Messiri', serif;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Layout Utilites */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 5rem 0;
}

.flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid { display: grid; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition-slow);
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: #B8962D;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

/* Header */
header {
    background-color: transparent;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 2000; /* Higher than everything else */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

header.scrolled {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.announcement-banner {
    background: var(--secondary-color);
    color: white;
    text-align: center;
    padding: 0.6rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.4s ease, opacity 0.3s ease;
    z-index: 2001;
}

header.scrolled .announcement-banner {
    transform: translateY(-100%);
    opacity: 0;
}

header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 2rem;
    transition: padding 0.4s ease;
}

header.scrolled .container {
    padding: 0.75rem 2rem;
}

.header-logo {
    height: 100px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    transition: all 0.4s ease;
}

header.scrolled .header-logo {
    height: 60px;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-links a {
    color: var(--white);
    font-weight: 600;
    position: relative;
    padding: 0.5rem 0;
}

header.scrolled .nav-links a {
    color: var(--text-dark);
}

/* Link Underline Animation */
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--secondary-color);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.lang-switch {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(6, 78, 59, 0.2);
}

.lang-switch:hover {
    transform: scale(1.05);
    background: var(--primary-light);
}

#menu-toggle {
    display: none; /* Desktop hidden */
    font-size: 1.6rem;
    cursor: pointer;
    color: var(--white);
    transition: color 0.3s ease;
    padding: 0.5rem;
}

header.scrolled #menu-toggle {
    color: var(--primary-color);
}

.hero {
    height: 100vh;
    padding-top: 5rem;
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('assets/images/hero.png');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    color: var(--white);
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

.hero-btns {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition-slow);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

/* Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 4rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
}

.footer-logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-links a {
    font-size: 1.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
}

/* RTL Specific adjustments */
[dir="rtl"] .hero-btns { flex-direction: row-reverse; }
[dir="rtl"] .nav-links { flex-direction: row-reverse; }

/* Responsive Improvements */
@media (max-width: 1024px) {
    .nav-links { gap: 1.5rem; font-size: 0.95rem; }
    .header-logo { height: 80px; }
    header.scrolled .header-logo { height: 50px; }
}

@media (max-width: 992px) {
    header .container {
        padding: 0.75rem 1.5rem;
    }

    #menu-toggle {
        display: block;
        order: 3;
    }

    .header-logo {
        height: 70px;
        order: 1;
    }

    header.scrolled .header-logo {
        height: 55px;
    }

    .header-controls {
        order: 2;
        gap: 0.8rem;
    }

    .lang-switch {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background: var(--white);
        padding: 5rem 2rem;
        box-shadow: -5px 0 30px rgba(0,0,0,0.15);
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1999;
        text-align: left;
    }

    [dir="rtl"] .nav-links {
        left: -100%;
        right: auto;
        text-align: right;
    }

    .nav-links.active {
        display: flex;
        right: 0;
    }

    [dir="rtl"] .nav-links.active {
        left: 0;
        right: auto;
    }

    .nav-links a {
        color: var(--text-dark) !important;
        font-size: 1.2rem;
        border-bottom: 1px solid #f0f0f0;
        width: 100%;
        padding: 1rem 0;
    }
    
    .hero h1 { font-size: 2.5rem; }
    .hero p { font-size: 1.1rem; }
    .hero-btns { flex-direction: column; padding: 0 2rem; }

    .teachers-grid, .flex-stack { 
        flex-direction: column !important; 
        gap: 2.5rem !important;
    }
}

@media (max-width: 480px) {
    .header-logo { height: 55px; }
    header.scrolled .header-logo { height: 45px; }
    .lang-switch { font-size: 0.75rem; padding: 0.35rem 0.6rem; }
    .nav-links { width: 100%; }
}

/* Spinner Utility */
.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

button.loading .spinner {
    display: inline-block;
}

button.loading .btn-text {
    opacity: 0.7;
}
