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

html, body {
    height: 100%;
    font-family: 'Exo', sans-serif !important; /* Force Exo font */
    overflow: auto; /* Enable scrolling when content overflows */
}

/* RTL Support for Arabic */
html[dir="rtl"] body {
    font-family: 'Tajawal', 'Exo', sans-serif !important;
}

html[dir="rtl"] .info-content {
    text-align: center; /* Keep center for both languages */
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100%; /* Take at least full height, can grow if needed */
}

/* Navbar - Mobile-first */
.navbar {
    width: 100%;
    background: #F2FBFD; /* Light cyan matching modal */
    padding: 0.3rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    direction: ltr; /* Always LTR regardless of page direction */
}

.navbar-logo {
    height: 40px;
    width: auto;
}

/* Language Toggle Button */
.language-toggle {
    margin-left: auto;
    background: none;
    color: #003057;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    transition: opacity 0.3s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
}

.language-toggle:hover {
    opacity: 0.7;
}


/* Information Section - Takes remaining space */
.info-section {
    flex: 1; /* Take remaining space in portrait */
    width: 100%;
    background: #003057;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 2rem 1rem;
}

.info-content {
    max-width: 800px;
    padding: 0 1rem;
    text-align: center;
    color: white;
}

.info-content h1 {
    font-size: 1.5rem; /* Smaller for mobile */
    font-weight: bold;
    margin-bottom: 1rem;
}

.info-content p {
    font-size: 1rem;
    opacity: 0.9;
}

/* Video Grid - Anchored to bottom, perfect grid with zero gaps */
.video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* ALWAYS 3x3 - never changes */
    gap: 0;
    width: 100%;
    flex-shrink: 0; /* Don't shrink the grid */
}

/* Video Container - Wraps video, overlay, and text */
.video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1; /* Square container */
    overflow: hidden;
    background: #000;
}

/* Video Items - Square aspect ratio */
.video-item {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Fill and crop if needed */
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

/* Dark Overlay */
.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2); /* 20% dark overlay */
    z-index: 1;
    pointer-events: none; /* Allow clicks to pass through */
}

/* Text Overlay */
.video-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    pointer-events: none; /* Allow clicks to pass through */
    width: 90%;
    word-wrap: break-word;
}

/* WhatsApp Contact Tile - Green background with icon */
.contact-tile {
    background: #25D366 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.whatsapp-icon {
    width: 50%;
    height: 50%;
    color: white;
}

/* Responsive text sizing */
@media (min-width: 640px) {
    .navbar-logo {
        height: 50px;
    }

    .info-content h1 {
        font-size: 2.5rem;
    }

    .info-content p {
        font-size: 1.25rem;
    }

    .video-text {
        font-size: 1.3rem;
    }
}


/* Landscape orientation - prevent info section from disappearing */
@media (orientation: landscape) {
    .info-section {
        flex: 0 0 auto; /* Don't grow/shrink, use content height */
        min-height: 150px; /* Minimum height in landscape */
    }

    .info-content h1 {
        font-size: 1.2rem;
    }

    .info-content p {
        font-size: 0.9rem;
    }
}

/* Larger screens - but keep 3x3 grid (desktop users use /d/ instead) */
@media (min-width: 1024px) {
    .navbar-logo {
        height: 60px;
    }

    .info-content h1 {
        font-size: 3rem;
    }

    .video-text {
        font-size: 1.5rem;
    }
}

/* Video Modal Styles */
.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-modal.active {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    opacity: 1;
}

/* Modal Navbar */
.modal-navbar {
    width: 100%;
    background: #F2FBFD; /* Light cyan matching main navbar */
    padding: 0;
    padding-left: 0.3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    direction: ltr; /* Always LTR regardless of page direction */
    height: 46px;
}

/* Modal Back Button */
.modal-back-btn {
    background: none;
    border: none;
    color: #003057;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
    height: 40px; /* Match navbar logo height */
    width: 40px;
}

.modal-back-btn:hover {
    opacity: 0.7;
}

.modal-back-btn svg {
    stroke: #003057;
    width: 24px;
    height: 24px;
}

/* Modal Contact Button - WhatsApp styled */
.modal-contact-btn {
    background: #25D366;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0 1rem;
    font-weight: bold;
    font-size: 0.9rem;
    transition: opacity 0.3s ease;
    font-family: inherit;
    height: 46px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0;
    margin: 0;
}

.modal-contact-btn:hover {
    opacity: 0.85;
}

.modal-contact-btn .fa-whatsapp {
    font-size: 1.4rem;
    color: white;
}

.modal-contact-text {
    display: inline;
}

/* Modal Content Container */
.modal-content {
    width: 100%;
    max-width: 1400px;
    height: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
}

/* Video Player Container */
.modal-video-container {
    width: 100%;
    background: #000;
    overflow: hidden;
    border-radius: 0;
    box-shadow: none;
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-video {
    width: 100%;
    height: 100%;
    display: block;
    max-height: none;
    object-fit: contain;
    transition: max-height 0.3s ease;
}

/* Expand/Collapse Toggle Bar */
.modal-expand-btn {
    width: 100%;
    padding: 0.5rem 1.25rem;
    background: #003057;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.modal-expand-btn:hover {
    background: #004070;
}

.expand-text {
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.modal-expand-btn svg {
    stroke: #fff;
    transition: transform 0.3s ease;
}

/* Rotate arrow up when expanded */
.video-modal.info-expanded .modal-expand-btn svg {
    transform: rotate(180deg);
}

/* Package Info Container */
.modal-info-container {
    width: 100%;
    flex: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    background: #F2FBFD;
    padding: 0 1.25rem;
    border-radius: 0;
    box-shadow: none;
    border-top: 2px solid rgba(0, 48, 87, 0.15);
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease, flex 0.3s ease;
}

/* Expanded State - Info Panel Visible */
.video-modal.info-expanded .modal-video-container {
    flex: 0 0 auto;
    height: 35vh;
}

.video-modal.info-expanded .modal-info-container {
    flex: 1;
    max-height: none;
    opacity: 1;
    padding: 1.5rem 1.25rem;
    overflow-y: auto;
}

.modal-info-content {
    color: #003057;
    max-width: 900px;
    margin: 0 auto;
}

/* Package Title */
.package-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #003057;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

/* Package Description */
.package-description {
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    color: #4a5568;
    font-weight: 400;
    text-align: justify;
    hyphens: auto;
}

/* Features Section */
.package-features {
    margin-top: 1.25rem;
}

.features-heading {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.65rem;
    color: #003057;
    letter-spacing: -0.01em;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.features-list li {
    padding: 0.5rem 0 0.5rem 2rem;
    position: relative;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #4a5568;
    text-align: justify;
    hyphens: auto;
}

.features-list li::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 0.6rem;
    color: white;
    font-size: 0.6rem;
    width: 1.1rem;
    height: 1.1rem;
    background: #60d9a8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

html[dir="rtl"] .features-list li {
    padding: 0.5rem 2rem 0.5rem 0;
}

html[dir="rtl"] .features-list li::before {
    left: auto;
    right: 0;
}

/* Responsive Modal Styles */
@media (min-width: 640px) {
    .modal-content {
        padding: 1rem;
    }

    .modal-video-container {
        border-radius: 12px 12px 0 0;
        box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.3);
    }

    .video-modal.info-expanded .modal-video-container {
        height: 38vh;
    }

    .video-modal.info-expanded .modal-info-container {
        padding: 2rem 1.75rem;
        border-radius: 0 0 12px 12px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    }

    .package-title {
        font-size: 1.75rem;
        margin-bottom: 1.25rem;
    }

    .package-description {
        font-size: 1.1rem;
        line-height: 1.75;
    }

    .features-heading {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }

    .features-list {
        gap: 0.4rem;
    }

    .features-list li {
        font-size: 1.05rem;
        padding: 0.55rem 0 0.55rem 2.25rem;
    }

    html[dir="rtl"] .features-list li {
        padding: 0.55rem 2.25rem 0.55rem 0;
    }
}

@media (min-width: 1024px) {
    .modal-content {
        padding: 1.5rem;
    }

    .modal-video-container {
        border-radius: 16px 16px 0 0;
    }

    .video-modal.info-expanded .modal-video-container {
        height: 40vh;
    }

    .video-modal.info-expanded .modal-info-container {
        padding: 2.5rem 2rem;
        border-radius: 0 0 16px 16px;
    }

    .package-title {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }

    .package-description {
        font-size: 1.15rem;
        line-height: 1.8;
        margin-bottom: 2rem;
    }

    .features-heading {
        font-size: 1.35rem;
        margin-bottom: 0.85rem;
    }

    .features-list {
        gap: 0.45rem;
    }

    .features-list li {
        font-size: 1.1rem;
        padding: 0.6rem 0 0.6rem 2.5rem;
    }

    html[dir="rtl"] .features-list li {
        padding: 0.6rem 2.5rem 0.6rem 0;
    }
}
