/* Hide scrollbar for gallery but keep functionality */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Web App Layout (Mobile-First, Centered on Desktop) */
body {
    background-color: #e5e7eb;
    margin: 0;
    font-family: 'Cairo', 'Roboto', sans-serif;
}

button,
input,
textarea,
select {
    font-family: inherit;
}

.app-container {
    width: 100%;
    max-width: 475px; /* A comfortable mobile-app width */
    background-color: #ffffff;
    min-height: 100vh;
    position: relative;
    margin: 0 auto; /* Center the container horizontally */
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.1); /* A softer shadow for a modern feel */
    /* CRITICAL: display:flex and overflow:hidden are removed to allow global window scroll */
}

/* ── Mobile-First App Chrome (header + footer locked to wrapper) ── */
.app-header,
header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 475px;
    background: #ffffff !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    z-index: 990;
}

.app-footer-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 475px;
    z-index: 999;
}

.app-fab {
    position: fixed;
    z-index: 998;
    bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
}

.app-fab--whatsapp {
    right: max(1rem, calc(50% - 237.5px + 1rem));
}

.app-fab--scroll-top {
    left: max(1rem, calc(50% - 237.5px + 1rem));
}

/* Main scroll zone — slides over hero + header after pin */
.app-main-content {
    position: relative;
    z-index: 50;
    background: #ffffff;
}

.app-main-content.is-over-hero {
    z-index: 100;
}

.app-header.is-behind-content {
    /* This class is added via JS to ensure the header goes behind the main content during the scroll animation. */
    z-index: 80;
}

/* ── Popup Layer Architecture (absolute top of stack) ── */
#sideMenu,
#modal-about,
#modal-order {
    position: fixed !important;
    z-index: 9999 !important;
}

#menuOverlay {
    position: fixed !important;
    inset: 0;
    z-index: 9998 !important;
}

#sideMenu {
    top: 0;
    right: 0;
    height: 100%;
    max-width: 475px;
}

@media (min-width: 480px) { /* Apply padding on larger screens */
    body { 
        padding: 20px 0; 
    }
    .app-container {
        min-height: calc(100vh - 40px); /* Adjust min-height for body padding */
        /* border-radius and border are removed to avoid the phone mockup look and GSAP issues. */
    }
    .app-header,
    header {
        top: 20px;
    }
    .app-footer-bar {
        bottom: 20px;
    }
    .app-fab {
        bottom: calc(5.5rem + 20px + env(safe-area-inset-bottom, 0px));
    }
}

/* Tailwind-like utilities */
.text-darkText {
    color: #1A1A1A;
}

.bg-menuBg {
    background-color: #FAFAFA;
}

.bg-lightGray {
    background-color: #F5F5F5;
}

.text-primary {
    color: #00aca8;
}

.bg-primary {
    background-color: #00aca8;
}

.hover\:bg-primaryHover:hover {
    background-color: #008680;
}

.border-primary {
    border-color: #00aca8;
}

/* Remove fixed height and internal scroll from main content area */
main {
    /* max-height is removed to allow the entire page to scroll */
}

/* Section reveal animation */
.reveal-section {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    transition-delay: var(--reveal-delay, 0ms);
    will-change: opacity, transform;
}

.reveal-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Animated underline for headings */
.animated-section-title {
    position: relative;
    display: inline-block;
    padding-bottom: 0.45rem;
}

.animated-section-title::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 2px;
    border-radius: 9999px;
    background: linear-gradient(90deg, transparent 0%, #00aca8 25%, #00aca8 75%, transparent 100%);
    background-size: 200% 100%;
    animation: underline-pan 1.5s ease-in-out infinite alternate;
}

@keyframes underline-pan {
    from {
        background-position: 0% 50%;
    }
    to {
        background-position: 100% 50%;
    }
}

/* Fullscreen image viewer */
.zoomable-image {
    cursor: zoom-in;
}

.image-viewer-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.image-viewer-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.image-viewer-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(6px);
}

.image-viewer-stage {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    /* justify-content: center; */ /* Centering is now handled by JS for flexibility */
    overflow-x: auto; /* Allow horizontal panning */
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.image-viewer-image {
    width: auto;
    height: 100%; /* Fill the stage height, which is 100% of viewport */
    max-width: none;
    flex-shrink: 0; /* Prevent image from shrinking in flex container */
    border-radius: 0;
    box-shadow: none;
    background: #000;
    transition: opacity 0.25s ease; /* Fade in instead of scale */
}

.image-viewer-close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem; /* More conventional for RTL close button */
    z-index: 2;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.95);
    color: #111827;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); /* More prominent shadow */
    cursor: pointer;
}

.image-viewer-close-btn:hover {
    background: #ffffff;
}

/* Nearby Places section */
.nearby-places-panel {
    position: relative;
    overflow: hidden;
    padding: 0.25rem;
    border-radius: 1.5rem;
    border: 1px solid rgba(0, 172, 168, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 255, 254, 0.9) 100%);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.06);
}

.nearby-places-panel::before,
.nearby-places-panel::after {
    content: "";
    position: absolute;
    pointer-events: none;
    border-radius: 9999px;
}

.nearby-places-panel::before {
    top: -2.5rem;
    right: -2.5rem;
    width: 8rem;
    height: 8rem;
    background: radial-gradient(circle, rgba(0, 172, 168, 0.12) 0%, rgba(0, 172, 168, 0) 70%);
}

.nearby-places-panel::after {
    bottom: -3rem;
    left: -2.5rem;
    width: 9rem;
    height: 9rem;
    background: radial-gradient(circle, rgba(15, 23, 42, 0.05) 0%, rgba(15, 23, 42, 0) 72%);
}

.nearby-places-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 1rem;
}

.nearby-places-replay-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.42rem 0.8rem;
    border-radius: 9999px;
    border: 1px solid rgba(0, 172, 168, 0.16);
    background: rgba(0, 172, 168, 0.06);
    color: #0f766e;
    font-size: 0.75rem;
    font-weight: 700;
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.nearby-places-replay-btn:hover {
    transform: translateY(-1px);
    background: rgba(0, 172, 168, 0.09);
    border-color: rgba(0, 172, 168, 0.24);
}

.nearby-place-item {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.6rem 0.75rem;
    border-radius: 1.2rem;
    background: rgba(248, 250, 252, 0.76);
    border: 1px solid rgba(148, 163, 184, 0.12);
    transition: transform 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
    --nearby-duration: 1200ms;
}

.nearby-place-item.is-active {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(15, 23, 42, 0.08);
}

.nearby-place-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-inline: 0.1rem;
}

.nearby-place-name {
    font-size: 0.86rem;
    font-weight: 800;
    color: #111827;
}

.nearby-place-meta {
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
    white-space: nowrap;
}

.nearby-place-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nearby-place-icon-shell {
    width: 3rem;
    height: 3rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.nearby-place-icon-shell img {
    width: 2.25rem;
    height: 2.25rem;
    object-fit: contain;
}

.nearby-place-icon-shell i {
    font-size: 1.15rem;
}

.nearby-place-item.is-active .nearby-place-icon-shell {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.nearby-track {
    position: relative;
    flex: 1;
    height: 2.75rem;
    overflow: visible;
}

.nearby-track-line,
.nearby-track-fill {
    position: absolute;
    top: 50%;
    height: 2px;
    border-radius: 9999px;
    transform: translateY(-50%);
}

.nearby-track-line {
    inset-inline: 0;
    background: #e5e7eb;
}

.nearby-track-fill {
    inset-inline-start: 0;
    width: 0;
    background: var(--nearby-accent, #00aca8);
    transition: width var(--nearby-duration, 1200ms) cubic-bezier(0.25, 1, 0.5, 1);
}

.nearby-track-marker {
    position: absolute;
    top: 50%;
    right: 0;
    width: 4.2rem;
    height: 2.5rem;
    background-color: var(--nearby-accent, #00aca8);
    -webkit-mask-image: url(icon/car.svg);
    mask-image: url(icon/car.svg);
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    transform: translateY(-50%);
    transition: right var(--nearby-duration, 1200ms) cubic-bezier(0.25, 1, 0.5, 1), transform 0.25s ease;
}

.nearby-track-marker i {
    /* This rule is no longer used for the marker */
}

.nearby-track-marker::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 0 0 0 rgba(0, 172, 168, 0.18);
}

.nearby-place-item.is-active .nearby-track-marker {
    /* The marker is now the car icon, no need for a scale effect on active */
}

.nearby-count-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.nearby-count-badge {
    width: 2.6rem;
    height: 2.6rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: var(--nearby-accent, #00aca8);
    color: #ffffff;
    font-weight: 800;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
}

.nearby-count-value {
    font-size: 1.25rem;
    line-height: 1.1;
}

.nearby-count-unit {
    font-size: 0.65rem;
    font-weight: 700;
    color: #000000;
}

.nearby-place-item[data-nearby-highlight="true"] .nearby-count-badge {
    animation: nearby-pulse-ring 2.4s infinite ease-in-out;
}

@keyframes nearby-pulse-ring {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
    }
    50% {
        transform: scale(1.04);
        box-shadow: 0 0 0 6px rgba(0, 172, 168, 0.08), 0 14px 28px rgba(15, 23, 42, 0.12);
    }
}

@media (prefers-reduced-motion: reduce) {
    .reveal-section,
    .animated-section-title::after,
    .image-viewer-modal,
    .image-viewer-image,
    .nearby-places-replay-btn,
    .nearby-place-item,
    .nearby-place-icon-shell,
    .nearby-track-fill,
    .nearby-track-marker,
    .nearby-count-badge {
        transition: none;
        animation: none;
    }
}

/* Social Media Icon Color (primary: #00aca8) */
.social-icon-primary {
    filter: none;
}

/* Direction helper for Arabic content that should stay LTR */
.dir-ltr {
    direction: ltr;
    unicode-bidi: isolate;
}

/* About Modal Logo Styling */
.about-modal-logo {
    width: 70%;
    max-width: 280px;
}

/* Iframe border reset */
.no-iframe-border {
    border: 0;
}

/* About Modal specific styles */
#modal-about {
    /* Positioning is now handled by Tailwind's 'fixed' and 'inset-0' classes in the HTML,
       which was necessary to fix the modal's layout and visibility. */
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    /* Animation classes (transform, transition-transform, duration-300) are handled by JS toggling */
}

.about-modal-header {
    background-color: #ffffff;
    padding: 2rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
}

.about-modal-close-btn {
    position: absolute;
    top: 1rem;
    left: 1rem;
}

.modal-close-btn {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 9999px;
    background-color: #e5e7eb;
    color: #000000;
    transition: background-color 0.2s ease;
}
.modal-close-btn:hover {
    background-color: #d1d5db;
}

.about-modal-scroll-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-height: calc(100vh - 150px);
}

.about-modal-section-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.about-modal-info-card {
    background-color: #F5F5F5;
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.about-modal-info-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #d1d5db;
}
/* Remove bottom border and padding from the last info item */
.about-modal-info-item:last-of-type {
    border-bottom: 0;
    padding-bottom: 0;
}

.about-modal-contact-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.about-modal-contact-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background-color: #f9fafb;
    padding: 0.75rem;
    border-radius: 0.5rem;
}

.about-modal-contact-btn {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    transition: background-color 0.2s ease;
}

.about-modal-map-wrapper {
    width: 100%;
    height: 12rem;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid #d1d5db;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.about-modal-map-wrapper iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.about-modal-social-icons-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    width: 70%;
    margin: 0 auto;
    flex-wrap: wrap;
}

/* --- Typography & Content --- */

.about-modal-main-title {
    font-size: 1.25rem;
    line-height: 1.75rem;
    font-weight: 700;
    color: #111827;
}

.about-modal-tagline {
    text-align: center;
    color: #374151;
    font-weight: 600;
    font-size: 0.875rem;
}

.about-modal-section-title {
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 700;
    color: #1f2937;
}

.about-modal-description-text {
    color: #374151;
    line-height: 1.75;
    font-size: 0.875rem;
}

.about-modal-info-label {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.875rem;
}

.about-modal-info-value {
    color: #374151;
    font-size: 0.875rem;
    direction: ltr;
    unicode-bidi: isolate;
}

.about-modal-link {
    color: #00aca8;
    font-size: 0.875rem;
    direction: ltr;
    unicode-bidi: isolate;
}
.about-modal-link:hover {
    text-decoration: underline;
}

.about-modal-contact-number {
    color: #374151;
    font-size: 0.875rem;
    direction: ltr;
    unicode-bidi: isolate;
}

.about-modal-contact-icon {
    width: 1.25rem;
    height: 1.25rem;
    display: block;
}

.about-modal-address-text {
    color: #374151;
    font-size: 0.875rem;
}

/* --- Social Media Section --- */

.about-modal-social-link {
    display: inline-flex;
    transition: transform 0.2s ease;
}
.about-modal-social-link:hover {
    transform: scale(1.1);
}

.about-modal-social-icon-img {
    width: 1.5rem;
    height: 1.5rem;
    display: block;
}

/* -- Cinematic Drone-Zoom Hero Section -- */
.view-drone-hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    margin: 0;
    padding: 0;
    z-index: 1;
}

.view-drone-img-holder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 10;
}

.view-drone-img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transform-origin: center center;
    will-change: transform, opacity;
}

.view-drone-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    pointer-events: none;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* --- Image Comparison Slider --- */
.image-comparison-slider {
    position: relative;
    width: 100%;
    height: 250px;
    cursor: ew-resize;
    user-select: none;
}

.image-comparison-slider.dragging {
    cursor: grabbing;
}

.slider-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.slider-image-after-container {
    width: 50%; /* Initial position */
}

.slider-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* هذا هو الإصلاح الرئيسي: من خلال محاذاة الصورة إلى اليسار، نضمن أنه
       أثناء قص الحاوية العلوية من اليمين، يظل محتوى الصورة متطابقًا
       تمامًا مع الصورة السفلية. */
    object-position: left center;
}

.slider-label {
    position: absolute;
    top: 1rem;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 0.3rem 0.8rem;
    border-radius: 0.5rem;
    background-color: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    text-shadow: 0 1px 3px rgba(0,0,0,0.25);
    pointer-events: none;
}

.slider-label-after {
    left: 1rem;
}

.slider-label-before {
    right: 1rem;
}

.slider-handle {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    transform: translateX(-50%);
    cursor: ew-resize;
    z-index: 10;
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
}

.slider-handle-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.slider-handle-icon::after {
    content: '↔';
    font-size: 18px;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.25);
    pointer-events: none;
}
/* Preloader / Splash Screen */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 10001; /* Higher than image viewer and modals */
    background-color: #00aca8;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.7s ease, visibility 0.7s ease;
    opacity: 1;
    visibility: visible;
}

.preloader.is-hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.preloader-logo {
    width: 75%;
    max-width: 160px;
    filter: brightness(0) invert(1); /* Makes the SVG white */
}

.preloader-svg {
    position: absolute;
    width: 220px;
    height: 220px;
    transform: rotate(-90deg); /* Start from the top */
}

.preloader-circle-track,
.preloader-circle-progress {
    fill: none;
    stroke-width: 4;
}

.preloader-circle-track {
    stroke: rgba(255, 255, 255, 0.2);
    stroke-dasharray: 4, 6; /* Dashed track line */
}

.preloader-circle-progress {
    stroke: #ffffff;
    stroke-linecap: round;
    stroke-dasharray: 339.29; /* Circumference for r=54 (2 * PI * 54) */
    stroke-dashoffset: 339.29;
    animation: preloader-draw 2s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes preloader-draw {
    to {
        stroke-dashoffset: 0;
    }
}
