:root {
    --primary-color: #0066cc;
    --primary-dark: #0052a3;
    --primary-light: #3385d6;
    --secondary-color: #1a1a1a;
    --text-color: #333;
    --text-light: #666;
    --bg-light: #f8f9fa;
    --white: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

body[dir="ltr"] {
    direction: ltr;
    text-align: left;
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body[dir="rtl"] {
    direction: rtl;
    text-align: right;
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--white);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

#preloader.fade-out {
    opacity: 0;
    pointer-events: none;
}

.preloader-content {
    text-align: center;
}

.preloader-logo {
    width: 200px;
    height: auto;
    animation: pulse 2s ease-in-out infinite;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--bg-light);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Language Switcher */
.language-switcher {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    display: flex;
    gap: 0;
    background: var(--white);
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    overflow: hidden;
    padding: 3px;
}

body[dir="rtl"] .language-switcher {
    left: auto;
    right: 20px;
}

.lang-btn {
    padding: 10px 20px;
    background: transparent;
    color: var(--text-color);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    position: relative;
    z-index: 1;
    text-decoration: none;
    display: inline-block;
}

.lang-btn:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.lang-btn.active {
    background: var(--primary-color);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    padding: 15px 0;
    transition: all 0.3s;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar.scrolled {
    padding: 10px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-img {
    height: 50px;
    width: auto;
}

.brand-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    white-space: nowrap;
}

body[dir="ltr"] .brand-text {
    font-family: 'Poppins', sans-serif;
}

body[dir="rtl"] .brand-text {
    font-family: 'Tajawal', sans-serif;
}

.navbar-nav .nav-link {
    color: var(--text-color) !important;
    font-weight: 500;
    margin: 0 10px;
    transition: color 0.3s;
    position: relative;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s;
}

.navbar-nav .nav-link:hover::after {
    width: 100%;
}

.lang-nav-btn {
    background: var(--primary-color) !important;
    color: var(--white) !important;
    border-radius: 25px;
    padding: 8px 20px !important;
    margin: 0 5px !important;
    font-weight: 600;
    transition: all 0.3s;
}

.lang-nav-btn:hover {
    background: var(--primary-dark) !important;
    color: var(--white) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.3);
}

.lang-nav-btn::after {
    display: none;
}

.lang-nav-btn i {
    margin-left: 5px;
}

body[dir="rtl"] .lang-nav-btn i {
    margin-left: 0;
    margin-right: 5px;
}

.navbar-toggler {
    border-color: var(--text-color);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2833, 37, 41, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Hero Section */
.hero-section {
    position: relative;
    height: 100vh;
    overflow: hidden;
}

.slideshow-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.slide {
    display: none;
    position: absolute;
    width: 100%;
    height: 100%;
    animation: fadeIn 1s;
}

.slide.active {
    display: block;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.8) 0%, rgba(26, 26, 26, 0.7) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.hero-content {
    text-align: center;
    color: var(--white);
    padding: 20px;
    z-index: 2;
}

.hero-title {
    font-size: 4rem;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.5);
    animation: slideUp 1s ease-out;
}

.hero-subtitle {
    font-size: 1.5rem;
    text-shadow: 1px 1px 5px rgba(0,0,0,0.5);
    animation: slideUp 1.2s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slideshow-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 3;
}

.prev-btn, .next-btn {
    background: rgba(255, 255, 255, 0.3);
    color: var(--white);
    border: none;
    padding: 15px 20px;
    font-size: 24px;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s;
    backdrop-filter: blur(5px);
}

.prev-btn:hover, .next-btn:hover {
    background: rgba(255, 255, 255, 0.5);
}

.slideshow-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 3;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.dot.active {
    background: var(--white);
    width: 30px;
    border-radius: 6px;
}

/* Sections */
section {
    padding: 80px 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.title-underline {
    width: 100px;
    height: 4px;
    background: var(--primary-color);
    margin: 0 auto 40px;
    border-radius: 2px;
}

/* About Section */
.about-section {
    background: var(--bg-light);
}

.about-card {
    background: var(--white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    height: 100%;
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
}

.about-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.card-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.about-card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
}

.card-icon i {
    font-size: 2.5rem;
    color: var(--white);
}

.card-title {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 15px;
    font-weight: bold;
}

.about-content {
    background: var(--white);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.about-content p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-light);
}

/* Programs Section */
.programs-section {
    background: var(--white);
}

.program-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 40px 20px;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s;
    height: 100%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.program-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

.program-card i {
    font-size: 3rem;
    margin-bottom: 20px;
    display: block;
}

.program-card h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

/* Contact Section */
.contact-section {
    background: var(--bg-light);
}

.contact-info {
    background: var(--white);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    height: 100%;
}

.contact-info h3 {
    color: var(--primary-color);
    margin-bottom: 30px;
    font-size: 1.8rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 25px;
}

.contact-item i {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin: 5px 15px 0 0;
    min-width: 30px;
}

body[dir="ltr"] .contact-item i {
    margin: 5px 0 0 15px;
}

.contact-item p {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-light);
}

.contact-item a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

.contact-item a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.contact-form {
    background: var(--white);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.contact-form .form-control {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.contact-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
    outline: none;
}

.btn-submit {
    background: var(--primary-color);
    color: var(--white);
    padding: 12px 40px;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s;
    width: 100%;
}

.btn-submit:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 102, 204, 0.3);
}

/* Footer Image Section */
.footer-image-section {
    width: 100%;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.footer-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Footer */
.footer {
    background: var(--secondary-color);
    color: var(--white);
}

.footer-logo {
    height: 60px;
    width: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .language-switcher {
        top: 10px;
        left: 10px;
        padding: 2px;
    }
    
    body[dir="rtl"] .language-switcher {
        left: auto;
        right: 10px;
    }
    
    .lang-btn {
        padding: 8px 15px;
        font-size: 12px;
    }
    
    .navbar {
        padding: 10px 0;
    }
    
    .logo-img {
        height: 40px;
    }
    
    .brand-text {
        font-size: 1rem;
    }
    
    .lang-nav-btn {
        padding: 6px 15px !important;
        font-size: 0.9rem;
        margin: 5px 0 !important;
    }
    
    .lang-nav-btn i {
        font-size: 0.9rem;
    }
    
    .preloader-logo {
        width: 150px;
    }
    
    .about-content {
        padding: 25px;
    }
    
    .contact-info,
    .contact-form {
        padding: 25px;
    }
    
    .program-card {
        padding: 30px 15px;
    }
    
    .program-card i {
        font-size: 2.5rem;
    }
    
    section {
        padding: 50px 0;
    }
    
    .footer-image {
        width: 100%;
        max-width: 100%;
        height: auto;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .prev-btn, .next-btn {
        padding: 10px 15px;
        font-size: 18px;
    }
    
    .slideshow-dots {
        bottom: 20px;
    }
    
    .brand-text {
        font-size: 0.9rem;
    }
    
    .navbar-brand {
        gap: 10px;
    }
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Navbar Active Link */
.navbar-nav .nav-link.active {
    color: var(--primary-light) !important;
}

.navbar-nav .nav-link.active::after {
    width: 100%;
}
