/* ═══ NAVIGATION — Header, mode switcher, mobile drawer, bottom nav ═══ */
/* ═══════════════════════════════════════════════════════════
   MODE-FIRST NAVIGATION — v7 (definitive)
   Layout: [Logo] [nav-center: ModeSwitcher + CtxLinks] → [NavActions]
   ═══════════════════════════════════════════════════════════ */

/* The nav-center wrapper keeps mode switcher and ctx links
   glued together as a unit. nav-actions sits at the far right. */
.nav-center {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;         /* fills the space between logo and actions */
    min-width: 0;
    margin-left: 1.5rem;
}

/* ── Mode Switcher ────────────────────────────────────── */
.mode-switcher {
    display: flex;
    align-items: center;
    gap: 1.8rem;
    flex-shrink: 0;
}

.mode-link {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    letter-spacing: 0.02em;
    white-space: nowrap;
    user-select: none;
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.18s, border-color 0.18s;
}
.mode-link:hover {
    color: rgba(255,255,255,0.85);
}
.mode-link--active {
    font-weight: 700;
}

/* ── Contextual links ─────────────────────────────────── */
.nav-ctx-links {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 0.1rem;
    margin: 0;
    padding: 0 0 0 0.5rem;
    /* left hairline separates mode switcher from page links */
    border-left: 1px solid rgba(255,255,255,0.1);
    margin-left: 0.75rem;
}
.nav-ctx-links--primary {
    border-left: none;
    margin-left: 1.5rem;
}

/* Compact mode switcher (right-aligned) */
.mode-switcher--compact {
    margin-left: auto;
    margin-right: 1rem;
}

/* Admin badge in community dropdown */
.dropdown-item-role-badge {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--mint);
    opacity: 0.7;
    margin-left: auto;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.nav-ctx-link {
    display: block;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.38rem 0.7rem;
    border-radius: 7px;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
    letter-spacing: -0.01em;
}
.nav-ctx-link:hover {
    color: rgba(255,255,255,0.95);
    background: rgba(255,255,255,0.08);
}

/* ── Public nav links ─────────────────────────────────── */
.nav-links--public {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 0;
    margin: 0 0 0 2rem;
    padding: 0;
    flex: 1;
}

/* ── Right-side nav actions ───────────────────────────── */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex-shrink: 0;
}
.nav-actions--public { gap: 0.5rem; }

/* Bell icon button */
.nav-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,0.4);
    width: 44px;
    height: 44px;
    border-radius: 10px;
    transition: color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}
.nav-icon-btn:hover {
    color: rgba(255,255,255,0.88);
    background: rgba(255,255,255,0.08);
}
.nav-icon-btn--unread { color: var(--brand-accent); }
.nav-icon-btn--unread:hover { color: #a3dcc4; background: rgba(117,201,167,0.1); }

/* Avatar */
.nav-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(117,201,167,0.4) 0%, rgba(117,201,167,0.12) 100%);
    border: 1.5px solid rgba(117,201,167,0.5);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
    padding: 0;
    margin-left: 0.2rem;
}
.nav-avatar:hover {
    border-color: rgba(117,201,167,0.85);
    background: radial-gradient(circle at 35% 35%, rgba(117,201,167,0.55) 0%, rgba(117,201,167,0.25) 100%);
    box-shadow: 0 0 0 3px rgba(117,201,167,0.18), 0 2px 8px rgba(0,0,0,0.25);
}
.nav-avatar-letter {
    color: #9ee8ca;
    font-weight: 800;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* ── Public Login / Sign Up ───────────────────────────── */
.nav-login-link {
    color: rgba(255,255,255,0.68);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.38rem 0.75rem;
    border-radius: 8px;
    transition: color 0.15s, background 0.15s;
}
.nav-login-link:hover { color: #fff; background: rgba(255,255,255,0.08); }

.nav-signup-btn {
    background: var(--brand-accent);
    color: var(--brand-1) !important;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.38rem 1.1rem;
    border-radius: 9px;
    text-decoration: none;
    transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.nav-signup-btn:hover {
    background: #8dd9b8;
    box-shadow: 0 3px 12px rgba(117,201,167,0.45);
    transform: translateY(-1px);
}

/* ── Mobile drawer ────────────────────────────────────── */
.mobile-nav-drawer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding-top: calc(60px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
    background: rgb(22,50,65);
    z-index: 1300;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.22s cubic-bezier(0.2,0,0,1), opacity 0.18s ease;
}
.mobile-nav-drawer.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.mobile-nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1290;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.mobile-nav-backdrop.is-visible { opacity: 1; pointer-events: auto; }

.mobile-nav-inner {
    padding: 1rem 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Mode switcher inside drawer */
.mobile-mode-switcher {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 0.75rem 0;
}
.mobile-mode-link {
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}
.mobile-mode-link:hover { color: rgba(255,255,255,0.85); }
.mobile-mode-link--active {
    font-weight: 700;
}

/* Mobile nav sections */
.mobile-nav-section {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.mobile-nav-section-label {
    color: rgba(255,255,255,0.35);
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 0 0.5rem 0.3rem;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.72rem 0.85rem;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    transition: background 0.15s, color 0.15s;
}
.mobile-nav-link i { width: 16px; height: 16px; opacity: 0.7; flex-shrink: 0; }
.mobile-nav-link:hover { background: rgba(255,255,255,0.09); color: #fff; }
button.mobile-nav-link--btn {
    width: 100%;
    cursor: pointer;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    text-align: left;
}
.mobile-nav-link--danger {
    color: #fca5a5 !important;
    background: rgba(239,68,68,0.07) !important;
    border-color: rgba(239,68,68,0.15) !important;
}
.mobile-nav-link--danger:hover { background: rgba(239,68,68,0.14) !important; }

.mobile-nav-section--cta { gap: 0.5rem; }
.mobile-nav-cta-btn {
    display: block;
    text-align: center;
    background: var(--brand-accent);
    color: var(--brand-1);
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.8rem;
    border-radius: 10px;
    text-decoration: none;
    transition: background 0.15s;
}
.mobile-nav-cta-btn:hover { background: var(--brand-accent-light); }

.mobile-nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
    flex-shrink: 0;
}

/* ── Mobile bottom nav bar — floating glassmorphism pill ── */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    height: 56px;
    background: rgba(18, 38, 50, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    z-index: 1400;
    justify-content: center;
    align-items: center;
    gap: 2px;
    padding: 0 6px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.15);
}
.mobile-bottom-nav-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: rgba(255,255,255,0.5);
    font-size: 0.7rem;
    font-weight: 600;
    text-decoration: none;
    padding: 0.5rem 0.85rem;
    min-height: 44px;
    min-width: 44px;
    border: none;
    background: none;
    cursor: pointer;
    position: relative;
    letter-spacing: 0.01em;
    border-radius: 999px;
    white-space: nowrap;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}
.mobile-bottom-nav-item:active {
    opacity: 0.7;
}
.mobile-bottom-nav-item i {
    width: 20px;
    height: 20px;
    stroke-width: 1.8;
    flex-shrink: 0;
}
/* Active item — highlighted pill chip */
.mobile-bottom-nav-item--active {
    color: #fff;
    background: rgba(255,255,255,0.13);
}
/* Remove browser focus outline on button items */
.mobile-bottom-nav-item:focus,
.mobile-bottom-nav-item:focus-visible {
    outline: none;
}
/* Hide all labels — icon only for every item */
.mobile-bottom-nav-item span {
    display: none;
}
/* ── Create button — matches pill style, uses mint accent ── */
.mobile-bottom-nav-item--create {
    color: #fff;
    background: linear-gradient(135deg, var(--mint, #75c9a7) 0%, #5bb894 100%);
    padding: 0.5rem 0.85rem;
}
.mobile-bottom-nav-item--create i {
    width: 20px;
    height: 20px;
    stroke-width: 2.2;
}
.mobile-bottom-nav-item--create::before {
    display: none;
}
.mobile-bottom-nav-item--create:active {
    opacity: 0.85;
}
.mobile-bottom-nav-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--danger);
    color: white;
    font-size: 0.5rem;
    font-weight: 700;
    width: 8px;
    height: 8px;
    padding: 0;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(239,68,68,0.5);
}

/* ── Small phones (≤ 480px) ── */
@media (max-width: 480px) {
    .mobile-bottom-nav {
        gap: 1px;
        padding: 0 4px;
        height: 54px;
    }
    .mobile-bottom-nav-item {
        padding: 0.5rem 0.65rem;
    }
}

/* ── iPhone SE and very small phones (≤ 375px) ── */
@media (max-width: 375px) {
    .mobile-bottom-nav {
        gap: 0;
        padding: 0 2px;
        height: 50px;
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    }
    .mobile-bottom-nav-item {
        padding: 0.4rem 0.5rem;
        min-width: 40px;
        min-height: 40px;
    }
    .mobile-bottom-nav-item i {
        width: 18px;
        height: 18px;
    }
}

/* Mobile Profile Sheet Header */
.mobile-nav-profile-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
}
.mobile-nav-avatar-letter {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(117,201,167,0.25);
    border: 2px solid rgba(117,201,167,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-accent);
    font-weight: 800;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.mobile-nav-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.mobile-nav-user-name {
    color: rgba(255,255,255,0.9);
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mobile-nav-user-email {
    color: rgba(255,255,255,0.4);
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─────────────────────────────────────────────────────────── */
