/* ============================================
   NAVBAR — Split Layout with Center Logo
   ============================================ */

.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: var(--z-navbar);
    /* Fixed height — logo overflows visually without stretching the bar */
    height: var(--navbar-height); /* 72px from variables */
    padding: 0 48px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 40px;
    background: linear-gradient(to bottom, rgba(10,10,11,0.92), rgba(10,10,11,0));
    backdrop-filter: blur(12px);
    transition: height 0.3s var(--ease-out), background 0.3s var(--ease-out);
    opacity: 0;
    transform: translateY(-100%);
    animation: navbarIn 0.9s var(--ease-out) 0.1s forwards;
    /* overflow: visible so logo image can protrude above/below the bar */
    overflow: visible;
}

@keyframes navbarIn {
    to { opacity: 1; transform: translateY(0); }
}

.navbar.scrolled {
    background: rgba(10, 10, 11, 0.95);
    border-bottom: 1px solid var(--color-line-soft);
    height: 56px;
    padding: 0 48px;
}

/* === LEFT + RIGHT LINK LISTS === */
.nav-links {
    display: flex;
    list-style: none;
    gap: 8px;
    align-items: center;
}

.nav-links.nav-left  { justify-content: flex-end; }
.nav-links.nav-right { justify-content: flex-start; }

.nav-links a,
.nav-links button {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color 0.25s var(--ease-out);
    position: relative;
    padding: 6px 12px;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-links a:hover,
.nav-links button:hover,
.nav-links a.active {
    color: var(--color-text-primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%;
    width: 0; height: 1px;
    background: var(--color-gold-primary);
    transition: all 0.4s var(--ease-out);
    transform: translateX(-50%);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* === CENTER LOGO === */
.navbar-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    text-decoration: none;
    padding: 0 24px;
    position: relative;
    /* allow logo to overflow the fixed-height navbar */
    overflow: visible;
    align-self: center;
    height: 100%;
    justify-content: center;
}

.navbar-logo::before,
.navbar-logo::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 20px; height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-gold-dark), transparent);
}

.navbar-logo::before { left: 0; }
.navbar-logo::after  { right: 0; }

.navbar-logo img {
    height: 130px;
    width: auto;
    display: block;
    transition: height 0.4s var(--ease-out), filter 0.4s var(--ease-out);
    filter: drop-shadow(0 0 12px rgba(184,24,42,0.35));
    position: relative; /* z-index context for logo */
    z-index: 1;
}

/* Shrink logo when scrolled, matching the smaller navbar height */
.navbar.scrolled .navbar-logo img { height: 50px; }

.navbar-logo:hover img {
    filter: drop-shadow(0 0 22px rgba(220,30,53,0.65));
    transform: scale(1.04);
}

.navbar-logo-text {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 1.5px;
    color: var(--color-text-primary);
    text-align: center;
    text-transform: uppercase;
}

.navbar-logo-text span {
    color: var(--color-gold-primary);
    display: block;
    font-size: 8px;
    letter-spacing: 2px;
    margin-top: 2px;
}

/* === DROPDOWN === */
.nav-dropdown { position: relative; }

.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-dropdown-arrow {
    font-size: 0.55em;
    transition: transform 0.2s ease;
}

.nav-dropdown:hover .nav-dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    min-width: 220px;
    background: rgba(11, 11, 13, 0.97);
    backdrop-filter: blur(16px);
    border: 1px solid var(--color-line);
    padding: 6px 0;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: var(--z-dropdown);
}

.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.nav-dropdown-item {
    display: block;
    padding: 8px 20px;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 12px;
    font-family: var(--font-body);
    transition: var(--transition-fast);
    white-space: nowrap;
}

.nav-dropdown-item:hover {
    color: var(--color-gold-primary);
    background: rgba(201, 169, 97, 0.06);
}

.nav-dropdown-divider {
    height: 1px;
    background: var(--color-line-soft);
    margin: 4px 0;
}

/* === USER STATE (when logged in) === */
.navbar-user {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--color-text-gold);
    font-size: var(--font-size-sm);
}

.user-avatar {
    width: 28px; height: 28px;
    border: 1px solid var(--color-gold-dark);
    background: var(--color-blood-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--color-gold-primary);
    font-family: var(--font-display);
    flex-shrink: 0;
    transition: border-color 0.25s var(--ease-out);
}

.nav-links a:hover .user-avatar {
    border-color: var(--color-gold-primary);
}

/* === MOBILE TOGGLE === */
.navbar-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: var(--space-sm);
    background: none;
    border: none;
}

.navbar-toggle span {
    display: block;
    width: 22px; height: 1px;
    background: var(--color-gold-primary);
    transition: var(--transition-base);
}

.navbar-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.navbar-toggle.active span:nth-child(2) { opacity: 0; }
.navbar-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

/* === MOBILE MENU === */
.navbar-mobile {
    display: none;
    position: fixed;
    top: var(--navbar-height);
    left: 0; right: 0; bottom: 0;
    background: rgba(10,10,11,0.97);
    backdrop-filter: blur(16px);
    padding: var(--space-xl);
    z-index: var(--z-navbar);
    flex-direction: column;
    gap: var(--space-sm);
    overflow-y: auto;
}

.navbar-mobile.open { display: flex; }

.navbar-mobile .nav-link {
    padding: var(--space-md) var(--space-lg);
    font-family: var(--font-body);
    font-size: var(--font-size-sm);
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    border-bottom: 1px solid var(--color-line-soft);
    text-decoration: none;
    display: block;
    transition: var(--transition-fast);
}

.navbar-mobile .nav-link:hover { color: var(--color-gold-primary); }

.navbar-mobile .navbar-actions {
    margin-top: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
    .navbar {
        grid-template-columns: 1fr auto;
        padding: 0 24px;
        height: 64px;
    }
    .nav-links.nav-left { display: none; }
    .nav-links.nav-right { display: none; }
    .navbar-toggle { display: flex; }
    .navbar-logo img { height: 56px; }
    .navbar.scrolled .navbar-logo img { height: 44px; }
}
