/* ═══ 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: 2px;
    background: rgba(0,0,0,0.32);
    box-shadow: inset 0 1px 4px rgba(0,0,0,0.5);
    border-radius: 12px;
    padding: 3px;
    flex-shrink: 0;
}

.mode-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    min-width: 74px;
    padding: 0.3rem 0.6rem;
    border-radius: 9px;
    font-size: 0.69rem;
    font-weight: 700;
    color: rgba(255,255,255,0.48);
    text-decoration: none;
    letter-spacing: 0.065em;
    text-transform: uppercase;
    transition: color 0.18s, background 0.18s;
    white-space: nowrap;
    user-select: none;
}
.mode-pill:hover {
    color: rgba(255,255,255,0.78);
    background: rgba(255,255,255,0.08);
}
.mode-pill--active {
    background: #ffffff !important;
    color: #1c3a36 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.6);
    font-weight: 800;
}
.mode-pill--active:hover {
    background: #f2f9f6 !important;
    color: #1c3a36 !important;
}
.mode-pill--active .mode-pill-icon { color: #3da373; }

.mode-pill-icon {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
    stroke-width: 2.5;
}

/* ── 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, demoted) */
.mode-switcher--compact {
    margin-left: auto;
    transform: scale(0.88);
    transform-origin: right center;
    opacity: 0.85;
    transition: opacity 0.15s;
}
.mode-switcher--compact:hover { opacity: 1; }

/* 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: 36px;
    height: 36px;
    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: 34px;
    height: 34px;
    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: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(22,50,65,0.98);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid rgba(255,255,255,0.07);
    box-shadow: 0 16px 40px rgba(0,0,0,0.35);
    z-index: 999;
    max-height: calc(100vh - 58px);
    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: 998;
    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: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
    padding: 0.5rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
}
.mobile-mode-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 0.5rem;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    transition: color 0.15s, background 0.15s;
}
.mobile-mode-pill i { width: 15px; height: 15px; }
.mobile-mode-pill:hover { color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.07); }
.mobile-mode-pill--active {
    background: var(--brand-accent);
    color: var(--brand-1) !important;
    font-weight: 700;
    box-shadow: 0 1px 8px rgba(117,201,167,0.3);
}

/* 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 ──────────────────────────────── */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--t-card-bg, #152c38);
    border-top: 1px solid rgba(255,255,255,0.08);
    z-index: 1200;
    justify-content: space-around;
    align-items: center;
    padding: 0 0.5rem;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.mobile-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: rgba(255,255,255,0.45);
    font-size: 0.6rem;
    font-weight: 600;
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    min-width: 52px;
    border: none;
    background: none;
    cursor: pointer;
    position: relative;
    transition: color 0.15s;
}
.mobile-bottom-nav-item i {
    width: 20px;
    height: 20px;
}
.mobile-bottom-nav-item--active {
    color: var(--mint);
}
.mobile-bottom-nav-item--create {
    color: var(--mint);
}
.mobile-bottom-nav-item--create i {
    width: 26px;
    height: 26px;
}
.mobile-bottom-nav-badge {
    position: absolute;
    top: 2px;
    right: 50%;
    transform: translateX(14px);
    background: var(--danger);
    color: white;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 0 0.35rem;
    border-radius: 10px;
    min-width: 14px;
    text-align: center;
    line-height: 1.3;
}

/* 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;
}

/* ─────────────────────────────────────────────────────────── */
