@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #0077B6;
    --primary-dark: #03045E;
    --secondary: #00B4D8;
    --accent: #90E0EF;
    --light: #CAF0F8;
    --white: #FFFFFF;
    --black: #000000;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-500: #64748b;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius: 16px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--gray-800);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.2;
    font-weight: 700;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 36px;
    color: var(--primary-dark);
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--secondary);
    border-radius: 2px;
}

.section-title p {
    color: var(--gray-500);
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto;
}

/* Sections */
section {
    padding: 100px 0;
}

.bg-light {
    background: var(--gray-50);
}

.bg-blue {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: var(--white);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    gap: 10px;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(0, 119, 182, 0.4);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 119, 182, 0.5);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary);
}

.btn-secondary:hover {
    background: var(--gray-100);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--white);
    color: var(--white);
}

.btn-outline:hover {
    background: var(--white);
    color: var(--primary);
}

.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #25D366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: var(--transition);
    animation: pulse 2s infinite;
}

.whatsapp-float:hover {
    transform: scale(1.1);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: transparent;
    transition: var(--transition);
    padding: 20px 0;
}

header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    box-shadow: var(--shadow-sm);
}

nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    color: var(--accent);
}

header.scrolled .logo {
    color: var(--primary-dark);
}

header.scrolled .logo i {
    color: var(--primary);
}

/* Logo Image Color Adaptation */
.logo img {
    transition: var(--transition);
    filter: brightness(0) invert(1);
    /* Forces it to be WHITE initially if it's not already, or keeps it white */
}

/* If the user uploads a white logo, it's white. */
/* On scroll, background becomes white, so we need to make the logo DARK/BLUE */
header.scrolled .logo img {
    /* Filter to match --primary-dark (#03045E) roughly */
    filter: brightness(0) saturate(100%) invert(13%) sepia(35%) saturate(5436%) hue-rotate(224deg) brightness(91%) contrast(106%);
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    color: var(--white);
    font-weight: 500;
    opacity: 0.9;
}

header.scrolled .nav-links a {
    color: var(--gray-800);
}

.nav-links a:hover {
    color: var(--accent);
}

header.scrolled .nav-links a:hover {
    color: var(--primary);
}

.nav-btn {
    padding: 10px 24px;
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--white);
    font-weight: 600;
}

header.scrolled .lang-switch {
    color: var(--primary);
}

.mobile-toggle {
    display: none;
    color: var(--white);
    font-size: 24px;
    cursor: pointer;
}

header.scrolled .mobile-toggle {
    color: var(--navy);
}

/* Hero Section */
/* Hero Section */
.hero {
    min-height: 100vh;
    background: linear-gradient(135deg, rgba(3, 4, 94, 0.95) 0%, rgba(0, 119, 182, 0.85) 100%), url('https://images.unsplash.com/photo-1629909613654-28e377c37b09?auto=format&fit=crop&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 80px;
    overflow: hidden;
}

.hero-content {
    color: var(--white);
    max-width: 600px;
    position: relative;
    z-index: 2;
}

.hero-image-overlay {
    position: absolute;
    bottom: 0;
    /* right: 10%; Handled in RTL/LTR specific CSS or via media query logic */
    height: 85vh;
    z-index: 1;
    pointer-events: none;
}

.hero-image-overlay img {
    height: 100%;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.3));
}

/* RTL Support for Hero */
html[dir="rtl"] .hero-image-overlay {
    left: 10%;
    transform: scaleX(-1);
    /* Flip image if needed, or just position */
}

html[dir="rtl"] .hero-image-overlay img {
    transform: scaleX(-1);
    /* Unflip the image itself if parent was flipped */
}

/* Wait, simple positioning is better */
html[dir="rtl"] .hero-image-overlay {
    right: auto;
    left: 5%;
    transform: none;
}

html[dir="ltr"] .hero-image-overlay {
    left: auto;
    right: 5%;
}


.hero h1 {
    font-size: 56px;
    margin-bottom: 20px;
    line-height: 1.1;
}

.hero p {
    font-size: 20px;
    margin-bottom: 40px;
    opacity: 0.9;
}

.hero-btns {
    display: flex;
    gap: 20px;
}

/* Swiper Customization */
.swiper {
    width: 100%;
    padding-bottom: 50px;
}

.swiper-slide {
    height: auto;
}

.swiper-pagination-bullet-active {
    background: var(--primary);
}

.swiper-button-next,
.swiper-button-prev {
    color: var(--primary);
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-image {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.about-image img {
    width: 100%;
    display: block;
    transition: var(--transition);
}

.about-image:hover img {
    transform: scale(1.05);
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 40px;
}

.stat-item {
    text-align: center;
}

.stat-item h3 {
    font-size: 36px;
    color: var(--primary);
    margin-bottom: 5px;
}

.stat-item p {
    font-size: 14px;
    color: var(--gray-500);
}

/* Services Section */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    text-align: center;
    border: 1px solid var(--gray-100);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.service-icon {
    width: 80px;
    height: 80px;
    background: var(--light);
    color: var(--primary);
    font-size: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    transition: var(--transition);
}

.service-card:hover .service-icon {
    background: var(--primary);
    color: var(--white);
}

.service-card h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: var(--primary-dark);
}

.service-card p {
    color: var(--gray-500);
    font-size: 15px;
}

/* Branch Section */
.branches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.branch-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.branch-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.branch-info {
    padding: 30px;
}

.branch-info h3 {
    font-size: 22px;
    margin-bottom: 15px;
    color: var(--primary-dark);
}

.branch-info p {
    color: var(--gray-500);
    margin-bottom: 10px;
    display: flex;
    gap: 10px;
}

.branch-info i {
    color: var(--primary);
    margin-top: 5px;
}

.map-container {
    width: 100%;
    height: 300px;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Gallery Section */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 1;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay i {
    color: var(--white);
    font-size: 32px;
}

/* Videos Section */
.video-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.video-thumbnail {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 Aspect Ratio */
    background: #000;
    overflow: hidden;
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.video-card:hover .video-thumbnail img {
    transform: scale(1.05);
    opacity: 0.8;
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--white);
    font-size: 3rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    opacity: 0.9;
    transition: var(--transition);
}

.video-card:hover .play-icon {
    transform: translate(-50%, -50%) scale(1.1);
    color: var(--primary);
}

.video-info {
    padding: 20px;
    background: var(--white);
    text-align: center;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-info h3 {
    font-size: 1.1rem;
    margin: 0;
    color: var(--gray-800);
    line-height: 1.4;
}

/* Gallery Section */
.gallery-slider .swiper-slide {
    height: auto;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    /* aspect-ratio: 1; No forced aspect ratio for Swiper slides unless desired */
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

/* Testimonials */
.testimonials-slider {
    width: 100%;
    padding: 20px;
    /* Add padding for shadows */
}

.testimonial-card {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    transition: var(--transition);
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.testimonial-text {
    font-size: 1.25rem;
    /* Increased size */
    color: var(--gray-800);
    margin: 20px 0;
    font-style: italic;
    line-height: 1.6;
    font-weight: 500;
}

.client-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 10px;
}

.testimonial-image-wrapper {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    overflow: hidden;
}

.stars {
    color: #f59e0b;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

/* Contact Section */
.contact-wrapper {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: flex;
}

.contact-info {
    background: var(--primary);
    color: var(--white);
    padding: 60px;
    flex: 1;
}

.contact-info h3 {
    font-size: 28px;
    margin-bottom: 30px;
}

.info-item {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.info-item i {
    font-size: 24px;
    color: var(--accent);
}

.contact-form {
    padding: 60px;
    flex: 3;
}

.form-group {
    margin-bottom: 20px;
}

.form-control {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-family: inherit;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 119, 182, 0.1);
}

/* Footer */
footer {
    background: var(--gray-900);
    color: var(--white);
    padding: 80px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 60px;
}

.footer-logo {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-about p {
    color: var(--gray-500);
    margin-bottom: 20px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

.footer-col h3 {
    font-size: 18px;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

.footer-col h3::after {
    content: '';
    position: absolute;
    bottom: 0px;
    left: 0;
    /* Changed dynamically for RTL */
    width: 40px;
    height: 2px;
    background: var(--primary);
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--gray-500);
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--white);
    padding-left: 5px;
    /* RTL aware */
}

.copyright {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--gray-500);
}

/* Responsive */
@media (max-width: 992px) {
    .hero h1 {
        font-size: 42px;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .contact-wrapper {
        flex-direction: column;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .mobile-toggle {
        display: block;
    }

    .hero {
        text-align: center;
        justify-content: center;
    }

    .hero-content {
        margin: 0 auto;
    }

    .hero-btns {
        justify-content: center;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
}