/* ===================================================================
   CSS Variables & Reset
   =================================================================== */
:root {
    --primary: #052a5c;
    --primary-dark: #031a3b;
    --primary-light: #e6effa;
    --accent: #285d92;
    --accent-light: #d6e4f3;
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --bg-alt: #f1f5f9;
    --text-dark: #1e293b;
    --text-body: #475569;
    --text-light: #94a3b8;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 20px rgba(5, 42, 92, 0.08);
    --shadow-lg: 0 10px 40px rgba(5, 42, 92, 0.15);
    --shadow-card: 0 8px 30px rgba(5, 42, 92, 0.06);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* CRITICAL: Image Reset - prevents images from overflowing */
img,
video {
    max-width: 100%;
    height: auto;
    display: block;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Tajawal', sans-serif;
    background-color: var(--bg-white);
    color: var(--text-body);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4,
.section-badge,
.btn-primary,
.btn-outline,
.nav-cta {
    font-family: 'Cairo', sans-serif;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* ===================================================================
   Utilities
   =================================================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 100px 0;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-badge {
    display: inline-block;
    padding: 6px 18px;
    background-color: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(5, 42, 92, 0.15);
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
}

.section-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 16px;
    line-height: 1.3;
}

.section-desc {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 550px;
    margin: 0 auto;
}

/* ===================================================================
   Buttons
   =================================================================== */
.btn-primary,
.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 26px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: var(--transition);
    border: 2px solid transparent;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(5, 42, 92, 0.25);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(5, 42, 92, 0.35);
}

.btn-outline {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
    transform: translateY(-2px);
}

.btn-full {
    width: 100%;
    font-size: 1.05rem;
}

/* ===================================================================
   Navbar (Frosted Glass - Light)
   =================================================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 16px 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: padding 0.3s, box-shadow 0.3s;
}

.navbar.scrolled {
    padding: 10px 0;
    box-shadow: var(--shadow-md);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* CRITICAL: Logo size constraint */
.logo img {
    height: 42px;
    width: auto;
    max-width: 160px;
    border-radius: 6px;
}

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-links a {
    color: var(--text-dark);
    font-weight: 500;
    font-size: 1rem;
    transition: color 0.3s;
    position: relative;
}

.nav-links a:not(.nav-cta)::after {
    content: '';
    position: absolute;
    bottom: -4px;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.nav-links a:not(.nav-cta):hover::after {
    width: 100%;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-cta {
    background: var(--primary);
    color: #fff !important;
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    transition: var(--transition);
}

.nav-cta:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.nav-cta::after {
    display: none !important;
}

/* Hamburger Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2.5px;
    background: var(--text-dark);
    border-radius: 3px;
    transition: var(--transition);
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ===================================================================
   Hero Section
   =================================================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.parallax-bg {
    position: absolute;
    inset: -10% 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to left,
        rgba(15, 23, 42, 0.45) 0%,
        rgba(15, 23, 42, 0.85) 50%,
        rgba(15, 23, 42, 0.95) 100%
    );
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    padding: 80px 0 40px;
}

.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(40, 93, 146, 0.2);
    color: #93c5fd;
    border: 1px solid rgba(40, 93, 146, 0.4);
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 24px;
    font-family: 'Cairo', sans-serif;
}

.display-title {
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 20px;
    color: #fff;
}

.text-accent {
    color: var(--primary);
}

.hero-desc {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: #cbd5e1;
    margin-bottom: 36px;
    max-width: 550px;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* ===================================================================
   About Section (Asymmetrical Grid)
   =================================================================== */
.about-section {
    background: var(--bg-light);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 60px;
    align-items: center;
}

.about-desc {
    font-size: 1.1rem;
    color: var(--text-body);
    margin-bottom: 24px;
    line-height: 1.9;
}

.features-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 24px;
}

.features-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-dark);
}

.check-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 900;
    flex-shrink: 0;
}

.about-images {
    position: relative;
    height: 480px;
}

.img-card {
    position: absolute;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.img-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.img-card:hover img {
    transform: scale(1.04);
}

.main-img {
    width: 75%;
    height: 85%;
    right: 0;
    bottom: 0;
    z-index: 1;
    border: 4px solid #fff;
}

.floating-img {
    width: 50%;
    height: 55%;
    left: 0;
    top: 0;
    z-index: 2;
    border: 4px solid #fff;
    animation: float 5s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-14px); }
}

.stats-badge {
    position: absolute;
    bottom: 30px;
    left: 20px;
    z-index: 3;
    background: var(--primary);
    color: #fff;
    padding: 18px 24px;
    border-radius: var(--radius-sm);
    text-align: center;
    box-shadow: 0 8px 25px rgba(5, 42, 92, 0.35);
}

.stats-number {
    display: block;
    font-family: 'Cairo', sans-serif;
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
}

.stats-label {
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0.9;
}

/* ===================================================================
   Services Section (3D Tilt Cards)
   =================================================================== */
.services-section {
    background: var(--bg-white);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.service-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
    cursor: default;
    transform-style: preserve-3d;
    transform: perspective(1000px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    box-shadow: var(--shadow-lg);
}

.card-glow {
    position: absolute;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(40, 93, 146, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 0;
}

.service-card:hover .card-glow {
    opacity: 1;
}

.card-content {
    padding: 44px 30px;
    position: relative;
    z-index: 1;
    transform: translateZ(20px);
    text-align: center;
}

.service-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius);
    margin: 0 auto 20px;
}

.service-icon svg {
    width: 36px;
    height: 36px;
}

.service-card h3 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.service-card p {
    color: var(--text-body);
    line-height: 1.8;
}

/* ===================================================================
   Gallery Section
   =================================================================== */
.gallery-section {
    background: var(--bg-light);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    height: 320px;
    box-shadow: var(--shadow-sm);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.85) 0%, transparent 60%);
    display: flex;
    align-items: flex-end;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.item-overlay span {
    font-family: 'Cairo', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    transform: translateY(10px);
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.08);
}

.gallery-item:hover .item-overlay {
    opacity: 1;
}

.gallery-item:hover .item-overlay span {
    transform: translateY(0);
}

/* ===================================================================
   Contact Section
   =================================================================== */
.contact-section {
    background: var(--bg-white);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: flex-start;
}

.contact-desc {
    font-size: 1.05rem;
    color: var(--text-body);
    margin-bottom: 32px;
    line-height: 1.8;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.contact-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-icon svg {
    width: 22px;
    height: 22px;
}

.contact-item strong {
    display: block;
    font-size: 0.9rem;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.contact-item span,
.contact-item a {
    font-size: 1rem;
    color: var(--text-body);
}

.contact-item a:hover {
    color: var(--primary);
}

/* Contact Form */
.contact-form-wrap {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-card);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    color: var(--text-dark);
    font-family: 'Tajawal', sans-serif;
    transition: var(--transition);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-light);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(5, 42, 92, 0.1);
}

/* ===================================================================
   Footer
   =================================================================== */
.footer {
    background: var(--text-dark);
    padding: 32px 0;
    text-align: center;
    color: #cbd5e1;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.footer-logo img {
    height: 36px;
    width: auto;
    max-width: 140px;
    border-radius: 4px;
    filter: brightness(1.5);
}

.footer p {
    font-size: 0.9rem;
}

/* ===================================================================
   Scroll Animations
   =================================================================== */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Native CSS Scroll-driven animations (Progressive Enhancement) */
@supports (animation-timeline: view()) {
    .scroll-animate {
        opacity: 1;
        transform: none;
        transition: none;
        animation: slideUpReveal linear both;
        animation-timeline: view(block);
        animation-range: entry 5% cover 30%;
    }

    @keyframes slideUpReveal {
        from { opacity: 0; transform: translateY(50px); }
        to { opacity: 1; transform: translateY(0); }
    }
}

/* ===================================================================
   Responsive: Tablet (max-width: 1024px)
   =================================================================== */
@media (max-width: 1024px) {
    .about-grid {
        grid-template-columns: 1fr;
    }

    .about-images {
        height: 380px;
        margin-top: 40px;
    }

    .services-grid {
        grid-template-columns: 1fr 1fr;
    }

    .gallery-grid {
        grid-template-columns: 1fr 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }
}

/* ===================================================================
   Responsive: Mobile (max-width: 768px)
   =================================================================== */
@media (max-width: 768px) {
    .section {
        padding: 70px 0;
    }

    /* Mobile Navbar */
    .mobile-menu-btn {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background: #fff;
        flex-direction: column;
        padding: 100px 30px 30px;
        gap: 0;
        box-shadow: -5px 0 30px rgba(0,0,0,0.1);
        transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 999;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        padding: 16px 0;
        font-size: 1.1rem;
        border-bottom: 1px solid var(--border-color);
        width: 100%;
    }

    .nav-cta {
        margin-top: 20px;
        text-align: center;
        border-bottom: none;
    }

    /* Hero Mobile */
    .hero-content {
        padding: 100px 0 40px;
    }

    .hero-buttons {
        flex-direction: column;
        max-width: 280px;
    }

    .hero-buttons a {
        text-align: center;
    }

    /* About Mobile */
    .about-images {
        height: 300px;
    }

    .floating-img {
        width: 45%;
        height: 45%;
    }

    .features-list {
        grid-template-columns: 1fr;
    }

    /* Services Mobile */
    .services-grid {
        grid-template-columns: 1fr;
    }

    /* Gallery Mobile */
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-item {
        height: 240px;
    }

    /* Contact Mobile */
    .contact-form-wrap {
        padding: 24px;
    }
}
