/* Global navigation styles shared across site */
.navbar {
    position: fixed;
    top: 24px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(98%, 1180px);
    padding: 0.65rem clamp(2.3rem, 5vw, 3.4rem);
    min-height: var(--nav-height);
    background: linear-gradient(135deg, rgba(28, 28, 28, 0.5), rgba(110, 110, 110, 0.14)) !important;
    backdrop-filter: blur(32px) saturate(220%);
    -webkit-backdrop-filter: blur(32px) saturate(220%);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    box-shadow: 0 18px 42px -28px rgba(5, 5, 5, 0.52);
    transition: all 0.4s ease;
    z-index: 1100;
    overflow: visible;
}

.navbar::before,
.navbar::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 46px;
    border-radius: 999px;
    pointer-events: none;
    filter: blur(18px);
    opacity: 0.55;
    transition: opacity 0.4s ease;
}

.navbar::before {
    left: -20px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0));
}

.navbar::after {
    right: -20px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.3));
}

.navbar .container {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(1.5rem, 4vw, 3rem);
}

.navbar.scrolled {
    top: 16px;
    background: linear-gradient(135deg, rgba(22, 22, 22, 0.46), rgba(90, 90, 90, 0.14)) !important;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 16px 36px -26px rgba(10, 10, 10, 0.58);
    transform: translateX(-50%) scale(0.97);
}

.navbar.scrolled::before,
.navbar.scrolled::after {
    opacity: 0.7;
}

@media (max-width: 1024px) {
    :root {
        --nav-height: 68px;
    }
    
    .navbar {
        width: calc(100% - 2.5rem);
        top: 20px;
        padding: 0.6rem 1.3rem;
    }
    
    .navbar-toggler {
        display: block;
    }
    
    .navbar-collapse {
        position: fixed;
        top: calc(20px + var(--nav-height));
        right: -100%;
        width: min(360px, 70%);
        height: calc(100vh - (20px + var(--nav-height)));
        background: rgba(10, 10, 10, 0.96);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 3rem 2.5rem;
        transition: right 0.3s ease;
        border-left: 1px solid rgba(255, 255, 255, 0.12);
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 24px 0 0 24px;
        z-index: 1050;
    }
    
    .navbar-collapse.show {
        right: 0;
    }
    
    .navbar-collapse .nav-link {
        width: 100%;
        padding: 0.9rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        text-transform: uppercase;
        letter-spacing: 0.12em;
        font-size: 1rem;
        color: rgba(255, 255, 255, 0.88) !important;
    }

    .navbar-collapse .nav-link:last-child {
        border-bottom: none;
    }
    
    body[data-theme="light"] .navbar-collapse {
        background: rgba(255, 255, 255, 0.95);
        border-left: 1px solid rgba(0, 0, 0, 0.08);
    }
    
    body[data-theme="light"] .navbar-collapse .nav-link {
        color: rgba(20, 20, 20, 0.85) !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    }

    body[data-theme="light"] .navbar-collapse .nav-link::after {
        background: rgba(20, 20, 20, 0.85);
    }
}

.navbar-brand {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: #ffffff !important;
    letter-spacing: -0.02em;
    transition: all 0.3s ease;
}

body[data-theme="light"] .navbar-brand {
    color: #141414 !important;
}

.navbar .navbar-collapse {
    flex-grow: 1;
    justify-content: flex-end;
    display: flex !important;
}

.navbar .navbar-collapse > .navbar-nav {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: clamp(1.8rem, 4vw, 3rem);
    flex: 1;
    margin-left: clamp(2.4rem, 6vw, 4rem) !important;
    margin-right: clamp(2.4rem, 6vw, 4rem) !important;
}

.navbar-nav {
    align-items: center;
    gap: clamp(1.5rem, 3vw, 2.5rem);
}

.navbar-brand:hover {
    opacity: 0.7;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 500;
    margin: 0;
    position: relative;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.85);
    transition: all 0.3s ease;
}

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

.nav-link:hover,
.nav-link.active {
    color: #ffffff !important;
}

.navbar-toggler {
    border: none;
    background: none;
    padding: 0.5rem;
    cursor: pointer;
    display: none;
}

@media (max-width: 1024px) {
    .navbar-toggler {
        display: block !important;
    }
}

.navbar-toggler-icon {
    width: 24px;
    height: 2px;
    background: #ffffff;
    display: block;
    position: relative;
    transition: all 0.3s ease;
}

.navbar-toggler-icon::before,
.navbar-toggler-icon::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: #ffffff;
    transition: all 0.3s ease;
}

.navbar-toggler-icon::before {
    top: -8px;
}

.navbar-toggler-icon::after {
    bottom: -8px;
}

.navbar-toggler.active .navbar-toggler-icon {
    background: transparent;
}

.navbar-toggler.active .navbar-toggler-icon::before {
    top: 0;
    transform: rotate(45deg);
}

.navbar-toggler.active .navbar-toggler-icon::after {
    bottom: 0;
    transform: rotate(-45deg);
}

body[data-theme="light"] .navbar {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.24), rgba(220, 220, 220, 0.08)) !important;
    border-color: rgba(0, 0, 0, 0.05);
    box-shadow: 0 10px 28px -24px rgba(15, 15, 15, 0.16);
}

body[data-theme="light"] .navbar::before {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0));
}

body[data-theme="light"] .navbar::after {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.08));
}

body[data-theme="light"] .navbar.scrolled {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.42), rgba(240, 240, 240, 0.18)) !important;
    border-color: rgba(0, 0, 0, 0.05);
    box-shadow: 0 12px 28px -22px rgba(0, 0, 0, 0.22);
}

body[data-theme="light"] .nav-link {
    color: rgba(20, 20, 20, 0.75) !important;
}

body[data-theme="light"] .nav-link:hover,
body[data-theme="light"] .nav-link.active {
    color: #0b0b0b !important;
}

body[data-theme="light"] .nav-link::after {
    background: rgba(20, 20, 20, 0.85);
}

body[data-theme="light"] .navbar-toggler-icon,
body[data-theme="light"] .navbar-toggler-icon::before,
body[data-theme="light"] .navbar-toggler-icon::after {
    background: #111111;
}

@media (max-width: 768px) {
    :root {
        --nav-height: 64px;
    }

    .navbar {
        width: calc(100% - 1.5rem);
        top: 16px;
        padding: 0.55rem 1.1rem;
        border-radius: 24px;
    }

    .navbar::before,
    .navbar::after {
        display: none;
    }

    .navbar-collapse {
        right: -100%;
        width: min(320px, 78%);
        height: calc(100vh - (16px + var(--nav-height)));
        padding: 2.75rem 2rem;
    }

    .navbar-collapse .nav-link {
        color: rgba(255, 255, 255, 0.9) !important;
        text-transform: uppercase;
        letter-spacing: 0.12em;
        font-size: 1rem;
        padding: 0.85rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .navbar-collapse .nav-link::after {
        background: rgba(255, 255, 255, 0.8);
    }

    .navbar-nav {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .nav-link {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .navbar-brand {
        font-size: 1.2rem;
    }

    .nav-link {
        font-size: 1rem;
    }
}
