/* ============================================
   GLOBAL CSS — Explore Jordan Website
   Foundation styles, nav, footer, shared components
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

body:not(.home-page) .map-header,
body:not(.home-page) .accommodation-header,
body:not(.home-page) .calendar-header,
body:not(.home-page) .auth-brand,
body:not(.home-page) a[title="Home"].fixed,
body:not(.home-page) img[src$="assets/logo/logo.png"],
body:not(.home-page) img[src$="/assets/logo/logo.png"],
body:not(.home-page) div:has(> img[src$="assets/logo/logo.png"]),
body:not(.home-page) div:has(> img[src$="/assets/logo/logo.png"]) {
    display: none !important;
}

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    --font-en:        'Poppins', sans-serif;
    --font-ar:        'Thmanyah Arabic', 'Tahoma', 'Arial', sans-serif;
    --primary:       #B8844D;
    --primary-dark:  #8B6F47;
    --primary-light: #D4A574;
    --primary-pale:  #F5EDE3;
    --primary-accent:#BF6430;
    --bg-light:      #F8FAFC;
    --text-dark:     #1f1713;
    --text-muted:    #6b7280;
    --glass-bg:      rgba(255, 255, 255, 0.75);
    --glass-border:  rgba(255, 255, 255, 0.5);
    --shadow-sm:     0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md:     0 8px 32px rgba(0, 0, 0, 0.06);
    --shadow-lg:     0 16px 48px rgba(0, 0, 0, 0.1);
    --radius-sm:     12px;
    --radius-md:     20px;
    --radius-lg:     28px;
    --radius-full:   50px;
    --ease-spring:   cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth:   cubic-bezier(0.22, 1, 0.36, 1);
    --ease-out:      cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   GLOBAL RESET
   ============================================ */
*,
*::before,
*::after {
    font-family: var(--font-en);
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

html:not([data-language="ar"]) .ar {
    display: none !important;
}

html[data-language="ar"] .en {
    display: none !important;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    opacity: 0;
    animation: pageEnter 0.6s var(--ease-smooth) forwards;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.ar,
[lang="ar"] {
    font-family: var(--font-ar);
    direction: rtl;
    letter-spacing: 0;
}

.en,
[lang="en"] {
    font-family: var(--font-en);
}

.bilingual {
    display: inline-flex;
    flex-direction: column;
    align-items: inherit;
    gap: 0.08em;
}

.bilingual-block,
.bilingual-copy {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.bilingual-copy .ar,
.bilingual-block .ar {
    color: inherit;
    line-height: 1.9;
}

.ar-muted {
    color: var(--text-muted);
}

.legal-page .glass-panel {
    text-align: start;
}

.legal-pair {
    margin-bottom: 1.35rem;
}

.legal-pair .en {
    color: #555;
    line-height: 1.85;
}

.legal-pair .ar {
    color: #4f4f4f;
    line-height: 2;
    font-size: 1.05em;
}

.bilingual-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.bilingual-list li .ar {
    display: block;
    margin-top: 0.15rem;
}

.policy-list li .ar,
.term-list li .ar,
.faq-content li .ar {
    display: block;
    margin-top: 0.18rem;
}

.language-selector {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 2000;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1), 0 1px 4px rgba(184, 132, 77, 0.08);
}

.language-option {
    min-width: 42px;
    height: 32px;
    padding: 0 11px;
    border: 0;
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    pointer-events: auto;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.language-option[data-lang="ar"] {
    font-family: var(--font-ar);
    font-size: 15px;
}

.language-option[data-lang="en"] {
    min-width: 68px;
}

.language-option.is-active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 6px 18px rgba(184, 132, 77, 0.28);
}

html[dir="rtl"] .language-selector {
    direction: ltr;
}

body.exiting {
    animation: pageExit 0.3s ease forwards;
    pointer-events: none;
}

/* ============================================
   PAGE TRANSITIONS
   ============================================ */
@keyframes pageEnter {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pageExit {
    from {
        opacity: 1;
        filter: blur(0);
    }
    to {
        opacity: 0;
        filter: blur(3px);
    }
}

/* ============================================
   GLASS PANEL
   ============================================ */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

@media (min-width: 768px) {
    .glass-panel {
        border-radius: 32px;
    }
}

@media (min-width: 768px) {
    .language-selector {
        top: 24px;
        right: 24px;
    }
}

/* ============================================
   FLOATING LOGO — TOP LEFT (all screens)
   ============================================ */
.floating-logo {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1), 0 1px 4px rgba(184, 132, 77, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.65);
    transition: all 0.35s var(--ease-spring);
    cursor: pointer;
}

.floating-logo:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(184, 132, 77, 0.18);
    background: rgba(255, 255, 255, 0.95);
}

.floating-logo img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 6px;
    flex-shrink: 0;
}

.floating-logo-text {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    letter-spacing: -0.2px;
}

@media (max-width: 380px) {
    .floating-logo {
        padding: 8px 12px;
    }
    .floating-logo-text {
        display: none;
    }
}

@media (min-width: 768px) {
    .floating-logo {
        top: 24px;
        left: 24px;
        padding: 10px 20px;
        gap: 10px;
    }
    .floating-logo img {
        width: 30px;
        height: 30px;
    }
    .floating-logo-text {
        font-size: 14px;
    }
}

/* ============================================
   FLOATING NAV — BOTTOM RIGHT (all screens)
   About & Contact buttons
   ============================================ */
.floating-nav {
    position: fixed;
    bottom: 18px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 8px 10px;
    border-radius: var(--radius-full);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(184, 132, 77, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.65);
}

nav[aria-label="Site Navigation"].fixed {
    left: 50%;
    right: auto;
    translate: -50% 0;
    max-width: calc(100vw - 20px);
    overflow-x: auto;
}

nav[aria-label="Site Navigation"].fixed > * {
    flex: 0 0 auto;
}

.unified-site-nav {
    position: fixed;
    left: 50%;
    right: auto;
    bottom: 18px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: calc(100vw - 20px);
    overflow: visible;
    translate: -50% 0;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(184, 132, 77, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.unified-nav-btn {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    padding: 8px 12px;
    border-radius: 999px;
    color: #b8844d;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 180ms ease, background 180ms ease;
}

.unified-nav-btn:hover {
    transform: translateY(-1px);
    background: rgba(184, 132, 77, 0.1);
}

.unified-nav-btn.is-active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 6px 20px rgba(184, 132, 77, 0.26);
}

.unified-nav-btn .material-icons {
    font-size: 18px;
}

.unified-nav-menu {
    position: relative;
    flex: 0 0 auto;
}

.unified-nav-menu::before {
    content: "";
    position: absolute;
    left: -10px;
    right: -10px;
    bottom: 100%;
    height: 16px;
}

.unified-nav-trigger {
    border: 0;
}

.unified-nav-trigger .nav-caret {
    margin-left: -3px;
    font-size: 16px;
}

.unified-nav-dropdown {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    z-index: 1010;
    min-width: 218px;
    display: grid;
    gap: 5px;
    padding: 8px;
    border: 1px solid rgba(184, 132, 77, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 16px 44px rgba(31, 23, 19, 0.16);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 8px);
    transition: opacity 170ms ease, transform 170ms ease;
}

.unified-nav-menu:hover .unified-nav-dropdown,
.unified-nav-menu:focus-within .unified-nav-dropdown {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.unified-dropdown-item {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.unified-dropdown-item:hover,
.unified-dropdown-item.is-active {
    background: rgba(184, 132, 77, 0.12);
    color: var(--primary-accent);
}

.unified-dropdown-item .material-icons {
    color: var(--primary);
    font-size: 19px;
}

.unified-nav-separator {
    width: 1px;
    height: 20px;
    flex: 0 0 auto;
    background: rgba(184, 132, 77, 0.2);
}

@media (min-width: 768px) {
    .unified-site-nav {
        bottom: 28px;
        gap: 8px;
        padding: 9px 14px;
    }
}

@media (max-width: 520px) {
    .unified-site-nav {
        overflow-x: auto;
        overflow-y: hidden;
    }

    .unified-nav-dropdown {
        left: auto;
        right: 0;
        min-width: 204px;
        transform: translate(0, 8px);
    }

    .unified-nav-menu:hover .unified-nav-dropdown,
    .unified-nav-menu:focus-within .unified-nav-dropdown {
        transform: translate(0, 0);
    }
}

@media (min-width: 768px) {
    .floating-nav {
        bottom: 28px;
        gap: 8px;
        padding: 9px 14px;
    }
}

/* Individual nav button */
.fn-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
    color: var(--primary);
    transition: all 0.35s var(--ease-spring);
    white-space: nowrap;
    border: none;
    background: transparent;
    cursor: pointer;
}

.fn-btn .material-icons {
    font-size: 17px;
    flex-shrink: 0;
}

.fn-btn:hover {
    background: rgba(184, 132, 77, 0.1);
    color: var(--primary-dark);
    transform: translateY(-2px);
}

/* Active / current page state */
.fn-btn.fn-active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white !important;
    box-shadow: 0 6px 20px rgba(184, 132, 77, 0.35);
}

.fn-btn.fn-active .material-icons,
.fn-btn.fn-active span {
    color: white;
}

/* Divider */
.fn-divider {
    width: 1px;
    height: 20px;
    background: rgba(184, 132, 77, 0.2);
    flex-shrink: 0;
}

/* Mobile: hide labels on tiny screens */
@media (max-width: 380px) {
    .fn-btn {
        padding: 8px 10px;
    }
    .fn-btn-label {
        display: none;
    }
}

@media (min-width: 481px) {
    .fn-btn {
        font-size: 13px;
        gap: 7px;
    }
    .fn-btn .material-icons {
        font-size: 18px;
    }
}

@media (min-width: 768px) {
    .fn-btn {
        padding: 9px 18px;
        font-size: 13px;
    }
}

/* ============================================
   BADGE
   ============================================ */
.badge {
    display: inline-block;
    padding: 5px 14px;
    background: rgba(184, 132, 77, 0.1);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border: 1px solid rgba(184, 132, 77, 0.15);
}

/* ============================================
   DOWNLOAD BUTTONS (shared)
   ============================================ */
.download-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.store-button {
    background: #111;
    color: white;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: all 0.3s var(--ease-spring);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 50px;
    flex: 1;
    min-width: 148px;
    position: relative;
    overflow: hidden;
    justify-content: center;
}

.store-button:hover {
    background: #222;
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}

.store-button img {
    object-fit: contain;
    flex-shrink: 0;
}

.btn-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.btn-text .ar {
    text-align: right;
}

.btn-label {
    font-size: 9px;
    opacity: 0.75;
    text-transform: uppercase;
    line-height: 1;
}

.btn-name {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
}

.nav-copy {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    line-height: 1.08;
}

.nav-copy .ar {
    font-size: 0.92em;
}

@media (max-width: 380px) {
    .nav-copy.hidden {
        display: none !important;
    }
}

@media (min-width: 381px) {
    .nav-copy {
        display: inline-flex !important;
    }
}

@media (min-width: 768px) {
    .download-buttons {
        gap: 16px;
    }
    .store-button {
        padding: 11px 22px;
        min-width: 166px;
        flex: none;
        border-radius: 14px;
    }
    .btn-label {
        font-size: 10px;
    }
    .btn-name {
        font-size: 15px;
    }
}

/* ============================================
   MAIN CONTENT WRAPPER
   ============================================ */
.main-content-wrapper {
    background-color: var(--bg-light);
    min-height: 100vh;
    padding-bottom: 100px;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    padding: 28px 16px 16px;
    background: rgba(255, 255, 255, 0.04);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    text-align: center;
    margin-top: 48px;
    color: #999;
    font-size: 13px;
}

.footer-links {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 4px;
}

.footer-links a {
    color: #bbb;
    font-size: 12px;
    text-decoration: none;
    padding: 2px 8px;
    transition: color 0.2s ease;
}

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

.footer-links a + a::before {
    content: '\2022';
    margin-right: 12px;
    color: #ddd;
    pointer-events: none;
}

@media (min-width: 768px) {
    .site-footer {
        padding: 40px 20px 20px;
        margin-top: 64px;
        font-size: 14px;
    }
    .footer-links a {
        font-size: 13px;
    }
}

/* ============================================
   UTILITIES
   ============================================ */
.text-primary-desert {
    color: var(--primary);
}

.bg-primary-desert {
    background-color: var(--primary);
}

/* Accessibility */
:focus-visible {
    outline: 2.5px solid var(--primary);
    outline-offset: 3px;
    border-radius: 4px;
}

a,
button {
    transition: all 0.25s ease;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 7px;
}

::-webkit-scrollbar-track {
    background: #f0ede8;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}
