﻿/* ===================================
   ANTOLOGA NAVBAR
   Prefix: nb-
   Mobile-first: base = traveler chrome (≤1280);
   desktop auth/icons from min-width: 1281px (Mud Lg).
   =================================== */

/* MudAppBar root override */
header.mud-appbar.nb {
    background-color: transparent !important;
    height: 6rem !important;
    min-height: 6rem !important;
    padding: 0 1.5rem !important;
    position: relative !important;
    width: 100%;
    z-index: 1000;
    justify-content: center;
}

header.mud-appbar.nb--dark {
    background-color: var(--antologa-dark) !important;
}

/* ---- Logo ---- */
.nb-logo {
    width: 8rem;
    height: auto;
    cursor: pointer;
    flex-shrink: 0;
}

/* ---- Desktop Icons (hidden until lg+) ---- */
.nb-desktop-icons {
    display: none;
    flex-direction: row;
    align-items: center;
    gap: 0.25rem;
}

.nb-icon {
    height: 3rem;
    border-radius: 0.5rem;
    color: var(--antologa-dark) !important;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nb--dark .nb-icon {
    color: var(--antologa-white) !important;
}

@media (hover: hover) {
    .nb-icon:hover {
        background-color: var(--antologa-dark) !important;
        color: var(--antologa-white) !important;
    }

    .nb--dark .nb-icon:hover {
        background-color: var(--antologa-white) !important;
        color: var(--antologa-primary) !important;
    }
}

.nb-icon--active {
    color: var(--antologa-primary) !important;
    background-color: color-mix(in srgb, var(--antologa-primary) 12%, transparent) !important;
}

.nb--dark .nb-icon--active {
    background-color: color-mix(in srgb, var(--antologa-white) 14%, transparent) !important;
}

/* ---- Desktop Clock (Panama time) ---- */
.nb-desktop-clock {
    display: none;
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
    margin-left: 0.75rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--antologa-dark) 12%, transparent);
    white-space: nowrap;
    pointer-events: none;
}

.nb--dark .nb-desktop-clock {
    border-color: color-mix(in srgb, var(--antologa-white) 20%, transparent);
}

.nb-clock-dot {
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background-color: var(--antologa-primary);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--antologa-primary) 55%, transparent);
    animation: nb-clock-pulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

.nb-clock-time {
    font-variant-numeric: tabular-nums;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02rem;
    color: var(--antologa-dark);
}

.nb--dark .nb-clock-time {
    color: var(--antologa-white);
}

@keyframes nb-clock-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--antologa-primary) 45%, transparent);
    }
    50% {
        box-shadow: 0 0 0 0.3rem color-mix(in srgb, var(--antologa-primary) 0%, transparent);
    }
}

/* ---- Desktop Auth (hidden until lg+) ---- */
.nb-desktop-auth {
    display: none;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

/* Home beside Log In / Join — match auth control height, not center nav icons */
.nb-desktop-auth .nb-auth-home.nb-icon {
    width: 2.25rem !important;
    min-width: 2.25rem !important;
    height: 2.25rem !important;
    padding: 0 !important;
}

.nb-desktop-auth .nb-auth-home .mud-icon-root {
    font-size: 1.15rem !important;
    width: 1.15rem !important;
    height: 1.15rem !important;
}

/* Language pill sits with auth controls; keep height aligned */
.nb-desktop-auth .lang-switcher__pill {
    height: 2.25rem;
}

.nb-btn-ghost {
    min-width: 9rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    letter-spacing: 0.05rem;
    color: var(--antologa-dark) !important;
    transition: all 0.2s ease;
}

.nb--dark .nb-btn-ghost {
    color: var(--antologa-white) !important;
}

@media (hover: hover) {
    .nb-btn-ghost:hover {
        background-color: var(--antologa-dark) !important;
        color: var(--antologa-white) !important;
    }

    .nb--dark .nb-btn-ghost:hover {
        background-color: var(--antologa-white) !important;
        color: var(--antologa-primary) !important;
    }
}

.nb-btn-solid {
    min-width: 9rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    letter-spacing: 0.05rem;
    background-color: var(--antologa-primary) !important;
    color: var(--antologa-white) !important;
    transition: all 0.2s ease;
}

@media (hover: hover) {
    .nb-btn-solid:hover {
        background-color: var(--antologa-dark) !important;
        color: var(--antologa-white) !important;
    }

    .nb--dark .nb-btn-solid:hover {
        background-color: var(--antologa-white) !important;
        color: var(--antologa-primary) !important;
    }
}

/* ---- Mobile Auth Icons (default on) ---- */
.nb-mobile-auth {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.nb-mobile-icon-btn {
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.nb-mobile-icon-btn--solid {
    background-color: var(--antologa-primary) !important;
    color: var(--antologa-white) !important;
}

/* ---- Mobile Bottom Nav (default on; hidden at lg+) ---- */
.nb-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    /* Own height token so a missing/0 cascade never collapses the bar to 0 */
    --nb-bar-height: 5rem;
    height: calc(var(--nb-bar-height) + var(--bottom-nav-safe, 0px));
    width: 100%;
    /* Always above mobile sheets/drawers (search 900, wonders ≤1100); below help FAB (1300) */
    z-index: 1200;
    background-color: var(--antologa-white);
    border-top: 1px solid var(--antologa-light-gray);
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    padding: 0.375rem 0 var(--bottom-nav-safe, 0px);
    box-shadow: 0 -1px 6px rgba(0, 0, 0, 0.04);
}

.nb-bottom-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    flex: 1;
    max-width: 5rem;
    min-height: 2.75rem; /* ≥44px tap target */
    height: 100%;
    padding: 0.25rem 0.5rem;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* MudButton nests the icon + label inside .mud-button-label — force it to
   stack vertically so the icon sits ON TOP of the label, not inline beside it. */
.nb-bottom-item .mud-button-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.nb-bottom-item .mud-icon-root {
    color: var(--antologa-gray-550);
    font-size: 1.6rem !important;
    width: 1.6rem;
    height: 1.6rem;
    transition: color 0.2s ease;
}

.nb-bottom-item .mud-typography {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--antologa-gray-550);
    transition: color 0.2s ease;
    margin-top: 0.15rem;
    line-height: 1;
}

@media (hover: hover) {
    .nb-bottom-item:hover .mud-icon-root,
    .nb-bottom-item:hover .mud-typography {
        color: var(--antologa-primary);
    }
}

.nb-bottom-item--active .mud-icon-root {
    color: var(--antologa-primary);
}

.nb-bottom-item--active .mud-typography {
    color: var(--antologa-primary);
    font-weight: 700;
}

/* ===================================
   DESKTOP — min-width 1281px (Mud Lg+)
   =================================== */
@media (min-width: 1281px) {
    header.mud-appbar.nb {
        padding: 0 2rem !important;
    }

    .nb-logo {
        width: 10rem;
    }

    .nb-desktop-icons,
    .nb-desktop-auth,
    .nb-desktop-clock {
        display: flex;
    }

    .nb-mobile-auth {
        display: none;
    }

    .nb-bottom-nav {
        display: none;
    }
}

/* ===================================
   Compact phone chrome (≤600 / Mud Sm)
   =================================== */
@media (max-width: 600px) {
    header.mud-appbar.nb {
        padding: 0 0.75rem !important;
    }

    .nb-logo {
        width: 7rem;
    }

    .nb-bottom-nav {
        --nb-bar-height: 4.5rem;
    }

    .nb-bottom-item {
        max-width: 4.5rem;
        padding: 0.25rem 0.25rem;
    }

    .nb-bottom-item .mud-typography {
        font-size: 0.7rem; /* keep readable; do not go below ~11px */
    }
}
