/* Shared site header, mobile slide-out menu, and mobile bottom-nav footer. */

/* ---------- Smooth cross-page navigation (View Transitions API) ----------
   Supported browsers cross-fade between pages instead of hard white-flashing.
   The header and bottom tab-bar get their own transition names so they stay
   anchored (app-shell feel) instead of fading with the page body. Ignored
   gracefully where unsupported. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.18s; }
.site-header { view-transition-name: site-header; }
.modern-footer { view-transition-name: mobile-tabbar; }
@media (prefers-reduced-motion: reduce) {
    @view-transition { navigation: none; }
}

:root {
    --primary-color: #034f5c;
    --text-color: #333;
    --light-gray: #f5f5f5;
    --white: #ffffff;
    --mobile-menu-width: 80%;
}

/* ---------- App promo banner (above header) ---------- */
/* Full-bleed strip; the inner row is constrained to the header width.
   No padding/height on the wrapper, so a hidden banner leaves no gap. */
.app-promo-wrap { width: 100%; }
.app-promo-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.app-promo-banner img { display: block; }

/* ---------- Site header ---------- */
.site-header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(3, 79, 92, 0.08);
    position: static;
    z-index: 500;
    border-bottom: 1px solid #eef1f5;
}
.site-header .header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.6rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.brand-logo img {
    height: 40px;
    width: auto;
    display: block;
}

/* ---------- Desktop navigation ---------- */
.desktop-nav {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.desktop-nav .dn-link {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: #1d2327;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: none;
    border: none;
    cursor: pointer;
}
.desktop-nav .dn-link i:not(.dn-caret) { color: #008080; font-size: 0.9rem; }
.desktop-nav .dn-link:hover { background: #f0fbfb; color: #008080; }

/* Help dropdown */
.dn-dropdown { position: relative; }
.dn-caret { font-size: 0.7rem !important; transition: transform 0.2s ease; margin-left: 1px; }
.dn-dropdown:hover .dn-caret { transform: rotate(180deg); }
.dn-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 230px;
    background: #fff;
    border: 1px solid #eef1f5;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(15, 35, 75, 0.12);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 600;
}
.dn-dropdown:hover .dn-dropdown-menu,
.dn-dropdown:focus-within .dn-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dn-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.8rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    color: #34455e;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.15s ease, color 0.15s ease;
}
.dn-dropdown-menu a i { color: #008080; width: 18px; text-align: center; }
.dn-dropdown-menu a:hover { background: #f0fbfb; color: #008080; }

/* My Account button */
.desktop-nav .dn-account {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    padding: 0.55rem 1.1rem;
    border-radius: 50px;
    margin-left: 0.5rem;
    background: linear-gradient(165deg, #008181, #006b6b);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.desktop-nav .dn-account:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 110, 110, 0.3);
    color: #fff;
}

@media (max-width: 900px) {
    .desktop-nav { display: none; }
}

/* ---------- Mobile menu button ---------- */
.mobile-menu-btn {
    display: none;
    position: relative;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--white);
    background-color: #055867;
    border-radius: 8px;
    z-index: 100;
    padding: 7px 13px;
    transition: transform 0.2s;
    font-family: 'Poppins', sans-serif;
}
.mobile-menu-btn:hover { transform: scale(1.05); }
@media (max-width: 900px) {
    .mobile-menu-btn { display: inline-block; }
}

/* ---------- Mobile slide-out navigation ---------- */
.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--mobile-menu-width);
    height: 100vh;
    background-color: var(--white);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    z-index: 3000;
    display: flex;
    flex-direction: column;
}
.mobile-nav.active { transform: translateX(0); }
.mobile-menu-header {
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.esimlogo { width: 150px; height: auto; }
.mobile-menu {
    list-style: none;
    flex-grow: 1;
    overflow-y: auto;
    padding: 0;
    margin-bottom: 0;
}
.mobile-menu li { border-bottom: 1px solid #eee; }
.mobile-menu a {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
}
.mobile-menu a i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
    color: var(--primary-color);
}
.mobile-menu-footer {
    padding: 1rem;
    border-top: 1px solid #eee;
    margin-top: auto;
    margin-bottom: 60px;
    display: none;
}
.logout-btn {
    display: block;
    width: 100%;
    padding: 0.75rem;
    background-color: var(--light-gray);
    border: none;
    border-radius: 4px;
    color: var(--text-color);
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    font-size: 0.9rem;
    font-family: 'Poppins', sans-serif;
    text-decoration: none;
}
.logout-btn i { margin-right: 8px; }
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.overlay.active { opacity: 1; visibility: visible; }
.close-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #055867 !important;
    background-color: white !important;
    padding: 0.5rem;
    margin: -0.5rem;
    transition: transform 0.2s;
    line-height: 1;
}
.close-btn:hover { transform: scale(1.1); }

/* ---------- Mobile bottom-nav footer ---------- */
.modern-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}
.bottom-nav {
    background: #ffffff;
    box-shadow: 0 -2px 8px rgb(0 0 0 / 13%);
    padding: 5px 0px 8px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.bottom-nav.hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}
.nav-menu {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    gap: 4px;
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #4a5568;
    font-size: 11px;
    font-weight: 500;
    padding: 6px 8px 4px;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
    z-index: 2;
    flex: 1;
    max-width: 70px;
    letter-spacing: 0.2px;
    box-sizing: border-box;
}
.nav-item:hover {
    color: #034f5c;
    background: rgba(3, 79, 92, 0.05);
}
.nav-item.active {
    color: #034f5c;
    font-weight: 600;
}
.nav-icon {
    margin-bottom: 2px;
    position: relative;
    transition: transform 0.2s ease;
    width: 22px;
    height: 22px;
}
.nav-icon svg { width: 100%; height: 100%; }
.nav-item:hover .nav-icon { transform: translateY(-1px); }
.nav-item.active .nav-icon { color: #008080; }
.nav-label {
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    transition: color 0.2s ease;
}
/* Active-tab underline is a pure-CSS pseudo-element on the active item, so it
   renders instantly with the server-marked active tab — no JS measurement, no
   flash/slide on each page load. The old floating .nav-indicator is retired. */
.nav-indicator { display: none; }
.nav-item.active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -8px;
    transform: translateX(-50%);
    width: 34px;
    height: 3px;
    background: #008080;
    border-radius: 2px 2px 0 0;
}
.logged-in-menu,
.logged-out-menu { display: none; }
.logged-in-menu.active,
.logged-out-menu.active { display: flex; }

@media (prefers-color-scheme: dark) {
    .bottom-nav {
        background: #ffffff;
        border-top-color: rgba(3, 79, 92, 0.3);
    }
    .nav-item { color: #616a76; }
    .nav-item:hover {
        color: #034f5c;
        background: rgba(3, 79, 92, 0.2);
    }
    .nav-item.active { color: #008080; }
    .nav-indicator { background: #008080; }
}

@media (min-width: 769px) {
    .modern-footer { display: none; }
}

/* ---------- Desktop footer (shown ≥769px only; mobile keeps the bottom nav) ---------- */
.desktop-footer { display: none; }

@media (min-width: 769px) {
    .desktop-footer {
        display: block;
        background: #034f5c;
        color: #a9cccc;
        margin-top: 0;
        font-family: 'Poppins', 'Segoe UI', sans-serif;
    }
    .df-inner {
        max-width: 1100px;
        margin: 0 auto;
        padding: 50px 24px 30px;
        display: grid;
        grid-template-columns: 2fr 1fr 1fr;
        gap: 40px;
    }
    .df-brand img { height: 38px; width: auto; margin-bottom: 16px; }
    .df-brand p {
        color: #9fc3c3;
        font-size: 14px;
        line-height: 1.65;
        max-width: 360px;
        margin: 0 0 18px;
    }
    .df-social { display: flex; gap: 12px; }
    .df-social a {
        width: 38px;
        height: 38px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        font-size: 15px;
        transition: background 0.2s ease, transform 0.2s ease;
    }
    .df-social a:hover { background: #008080; transform: translateY(-2px); }
    .df-col h4 {
        color: #ffffff;
        font-size: 15px;
        font-weight: 700;
        margin: 4px 0 14px;
    }
    .df-col a {
        display: block;
        color: #9fc3c3;
        text-decoration: none;
        font-size: 14px;
        padding: 6px 0;
        transition: color 0.2s ease;
    }
    .df-col a:hover { color: #ffffff; }
    .df-bottom {
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        max-width: 1100px;
        margin: 0 auto;
        padding: 18px 24px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        font-size: 13px;
        color: #7ea6a6;
    }
    .df-bottom a { color: #7ea6a6; text-decoration: none; transition: color 0.2s ease; }
    .df-bottom a:hover { color: #ffffff; }
}

@media (min-width: 769px) and (max-width: 860px) {
    .df-inner { grid-template-columns: 1fr 1fr; }
    .df-brand { grid-column: 1 / -1; }
}

/* Keep page content clear of the fixed bottom bar on mobile */
@media (max-width: 768px) {
    body { padding-bottom: 70px; }
}

@media (max-width: 380px) {
    .nav-item {
        padding: 4px 6px 2px;
        font-size: 9px;
    }
    .nav-label { font-size: 8px; }
    .nav-icon { width: 20px; height: 20px; }
    .nav-indicator { width: 35px; }
}

.nav-item[data-active="true"] .nav-icon { color: #008080; }
.nav-item, .nav-icon, .nav-label { transition: all 0.2s ease; }
