/* ==========================================================================
   Navbar — Premium Design v3
   Modern glassmorphism pill navbar with refined typography and clean layout
   ========================================================================== */

/* ── VARIABLES ──────────────────────────────────────────────────────────── */
:root {
    --nav-h: 60px;
    --nav-bg: rgba(8, 13, 11, 0.88);
    --nav-bg-scrolled: rgba(6, 10, 8, 0.96);
    --nav-border: rgba(255, 255, 255, 0.07);
    --nav-accent: #6EDC5F;
    --nav-accent-dim: rgba(110, 220, 95, 0.14);
    --nav-accent-glow: rgba(110, 220, 95, 0.28);
    --nav-text: #D8EDE4;
    --nav-text-muted: #7A9C8E;
    --nav-brand-grad: linear-gradient(125deg, #6EDC5F 0%, #B8F04A 100%);
    --nav-radius: 0px;
    --nav-blur: 18px;
}

/* ── MAIN BAR ───────────────────────────────────────────────────────────── */
.futuristic-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1050;

    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    height: var(--nav-h);

    background: var(--nav-bg);
    backdrop-filter: blur(var(--nav-blur)) saturate(150%);
    -webkit-backdrop-filter: blur(var(--nav-blur)) saturate(150%);
    border-bottom: 1px solid var(--nav-border);
    border-radius: 0;
    box-shadow: 0 4px 24px -4px rgba(0,0,0,0.28);

    transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* Scrolled state: slightly more opaque */
.futuristic-nav.scrolled {
    background: var(--nav-bg-scrolled);
    border-bottom-color: rgba(255, 255, 255, 0.10);
    box-shadow: 0 6px 32px -4px rgba(0,0,0,0.40);
}

/* Bottom accent line — green glow under nav */
.futuristic-nav::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(110, 220, 95, 0.50) 20%,
        rgba(184, 240, 74, 0.70) 50%,
        rgba(110, 220, 95, 0.50) 80%,
        transparent 100%
    );
    pointer-events: none;
    opacity: 0.6;
    transition: opacity 0.3s;
}
.futuristic-nav.scrolled::after { opacity: 1; }

/* Remove old ::before */
.futuristic-nav::before { display: none; }

/* Push page content below fixed navbar */
body:not(.nav-no-fixed) {
    padding-top: var(--nav-h);
}

/* ── SIDEBAR CONTENT OFFSET ─────────────────────────────────────────────── */
/* When the vertical sidebar is visible, push page content to the right
   so the sidebar (≈4rem wide) does not overlap it. */
body.has-sidebar .page-content {
    padding-left: 5rem;
}

/* Remove the extra padding on mobile where the sidebar is hidden */
@media (max-width: 768px) {
    body.has-sidebar .page-content {
        padding-left: 0;
    }
}

.layout-container {
    padding-left: 1rem;
    padding-right: 1rem;
}

/* ── BRAND ──────────────────────────────────────────────────────────────── */
.navbar-brand {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.brand-pill {
    display: inline-flex;
    align-items: center;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
    font-weight: 900;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    color: #6EDC5F;
    position: relative;
}

/* Slash separator */
.brand-pill::after {
    content: '/';
    color: rgba(110, 220, 95, 0.4);
    font-weight: 300;
    font-size: 1.1rem;
    margin: 0 0.45rem;
    letter-spacing: 0;
}

.brand-name {
    font-weight: 500;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    color: var(--nav-text);
}

/* ── DESKTOP NAV LINKS ──────────────────────────────────────────────────── */
.desktop-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.futuristic-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--nav-text-muted) !important;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 0.85rem !important;
    border-radius: 0;
    text-decoration: none;
    transition: color 0.2s;
    border: none;
    background: transparent;
    cursor: pointer;
    /* Bottom-line indicator base */
    border-bottom: 2px solid transparent;
    padding-bottom: calc(0.5rem - 2px) !important;
}

.futuristic-link:hover {
    color: var(--nav-text) !important;
    background: transparent;
}

.futuristic-link.active {
    color: var(--nav-accent) !important;
    background: transparent;
    border-bottom-color: var(--nav-accent);
}

.futuristic-link:focus-visible {
    outline: 2px solid var(--nav-accent);
    outline-offset: 2px;
}

/* ── THEME TOGGLE ───────────────────────────────────────────────────────── */
.nav-theme-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: var(--nav-text-muted);
    font-size: 0.95rem;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.nav-theme-btn:hover {
    background: rgba(255,255,255,0.10);
    border-color: rgba(255,255,255,0.20);
    color: var(--nav-text);
    transform: rotate(15deg) scale(1.05);
}

/* ── LANGUAGE SELECTOR ──────────────────────────────────────────────────── */
.futuristic-dropdown .futuristic-link {
    gap: 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 0.45rem 0.8rem !important;
}

.lang-flag {
    font-size: 1rem;
    line-height: 1;
}

/* ── DROPDOWN ───────────────────────────────────────────────────────────── */
.futuristic-dropdown-menu {
    background: rgba(13, 20, 17, 0.96);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    box-shadow:
        0 20px 48px rgba(0,0,0,0.35),
        0 0 0 1px rgba(255,255,255,0.04) inset;
    padding: 0.4rem;
    margin-top: 0.6rem !important;
    animation: dropIn 0.18s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    min-width: 160px;
}

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)  scale(1);    }
}

.futuristic-dropdown-menu .dropdown-item {
    color: var(--nav-text-muted);
    border-radius: 8px;
    padding: 0.55rem 0.9rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.futuristic-dropdown-menu .dropdown-item:hover {
    background: var(--nav-accent-dim);
    color: var(--nav-accent);
}

.futuristic-dropdown-menu .dropdown-item.text-danger:hover {
    background: rgba(239,68,68,0.12);
    color: #f87171 !important;
}

.futuristic-dropdown-menu .dropdown-divider {
    border-color: rgba(255,255,255,0.08);
    margin: 0.35rem 0;
}

/* ── USER AVATAR ────────────────────────────────────────────────────────── */
.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--nav-brand-grad);
    color: #0b1f14;
    font-weight: 800;
    font-size: 0.82rem;
    display: grid;
    place-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    flex-shrink: 0;
    letter-spacing: 0;
}

.user-menu {
    border: 1px solid transparent;
    gap: 0.5rem;
}

.user-menu:hover {
    border-color: rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03) !important;
}

/* ── CTA BUTTON (unauthenticated) ───────────────────────────────────────── */
.futuristic-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.25rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    border: 1.5px solid rgba(110,220,95,0.5);
    color: var(--nav-accent);
    background: transparent;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    white-space: nowrap;
}

.futuristic-btn:hover {
    background: var(--nav-accent-dim);
    border-color: rgba(110,220,95,0.75);
    color: var(--nav-accent);
    box-shadow: 0 0 18px var(--nav-accent-glow);
    transform: translateY(-1px);
}

.btn-content { position: relative; z-index: 1; }

/* ── SIDEBAR ────────────────────────────────────────────────────────────── */
.futuristic-sidebar {
    position: fixed;
    top: 50%;
    left: 0.5rem;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    background: rgba(11, 18, 15, 0.88);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid rgba(110,220,95,0.22);
    border-radius: 16px;
    padding: 0.65rem 0.5rem;
    z-index: 1500;
    box-shadow: 0 8px 32px rgba(0,0,0,0.35), 0 0 0 1px rgba(110,220,95,0.05) inset;
}

.futuristic-sidebar a {
    color: rgba(148,163,184,0.65);
    font-size: 1.15rem;
    text-decoration: none;
    width: 2.2rem;
    height: 2.2rem;
    display: grid;
    place-items: center;
    border-radius: 10px;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}

.futuristic-sidebar a:hover {
    background: rgba(110,220,95,0.1);
    color: var(--nav-text);
    box-shadow: 0 0 0 1px rgba(110,220,95,0.18);
}

.futuristic-sidebar a.active {
    background: rgba(110,220,95,0.16);
    color: var(--nav-accent);
    box-shadow: 0 0 0 1px rgba(110,220,95,0.28);
}

html.dc-light .futuristic-sidebar {
    background: rgba(255,255,255,0.92);
    border-color: rgba(22,163,74,0.3);
    box-shadow: 0 8px 32px rgba(15,21,19,0.10), 0 0 0 1px rgba(22,163,74,0.05) inset;
}

html.dc-light .futuristic-sidebar a { color: rgba(71,85,105,0.75); }
html.dc-light .futuristic-sidebar a:hover { background: rgba(110,220,95,0.1); color: #1a2b25; }
html.dc-light .futuristic-sidebar a.active { background: rgba(110,220,95,0.15); color: #3da63a; }

/* CUPS dot indicator */
.side-cups-badge {
    width: 2.2rem;
    height: 2.2rem;
    display: grid;
    place-items: center;
    border-radius: 8px;
    cursor: default;
}

.cups-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--nav-accent);
    box-shadow: 0 0 6px var(--nav-accent-glow);
    animation: cupsDotPulse 2.5s ease-in-out infinite;
}

@keyframes cupsDotPulse {
    0%,100% { box-shadow: 0 0 5px var(--nav-accent-glow); transform: scale(1); }
    50%     { box-shadow: 0 0 12px rgba(110,220,95,0.55); transform: scale(1.2); }
}

/* ── MOBILE TOGGLER ─────────────────────────────────────────────────────── */
.futuristic-toggler {
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.07);
    padding: 0.5rem;
    border-radius: 10px;
    color: var(--nav-text);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 38px;
    height: 38px;
    gap: 0;
    cursor: pointer;
}

.futuristic-toggler .toggler-line {
    display: block;
    width: 20px;
    height: 2px;
    margin: 3px 0;
    background: #D8EDE4;  /* explicit light color — never invisible */
    border-radius: 2px;
    transition: all 0.25s ease;
    transform-origin: center;
}

.futuristic-toggler[aria-expanded="true"] .toggler-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 5px);
}
.futuristic-toggler[aria-expanded="true"] .toggler-line:nth-child(2) {
    opacity: 0; transform: scaleX(0);
}
.futuristic-toggler[aria-expanded="true"] .toggler-line:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -5px);
}

/* ── MOBILE OFFCANVAS ───────────────────────────────────────────────────── */
.futuristic-offcanvas {
    background: rgba(11, 17, 14, 0.98);
    backdrop-filter: blur(24px);
    border-right: 1px solid rgba(255,255,255,0.06);
    max-width: 300px;
}

.futuristic-offcanvas .offcanvas-header {
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 1.25rem 1.5rem;
}

.futuristic-offcanvas .offcanvas-title {
    color: var(--nav-text);
    font-weight: 700;
    font-size: 1.05rem;
}

.futuristic-offcanvas .offcanvas-body {
    padding: 1rem 1.25rem;
}

/* Brand mobile: wordmark matching navbar — no box, gradient text */
.brand-pill-mobile {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #6EDC5F 0%, #B8F04A 60%, #74f25e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    border: none;
    font-weight: 900;
    font-size: 0.95rem;
    letter-spacing: -0.02em;
    padding: 0;
    margin-right: 0;
}

/* Slash separator */
.brand-pill-mobile::after {
    content: '/';
    -webkit-text-fill-color: rgba(110, 220, 95, 0.35);
    font-weight: 300;
    font-size: 1rem;
    margin: 0 0.42rem;
}

/* Mobile settings row (theme + lang) */
.mobile-settings-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem 0 0.75rem;
}

.mobile-setting-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    color: var(--nav-text-muted);
    padding: 0.55rem 0.9rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.mobile-setting-btn:hover {
    background: rgba(255,255,255,0.08);
    color: var(--nav-text);
}

.mobile-setting-label {
    font-size: 0.82rem;
}

/* Mobile nav links */
.futuristic-mobile-link {
    color: var(--nav-text-muted) !important;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    margin-bottom: 0.2rem;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, padding-left 0.2s;
}

.futuristic-mobile-link:hover,
.futuristic-mobile-link.active {
    background: rgba(255,255,255,0.05);
    color: var(--nav-text) !important;
    padding-left: 1.25rem;
}

.futuristic-mobile-link.active {
    color: var(--nav-accent) !important;
    background: var(--nav-accent-dim);
}

.futuristic-mobile-link.logout-link:hover {
    background: rgba(239,68,68,0.1) !important;
    color: #f87171 !important;
}

.futuristic-mobile-link .mobile-link-icon {
    font-size: 1rem;
    width: 1.5rem;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.8;
}

.mobile-divider {
    border-color: rgba(255,255,255,0.07);
    margin: 0.75rem 0;
    opacity: 1;
}

/* Mobile user info block */
.user-info-mobile {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    color: var(--nav-text);
    margin-bottom: 0.75rem;
}

.user-avatar-mobile {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--nav-brand-grad);
    color: #0b1f14;
    font-weight: 800;
    font-size: 0.95rem;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

/* Mobile auth CTA */
.mobile-auth-section {
    padding: 1rem 0;
}

.mobile-auth-intro {
    color: var(--nav-text-muted);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.mobile-cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.25rem;
    border-radius: 10px;
    background: var(--nav-accent-dim);
    border: 1px solid rgba(110,220,95,0.35);
    color: var(--nav-accent);
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}

.mobile-cta-btn:hover {
    background: rgba(110,220,95,0.25);
    border-color: rgba(110,220,95,0.55);
    color: var(--nav-accent);
}

/* ── MOBILE QUICK BUTTONS ─────────────────────────────────────────────── */
.nav-quick-links {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.nav-quick-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.04);
    color: var(--nav-text-muted);
    display: grid;
    place-items: center;
    font-size: 0.95rem;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}

.nav-quick-btn:hover {
    background: var(--nav-accent-dim);
    border-color: rgba(110,220,95,0.45);
    color: var(--nav-accent);
    transform: translateY(-1px);
}

.nav-quick-btn.active {
    background: var(--nav-accent-dim);
    border-color: rgba(110,220,95,0.5);
    color: var(--nav-accent);
}

/* ── LIGHT MODE OVERRIDES ────────────────────────────────────────────────── */
html.dc-light {
    --nav-text: #1a2e22;
    --nav-text-muted: #527868;
}

html.dc-light .futuristic-nav {
    background: rgba(248, 251, 249, 0.94) !important;
    border-bottom-color: rgba(0,0,0,0.09);
    box-shadow: 0 4px 24px -4px rgba(90,120,100,0.10);
}

html.dc-light .futuristic-nav::before { display: none; }
html.dc-light .futuristic-nav::after {
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(77,184,64,0.45) 20%,
        rgba(110,220,95,0.65) 50%,
        rgba(77,184,64,0.45) 80%,
        transparent 100%
    );
}

html.dc-light .futuristic-nav.scrolled {
    background: rgba(244, 248, 246, 0.98) !important;
}

/* Light mode: brand wordmark */
html.dc-light .brand-pill {
    color: #2a8c28;
}

html.dc-light .brand-pill::after {
    color: rgba(40, 140, 40, 0.4);
}

html.dc-light .brand-name {
    color: #1a2e22;
}

html.dc-light .futuristic-link { color: #527868 !important; }
html.dc-light .futuristic-link:hover { color: #1a2b25 !important; background: transparent; }
html.dc-light .futuristic-link.active { color: #2a7d2e !important; background: transparent; border-bottom-color: #2a7d2e; }

html.dc-light .nav-theme-btn {
    background: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.12);
    color: #527868;
}
html.dc-light .nav-theme-btn:hover {
    background: rgba(0,0,0,0.08);
    color: #1a2b25;
}

html.dc-light .user-avatar {
    color: #0b1f14;
}

html.dc-light .futuristic-btn {
    background: #4DB840;
    border-color: #4DB840;
    color: #fff;
}
html.dc-light .futuristic-btn:hover {
    background: #5CCF4D;
    border-color: #5CCF4D;
    color: #fff;
    box-shadow: 0 4px 18px rgba(77,184,64,0.25);
}

html.dc-light .futuristic-toggler {
    background: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.10);
    color: #1a2b25;
}
html.dc-light .futuristic-toggler .toggler-line { background: #1a2b25; }

html.dc-light .futuristic-offcanvas {
    background: rgba(255,255,255,0.99);
    border-right-color: rgba(0,0,0,0.07);
}
html.dc-light .futuristic-offcanvas .offcanvas-title { color: #1a2b25; }

html.dc-light .mobile-setting-btn {
    background: rgba(0,0,0,0.03);
    border-color: rgba(0,0,0,0.08);
    color: #527868;
}
html.dc-light .mobile-setting-btn:hover {
    background: rgba(0,0,0,0.06);
    color: #1a2b25;
}

html.dc-light .futuristic-mobile-link { color: #527868 !important; }
html.dc-light .futuristic-mobile-link:hover,
html.dc-light .futuristic-mobile-link.active { color: #1a2b25 !important; background: rgba(0,0,0,0.04); }
html.dc-light .futuristic-mobile-link.active { color: #2a7d2e !important; background: rgba(110,220,95,0.10); }

html.dc-light .user-info-mobile {
    background: rgba(0,0,0,0.02);
    border-color: rgba(0,0,0,0.06);
    color: #1a2b25;
}

html.dc-light .futuristic-dropdown-menu {
    background: rgba(255,255,255,0.99);
    border-color: rgba(0,0,0,0.07);
    box-shadow: 0 20px 48px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.03) inset;
}
html.dc-light .futuristic-dropdown-menu .dropdown-item { color: #527868; }
html.dc-light .futuristic-dropdown-menu .dropdown-item:hover { background: rgba(110,220,95,0.10); color: #2a7d2e; }
html.dc-light .futuristic-dropdown-menu .dropdown-divider { border-color: rgba(0,0,0,0.06); }

html.dc-light .nav-quick-btn {
    background: rgba(255,255,255,0.95);
    border-color: rgba(0,0,0,0.10);
    color: #527868;
}
html.dc-light .nav-quick-btn:hover,
html.dc-light .nav-quick-btn.active {
    background: rgba(110,220,95,0.12);
    border-color: var(--nav-accent);
    color: #2a7d2e;
}

html.dc-light .mobile-divider { border-color: rgba(0,0,0,0.06); }

/* ── RESPONSIVE ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .futuristic-nav {
        width: 100%;
        height: 54px;
        padding: 0 1rem;
        top: 0;
        left: 0;
        border-radius: 0;
    }

    body:not(.nav-no-fixed) {
        padding-top: 54px;
    }

    .brand-name { font-size: 1rem; }
    .brand-pill { font-size: 0.82rem; }

    .futuristic-sidebar { display: none !important; }
    .user-menu { min-width: auto; }
}

@media (max-width: 400px) {
    .futuristic-nav {
        height: 50px;
        padding: 0 0.75rem;
    }

    body:not(.nav-no-fixed) {
        padding-top: 50px;
    }

    .brand-name { font-size: 0.95rem; }
    .brand-pill  { font-size: 0.78rem; }
}
