/* =============================================================================
   shell.css  —  Site chrome (header + drawer + footer) for the dark theme.
   Loaded on every public page after tokens.css.
   Sections:
     1. Header (sticky bar + brand + nav + actions)
     2. Mobile drawer
     3. Footer (links + cards + support + bottom)
   ========================================================================== */

/* =============================================================================
   1. SITE HEADER
   ----
   Sticky translucent navy bar with backdrop blur and a thin gold underline.
   ========================================================================== */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background:
        linear-gradient(180deg, rgba(12, 17, 36, .85) 0%, rgba(12, 17, 36, .75) 100%);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-bottom: 1px solid rgba(255, 194, 24, .10);
    box-shadow:
        0 1px 0 0 rgba(255, 255, 255, .04) inset,
        0 8px 24px rgba(0, 0, 0, .20);
}

/* hairline gold gradient at the bottom edge */
.site-header::after {
    content: ""; position: absolute;
    bottom: -1px; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 194, 24, 0)   15%,
        rgba(255, 194, 24, .45) 50%,
        rgba(255, 194, 24, 0)   85%,
        transparent 100%);
    pointer-events: none;
}

.topbar { padding: 14px 0 12px; }
.topbar-inner {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.topbar-brand {
    display: flex; align-items: center; gap: 18px; min-width: 0;
}

/* — Hamburger (mobile only) — */
.topbar-menu-btn {
    display: none; width: 40px; height: 40px; border-radius: 12px;
    background: var(--surface-2); border: 1px solid var(--line-strong);
    color: var(--ink-white); font-size: 1.2rem;
    align-items: center; justify-content: center;
    cursor: pointer; transition: all var(--t-fast);
}
.topbar-menu-btn:hover {
    border-color: var(--gold-line);
    color: var(--gold-300);
    background: var(--surface-gold);
}

/* — Brand / logo — */
.brand { position: relative; display: inline-flex; align-items: center; }
.brand .logo {
    position: relative; display: inline-block;
    transition: transform var(--t-fast);
}
.brand .logo:hover { transform: translateY(-1px); }
.brand .logo::before {
    content: ""; position: absolute; inset: -8px;
    
    opacity: 0; transition: opacity var(--t);
    pointer-events: none; z-index: -1;
}
.brand .logo:hover::before { opacity: 1; }
.brand .logo img,
.brand .logo .logo__img {
    height: 40px; width: auto;
}
/* Drop-shadow only on dark theme — looks heavy on light backgrounds. */
.brand .logo .logo__img--dark {
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .30));
}
.brand .logo .logo__img--light {
    display: none;
}
[data-theme="light"] .brand .logo .logo__img--dark  { display: none; }
[data-theme="light"] .brand .logo .logo__img--light { display: block; filter: none; }

/* — Inline nav (desktop only, single row next to brand) — */
.topbar-nav {
    display: flex; align-items: center; gap: 4px;
    flex-wrap: nowrap; overflow-x: auto;
    scrollbar-width: none; -ms-overflow-style: none;
}
.topbar-nav::-webkit-scrollbar { display: none; }

.nav-item {
    position: relative;
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 14px; border-radius: 10px;
    color: var(--ink-soft); font-weight: 600; font-size: .86rem;
    transition: all var(--t-fast); white-space: nowrap;
    border: 1px solid transparent;
}
.nav-item::after {
    content: ""; position: absolute;
    bottom: 2px; left: 50%; transform: translateX(-50%);
    width: 0; height: 2px; border-radius: 1px;
    background: linear-gradient(90deg, var(--gold-300), var(--gold-500));
    transition: width var(--t);
}
.nav-item:hover {
    color: var(--gold-300);
    background: rgba(255, 194, 24, .04);
}
.nav-item:hover::after { width: 24px; }
.nav-item.is-active {
    color: var(--gold-300);
    background: rgba(255, 194, 24, .06);
}
.nav-item.is-active::after { width: 24px; }
.nav-item i { font-size: 1.05em; opacity: .85; }

/* — Right-side actions (guide + account) — */
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-actions .btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 18px; border-radius: var(--r-pill);
    font-weight: 700; font-size: .88rem;
    transition: all var(--t-fast); cursor: pointer; white-space: nowrap;
    text-decoration: none;
}

.btn-guide {
    background: var(--surface-2);
    border: 1.5px solid var(--line-strong);
    color: var(--ink-white);
    backdrop-filter: blur(8px);
}
.btn-guide:hover {
    transform: translateY(-1px);
    border-color: var(--gold-line);
    color: var(--gold-300);
    background: var(--surface-gold);
}

.btn-account {
    background: linear-gradient(135deg, var(--gold-300), var(--gold-500) 50%, var(--gold-600));
    color: #0c1124;
    border: none;
    box-shadow: var(--shadow-gold);
    position: relative;
    overflow: hidden;
}
.btn-account::before {
    content: ""; position: absolute;
    top: 0; bottom: 0; left: -85%; width: 50%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
    transform: skewX(-22deg); transition: left .85s ease;
    pointer-events: none;
}
.btn-account:hover { transform: translateY(-2px); }
.btn-account:hover::before { left: 130%; }
.btn-account i { font-size: 1.05em; }

/* — Optional second-row menubar (used by home page only) — */
.menubar {
    border-top: 1px solid rgba(255, 255, 255, .04);
    padding: 6px 0;
    background: rgba(255, 255, 255, .015);
}
.menubar-inner { display: flex; align-items: center; }
.nav-menu {
    display: flex; align-items: center; flex-wrap: nowrap; gap: 4px;
    overflow-x: auto;
    scrollbar-width: none; -ms-overflow-style: none;
}
.nav-menu::-webkit-scrollbar { display: none; }

/* — Header responsive — */
@media (max-width: 980px) {
    .topbar-nav { display: none; }
    .menubar { display: none; }
    .topbar-menu-btn { display: inline-flex; }
    .btn-guide .btn-text,
    .btn-account .btn-text { display: none; }
    .topbar-actions .btn {padding: 6px 11px 5px 11px;}
    .topbar-actions .btn i { font-size: 1.1em; }
}
@media (max-width: 480px) {
    .brand .logo img,
    .brand .logo .logo__img { height: 34px; }
    .topbar { padding: 12px 0 10px; }
    .topbar-brand { gap: 10px; }
}

/* =============================================================================
   1.b THEME TOGGLE BUTTON
   ----
   A small icon-only button (sun/moon) that flips light/dark.
   Lives next to the action buttons; persists choice in localStorage.
   ========================================================================== */
.theme-toggle-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px;
    border-radius: 12px;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    color: var(--ink-white);
    cursor: pointer;
    font-size: 1.05rem;
    transition: all var(--t-fast);
    position: relative;
    overflow: hidden;
}
.theme-toggle-btn:hover {
    border-color: var(--gold-line);
    color: var(--gold-300);
    background: var(--surface-gold);
}
.theme-toggle-btn .bi-sun-fill,
.theme-toggle-btn .bi-moon-stars-fill {
    position: absolute;
    transition: opacity var(--t), transform var(--t);
}
/* default (dark mode): show SUN — clicking switches to light */
.theme-toggle-btn .bi-sun-fill        { opacity: 1; transform: rotate(0); color: var(--gold-300); }
.theme-toggle-btn .bi-moon-stars-fill { opacity: 0; transform: rotate(-90deg); }

/* light mode: show MOON — clicking switches to dark */
[data-theme="light"] .theme-toggle-btn .bi-sun-fill        { opacity: 0; transform: rotate(90deg); }
[data-theme="light"] .theme-toggle-btn .bi-moon-stars-fill { opacity: 1; transform: rotate(0); color: var(--navy-700); }

@media (max-width: 480px) {
    .theme-toggle-btn { width: 36px; height: 36px; font-size: 1rem; }
}

/* =============================================================================
   1.c LIGHT-MODE OVERRIDES  for the header
   ========================================================================== */
[data-theme="light"] .site-header {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .85) 0%, rgba(255, 255, 255, .75) 100%);
    border-bottom: 1px solid rgba(255, 194, 24, .25);
    box-shadow:
        0 1px 0 0 rgba(255, 255, 255, .8) inset,
        0 8px 24px rgba(28, 36, 71, .08);
}
[data-theme="light"] .site-header::after {
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 194, 24, 0)   15%,
        rgba(255, 194, 24, .55) 50%,
        rgba(255, 194, 24, 0)   85%,
        transparent 100%);
}
[data-theme="light"] .topbar-menu-btn,
[data-theme="light"] .theme-toggle-btn {
    background: rgba(28, 36, 71, .04);
    color: var(--navy-700);
}
[data-theme="light"] .topbar-menu-btn:hover,
[data-theme="light"] .theme-toggle-btn:hover {
    background: var(--surface-gold);
    color: var(--gold-700);
    border-color: var(--gold-line);
}
[data-theme="light"] .nav-item { color: var(--navy-700); }
[data-theme="light"] .nav-item:hover { color: var(--gold-700); }
[data-theme="light"] .btn-guide {
    background: rgba(28, 36, 71, .04);
    color: var(--navy-700);
}
[data-theme="light"] .btn-guide:hover {
    background: var(--surface-gold);
    color: var(--gold-700);
}
/* btn-account stays gold in both modes — already perfect */

/* =============================================================================
   2. MOBILE DRAWER
   ========================================================================== */
.site-drawer {
    position: fixed; inset: 0; z-index: 200;
}
.site-drawer[hidden] { display: none; }

.drawer-backdrop {
    position: absolute; inset: 0;
    background: rgba(7, 10, 22, .72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0; transition: opacity var(--t);
}
.site-drawer.is-open .drawer-backdrop { opacity: 1; }

.drawer-panel {
    position: absolute; top: 0; right: 0; bottom: 0;
    width: min(86%, 360px);
    background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-950) 100%);
    border-left: 1px solid var(--line);
    padding: 24px;
    overflow-y: auto;
    box-shadow: -30px 0 70px rgba(0, 0, 0, .55);
    transform: translateX(20px); opacity: 0;
    transition: transform var(--t-slow), opacity var(--t-slow);
}
[data-theme="light"] .drawer-panel {background: #fff;}
.site-drawer.is-open .drawer-panel {
    transform: translateX(0); opacity: 1;
}

.drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 22px; padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}
.drawer-title {
    font-weight: 800; color: var(--ink-white); font-size: 1rem;
}

.drawer-close {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--surface-2); border: 1px solid var(--line-strong);
    color: var(--ink-white);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all var(--t-fast);
}
.drawer-close:hover {
    color: var(--gold-300);
    border-color: var(--gold-line);
}

.drawer-nav {
    display: flex; flex-direction: column; gap: 6px;
}
.drawer-link {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; border-radius: 12px;
    background: rgba(255, 255, 255, .02);
    border: 1px solid var(--line);
    color: var(--ink-soft); font-weight: 600; font-size: .92rem;
    transition: all var(--t-fast);
    text-decoration: none;
}
.drawer-link:hover {
    color: var(--gold-300);
    border-color: var(--gold-line);
    background: rgba(255, 194, 24, .05);
    transform: translateX(-3px);
}
.drawer-link i { font-size: 1.05em; opacity: .85; }

.drawer-sep {
    border: none;
    border-top: 1px solid var(--line);
    margin: 14px 0 8px;
}

html.drawer-open { overflow: hidden; }

/* =============================================================================
   3. SITE FOOTER
   ========================================================================== */
.site-footer {
    position: relative;
    padding: 60px 0 30px;
    background: linear-gradient(180deg, var(--navy-deep) 0%, var(--navy-950) 50%, #07091a 100%);
    border-top: 1px solid var(--line);
    overflow: hidden;
    margin-top: 80px;
}
.site-footer::before {
    content: ""; position: absolute;
    top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold-500), transparent);
    opacity: .5;
}

/* — Top grid: link columns (right) + aside cards (left) — */
.footer-grid {
    display: grid; grid-template-columns: 2fr 1fr; gap: 50px;
    margin-bottom: 40px;
}
@media (max-width: 880px) {
    .footer-grid { grid-template-columns: 1fr; gap: 30px; }
}

.footer-cols {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px;
}
@media (max-width: 560px) {
    .footer-cols { grid-template-columns: 1fr; }
}

.footer-title {
    font-size: .92rem; font-weight: 800;
    color: var(--ink-white);
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    position: relative;
}
.footer-title::after {
    content: ""; position: absolute; bottom: -1px; right: 0;
    width: 30px; height: 2px;
    background: linear-gradient(90deg, var(--gold-500), transparent);
}

.footer-links {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: 8px;
}
.footer-links li a {
    color: var(--ink-soft); font-size: .86rem; font-weight: 500;
    transition: all var(--t-fast);
    display: inline-block;
    text-decoration: none;
}
.footer-links li a:hover {
    color: var(--gold-300);
    transform: translateX(-3px);
}

.footer-links-social {
    flex-direction: row; flex-wrap: wrap; gap: 8px;
}
.footer-links-social li a {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    transition: all var(--t-fast);
}
.footer-links-social li a:hover {
    transform: translateY(-2px);
    border-color: var(--gold-line);
    background: var(--surface-gold);
}
.footer-links-social i {
    color: var(--ink-white) !important;
    font-size: 1.1rem !important;
    transition: color var(--t-fast);
}
.footer-links-social a:hover i {
    color: var(--gold-300) !important;
}

/* — ENAMAD trust seal slot — */
.footer-trust {
    margin-top: 24px;
    padding: 12px;
    background: var(--surface-1);
    border: 1px solid var(--line);
    border-radius: 12px;
    display: inline-block;
}
.footer-trust img {
    border-radius: 8px;
    max-width: 110px;
    height: auto;
}

/* — Footer aside (clickable cards) — */
.footer-aside {
    display: flex; flex-direction: column; gap: 14px;
}
.footer-card {
    position: relative;
    padding: 18px 20px; border-radius: 14px;
    background: var(--surface-1);
    border: 1px solid var(--line);
    color: var(--ink-soft);
    transition: all var(--t-fast);
    display: flex; align-items: center; gap: 14px;
    text-decoration: none;
}
.footer-card:hover {
    border-color: var(--gold-line);
    background: rgba(255, 194, 24, .04);
    transform: translateX(-3px);
}
.footer-card-arrow {
    position: absolute; top: 14px; left: 14px;
    color: var(--gold-300);
    opacity: 0; transition: all var(--t-fast);
}
.footer-card:hover .footer-card-arrow { opacity: 1; }
.footer-card-text { flex: 1; }
.footer-card-title {
    font-size: .92rem; font-weight: 800;
    color: var(--ink-white);
    margin-bottom: 4px;
}
.footer-card-sub {
    font-size: .78rem;
    color: var(--ink-muted);
}
.footer-card i {
    font-size: 1.5rem;
    color: var(--gold-400);
    flex-shrink: 0;
}

/* — Support strip (phone + ticket button) — */
.footer-support {
    display: flex; align-items: center; justify-content: space-between;
    padding: 24px 0; gap: 18px; flex-wrap: wrap;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    margin-bottom: 24px;
}
.support-phone {
    font-size: 1.6rem; font-weight: 900;
    color: var(--gold-300);
    letter-spacing: .04em;
    margin: 0;
}
.support-sub {
    font-size: .82rem; color: var(--ink-muted); font-weight: 500;
    margin-top: 4px;
}
.footer-ticket {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 13px 26px; border-radius: var(--r-pill);
    background: linear-gradient(135deg, var(--gold-300), var(--gold-500));
    color: var(--navy-900) !important; font-weight: 800;
    box-shadow: var(--shadow-gold);
    transition: all var(--t-fast);
    border: none; text-decoration: none;
}
.footer-ticket:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(255, 194, 24, .40);
}

/* — Footer bottom (brand + meta) — */
.footer-bottom {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 14px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}
.footer-brand-name {
    font-weight: 900; color: var(--ink-white);
    font-size: .95rem;
    font-family: var(--ff-display);
}
.footer-meta {
    display: flex; align-items: center; gap: 8px;
}
.footer-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--gold-500);
    box-shadow: 0 0 10px rgba(255, 194, 24, .50);
}
.footer-meta .muted {
    color: var(--ink-faint);
    font-size: .78rem;
}

@media (max-width: 560px) {
    .site-footer { padding: 48px 0 24px; }
    .footer-support { padding: 20px 0; }
    .support-phone { font-size: 1.35rem; }
    .footer-bottom { justify-content: center; text-align: center; }
}

/* =============================================================================
   3.b LIGHT-MODE OVERRIDES  for footer + drawer
   ========================================================================== */
[data-theme="light"] .site-footer {
    background: linear-gradient(180deg, #f7f9fc 0%, #eef0fa 50%, #e6ebf5 100%);
    border-top: 1px solid rgba(28, 36, 71, .12);
}
[data-theme="light"] .footer-card,
[data-theme="light"] .footer-trust {
    background: rgba(255, 255, 255, .8);
    border-color: rgba(28, 36, 71, .10);
}
[data-theme="light"] .footer-card:hover {
    background: var(--surface-gold);
    border-color: var(--gold-line);
}
[data-theme="light"] .footer-links-social li a {
    background: rgba(28, 36, 71, .04);
    border-color: rgba(28, 36, 71, .14);
}
[data-theme="light"] .footer-links-social i { color: var(--navy-700) !important; }
[data-theme="light"] .footer-links-social a:hover i { color: var(--gold-700) !important; }
[data-theme="light"] .support-phone { color: var(--gold-700); }
[data-theme="light"] .footer-dot {
    background: var(--gold-500);
    box-shadow: 0 0 10px rgba(255, 194, 24, .35);
}

/* Drawer keeps its dark navy look on light mode — intentional contrast,
   matches iOS / Material patterns (modal sheets are darker than the page). */
[data-theme="light"] .drawer-backdrop {
    background: rgba(28, 36, 71, .35);
}

/* ============== LIGHT THEME — explicit footer text colors ============== */
[data-theme="light"] .footer-title,
[data-theme="light"] .footer-card-title,
[data-theme="light"] .footer-brand-name { color: var(--navy-900); }

[data-theme="light"] .footer-links li a,
[data-theme="light"] .footer-card-sub,
[data-theme="light"] .support-sub,
[data-theme="light"] .footer-meta { color: rgba(28, 36, 71, .72); }

[data-theme="light"] .footer-links li a:hover { color: var(--gold-700); }

[data-theme="light"] .footer-card { color: var(--navy-900); }
[data-theme="light"] .footer-card i { color: var(--gold-700); }

[data-theme="light"] .footer-support {
    border-top-color: rgba(28, 36, 71, .10);
    border-bottom-color: rgba(28, 36, 71, .10);
}
[data-theme="light"] .footer-bottom { border-top-color: rgba(28, 36, 71, .10); }
[data-theme="light"] .footer-title { border-bottom-color: rgba(28, 36, 71, .12); }