/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;700&family=Almarai:wght@400;700&family=IBM+Plex+Sans+Arabic:wght@400;500;700&display=swap');

:root {
    --primary-blue: #2B5292;
    --accent-blue: #5B86E5;
    --deep-charcoal: #333333;
    --silver-gray: #E1E4E8;
    --pure-white: #FFFFFF;

    --header-font: 'Cairo', sans-serif;
    --body-font: 'IBM Plex Sans Arabic', sans-serif;

    --transition: all 0.3s ease;
    --shadow-soft: 0 4px 15px rgba(0, 0, 0, 0.05);
    --border-radius: 4px;
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--pure-white);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.8s ease, visibility 0.8s;
}

#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
}

.loader-content img {
    height: 100px;
    margin-bottom: 20px;
    animation: pulseLogo 2s infinite ease-in-out;
}

.loader-bar {
    width: 150px;
    height: 3px;
    background: var(--silver-gray);
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

.loader-bar::after {
    content: '';
    position: absolute;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--primary-blue), transparent);
    animation: loadingBar 1.5s infinite linear;
}

@keyframes pulseLogo {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

@keyframes loadingBar {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    direction: rtl;
}

body {
    font-family: var(--body-font);
    color: var(--deep-charcoal);
    background-color: var(--pure-white);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--header-font);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: var(--header-font);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-blue), var(--primary-blue));
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(43, 82, 146, 0.3);
}

.btn-outline {
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
    background: transparent;
}

.btn-outline:hover {
    background: var(--primary-blue);
    color: white;
}

/* Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    gap: 20px;
}

.logo img {
    height: 50px;
}

.nav-links {
    display: flex;
    gap: 30px;
    flex: 1;
}

.nav-links a {
    font-weight: 500;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-blue);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Mobile-only helpers (hidden by default) */
.mobile-only {
    display: none;
}

/* Desktop header controls */
.desktop-lang-switcher,
.desktop-cta {
    display: flex;
    align-items: center;
}

.desktop-lang-switcher {
    margin-left: 15px;
}

.desktop-cta {
    margin-left: 15px;
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    gap: 8px;
    align-items: center;
}

.lang-btn {
    padding: 6px 12px;
    border: 2px solid var(--primary-blue);
    background: transparent;
    color: var(--primary-blue);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--header-font);
}

.lang-btn:hover {
    background: var(--primary-blue);
    color: white;
}

.lang-btn.active {
    background: var(--primary-blue);
    color: white;
}

/* Hero Section */
.hero {
    height: 100vh;
    background: linear-gradient(135deg, rgba(43, 82, 142, 0.9), rgba(91, 134, 229, 0.7)), url('hero.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -50px;
    left: 0;
    width: 100%;
    height: 100px;
    background: var(--pure-white);
    transform: skewY(-2deg);
    z-index: 10;
}

.hero-content {
    max-width: 800px;
    z-index: 20;
    text-align: right;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
}

.hero p {
    font-size: 1.4rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* Geometric Section Backgrounds Override */
section:nth-of-type(even) {
    background-color: var(--silver-gray);
    position: relative;
    overflow: hidden;
}

section:nth-of-type(even)::before {
    content: '';
    position: absolute;
    top: -200px;
    right: -200px;
    width: 400px;
    height: 400px;
    background: rgba(43, 82, 146, 0.03);
    transform: rotate(45deg);
    pointer-events: none;
}

/* Section General */
section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--primary-blue);
    position: relative;
    padding-bottom: 15px;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--accent-blue);
}

/* Services */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background: white;
    padding: 40px;
    border-radius: 4px;
    box-shadow: var(--shadow-soft);
    text-align: center;
    transition: var(--transition);
    border-bottom: 4px solid var(--primary-blue);
    position: relative;
    z-index: 1;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.service-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
    transition: var(--transition);
    z-index: -1;
    border-radius: 4px;
}

.service-card:hover::after {
    width: 100%;
}

.service-card:hover h3,
.service-card:hover p,
.service-card:hover i {
    color: white;
}

.service-card i {
    font-size: 3rem;
    color: var(--primary-blue);
    margin-bottom: 20px;
}

/* Image Slider */
.gallery-slider {
    background: var(--silver-gray);
    padding: 60px 0;
    overflow: hidden;
    position: relative;
}

.slider-container {
    width: 100%;
    max-width: 960px;
    /* 3 images + padding */
    margin: 0 auto;
    overflow: hidden;
}

.slider-track {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide {
    width: 320px;
    /* Exactly 1/3 of container */
    height: 220px;
    padding: 10px;
    flex-shrink: 0;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
    border: 3px solid transparent;
}

.slide img:hover {
    transform: scale(1.02);
    border-color: var(--accent-blue);
}

/* Arrows */
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.slider-arrow:hover {
    background: var(--accent-blue);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.slider-arrow.prev {
    right: -25px;
}

.slider-arrow.next {
    left: -25px;
}

@media (max-width: 1024px) {
    .slider-container {
        max-width: 640px;
        /* 2 images */
    }

    .slider-arrow.prev {
        left: 0;
    }

    .slider-arrow.next {
        left: 0;
    }
}

@media (max-width: 768px) {
    .slider-container {
        max-width: 320px;
        /* 1 image */
    }
}

/* Why Us / Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    text-align: center;
}

.stat-item h3 {
    font-size: 3rem;
    color: var(--primary-blue);
    margin-bottom: 10px;
}

.stat-item p {
    font-weight: 600;
    color: var(--deep-charcoal);
}

/* Contact */
.contact-container {
    text-align: center;
}

.contact-info {
    max-width: 900px;
    margin: 0 auto;
}

.contact-description {
    margin-bottom: 40px;
}

.contact-info-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: right;
}

.info-item i {
    color: var(--primary-blue);
    font-size: 1.5rem;
}

/* Mobile: Contact cards */
@media (max-width: 768px) {
    .contact-info-grid {
        flex-direction: column;
        gap: 15px;
    }

    .info-item {
        background: white;
        padding: 20px;
        border-radius: var(--border-radius);
        box-shadow: var(--shadow-soft);
        width: 100%;
        justify-content: center;
        text-align: center;
        flex-direction: column;
        border-right: 4px solid var(--primary-blue);
        transition: var(--transition);
    }

    .info-item:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    }

    .info-item i {
        font-size: 2rem;
        margin-bottom: 10px;
    }

    .info-item div {
        text-align: center;
    }
}

/* Footer */
footer {
    background: #1a1a1a;
    color: #e0e0e0;
    padding: 80px 0 20px;
    position: relative;
    z-index: 1;
}

footer h3,
footer h4 {
    color: white;
    margin-bottom: 25px;
}

footer p {
    margin-bottom: 15px;
}

footer ul li {
    margin-bottom: 10px;
}

footer ul li a:hover {
    color: var(--accent-blue);
    padding-right: 5px;
}

.footer-logo {
    height: 70px;
    margin-bottom: 25px;
    filter: brightness(0) invert(1);
    /* Makes the logo white for the dark footer */
    opacity: 0.9;
    transition: var(--transition);
}

.footer-logo:hover {
    opacity: 1;
    filter: brightness(0) invert(1) drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

.social-links {
    display: none;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 25px;
    margin-top: 50px;
}

/* WhatsApp Floating Button */
.whatsapp-float {
    position: fixed;
    bottom: 40px;
    right: 40px;
    background-color: #25d366;
    color: white;
    padding: 12px 25px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.5);
    z-index: 9999;
    /* Ensure it's above everything */
    transition: var(--transition);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 10px 25px rgba(37, 211, 102, 0.5);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 10px 35px rgba(37, 211, 102, 0.7);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 10px 25px rgba(37, 211, 102, 0.5);
    }
}

.whatsapp-float i {
    font-size: 1.8rem;
}

.whatsapp-float:hover {
    background-color: #128c7e;
    color: white;
    animation: none;
    transform: translateY(-5px);
}

@media (max-width: 992px) {
    nav {
        position: relative;
        z-index: 1001;
    }

    .menu-toggle {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 280px;
        background: white;
        flex-direction: column;
        padding: 80px 20px 20px;
        gap: 20px;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.15);
        display: none;
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }

    .nav-links.active {
        display: flex;
        transform: translateX(0);
    }

    /* Hide desktop header controls on mobile */
    .desktop-lang-switcher,
    .desktop-cta {
        display: none !important;
    }

    /* Show mobile-only items inside sidebar */
    .mobile-only {
        display: block;
    }

    .mobile-lang-switcher {
        display: flex;
        justify-content: center;
        padding-bottom: 10px;
        margin-top: 10px;
        border-bottom: 1px solid var(--silver-gray);
    }

    .mobile-cta .btn {
        width: 100%;
        text-align: center;
        margin-top: 10px;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .hero-content {
        text-align: center;
    }

    .hero-btns {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .hero-btns .btn {
        margin: 0 !important;
    }

    .whatsapp-float {
        bottom: 20px;
        right: 20px;
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .whatsapp-float i {
        font-size: 1.4rem;
    }
}