/* ========================================
   Premium Navigation
   Terminal Industries inspired
   ======================================== */

:root {
    --sh-chartreuse: #DFFF00;
    --sh-cream: #f5f5dc;
    --sh-brown: #4d4141;
    --sh-brown-dark: #2d2424;
}

/* Global: Remove all underlines in header */
.sh a,
.sh a *,
.sh button,
.sh button *,
.sh-drawer a,
.sh-drawer a *,
.sh-drawer button,
.sh-drawer button *,
.sh-nav a,
.sh-nav a *,
.sh-nav button,
.sh-nav button * {
    text-decoration: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
    background-image: none !important;
}

.sh a:hover,
.sh a:hover *,
.sh a:focus,
.sh a:focus *,
.sh a:active,
.sh a:active *,
.sh-drawer a:hover,
.sh-drawer a:hover *,
.sh-drawer a:focus,
.sh-drawer a:focus *,
.sh-drawer a:active,
.sh-drawer a:active *,
.sh-nav a:hover,
.sh-nav a:hover *,
.sh-nav button:hover,
.sh-nav button:hover * {
    text-decoration: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
    background-image: none !important;
}

/* Override page-level nav ::after underlines */
.sh-nav a::after,
.sh-nav a::before,
.sh-nav button::after,
.sh-nav button::before,
.sh a::after,
.sh a::before,
.sh-dropdown-menu a::after,
.sh-dropdown-menu a::before {
    content: none !important;
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: none !important;
}

.sh-nav a:hover::after,
.sh-nav a:hover::before,
.sh a:hover::after,
.sh a:hover::before {
    content: none !important;
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: none !important;
}

/* ========================================
   Header Base
   ======================================== */
.sh {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1.75rem 3.5rem;
    transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.sh--scrolled {
    background: rgba(45, 36, 36, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 1.25rem 3.5rem;
}

.sh-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
}

/* ========================================
   Logo
   ======================================== */
.sh-logo {
    flex-shrink: 0;
    text-decoration: none !important;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sh-logo:link,
.sh-logo:visited,
.sh-logo:hover,
.sh-logo:active {
    text-decoration: none !important;
}

.sh-logo:hover {
    transform: scale(1.04);
}

.sh-logo img {
    height: 52px;
    display: block;
}

/* ========================================
   Desktop Navigation
   ======================================== */
.sh-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    opacity: 0;
    transform: translateX(60px);
    pointer-events: none;
    transition: all 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sh-nav.visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

/* Staggered fly-in for each nav item */
.sh-nav.visible .sh-nav-link,
.sh-nav.visible .sh-dropdown {
    animation: navFlyIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.sh-nav.visible .sh-nav-link:nth-child(1),
.sh-nav.visible .sh-dropdown:nth-child(1) { animation-delay: 0s; }
.sh-nav.visible .sh-nav-link:nth-child(2),
.sh-nav.visible .sh-dropdown:nth-child(2) { animation-delay: 0.05s; }
.sh-nav.visible .sh-nav-link:nth-child(3),
.sh-nav.visible .sh-dropdown:nth-child(3) { animation-delay: 0.1s; }
.sh-nav.visible .sh-nav-link:nth-child(4),
.sh-nav.visible .sh-dropdown:nth-child(4) { animation-delay: 0.15s; }

@keyframes navFlyIn {
    0% {
        opacity: 0;
        transform: translateX(40px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.sh-nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    font-family: var(--font-primary, 'Montserrat', sans-serif);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--sh-cream);
    text-decoration: none !important;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    opacity: 0;
}

.sh-nav-link:link,
.sh-nav-link:visited,
.sh-nav-link:hover,
.sh-nav-link:active {
    text-decoration: none !important;
}

.sh-nav-text {
    transition: color 0.3s ease;
    text-decoration: none !important;
    border-bottom: none !important;
}

.sh-nav-text:hover {
    text-decoration: none !important;
    border-bottom: none !important;
}

.sh-nav-arrow {
    font-size: 0.75rem;
    opacity: 0;
    transform: translateX(-8px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: var(--sh-chartreuse);
}

/* Chartreuse hover with arrow reveal */
.sh-nav-link:hover {
    color: var(--sh-chartreuse);
    text-decoration: none !important;
    border-bottom: none !important;
}

.sh-nav-link:hover .sh-nav-text {
    color: var(--sh-chartreuse);
    text-decoration: none !important;
    border-bottom: none !important;
}

.sh-nav-link:hover span {
    text-decoration: none !important;
    border-bottom: none !important;
}

.sh-nav-link:hover .sh-nav-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Down arrow for dropdowns - always visible */
.sh-nav-arrow--down {
    opacity: 0.6;
    transform: translateX(0) translateY(0);
}

.sh-nav-link:hover .sh-nav-arrow--down {
    opacity: 1;
    transform: translateX(0) translateY(2px);
}

/* ========================================
   Dropdowns - Subtle Blur
   ======================================== */
.sh-dropdown {
    position: relative;
    opacity: 0;
}

.sh-dropdown.active .sh-nav-link {
    color: var(--sh-chartreuse);
    text-decoration: none;
}

.sh-dropdown.active .sh-nav-arrow--down {
    opacity: 1;
    transform: translateX(0) rotate(180deg);
}

.sh-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 100%;
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    background: rgba(45, 36, 36, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 8px;
    border: 1px solid rgba(245, 245, 220, 0.1);
}

.sh-dropdown.active .sh-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sh-dropdown-link {
    display: block;
    padding: 0.5rem 1.25rem;
    font-family: var(--font-primary, 'Montserrat', sans-serif);
    font-size: 0.8rem;
    font-weight: 400;
    color: rgba(245, 245, 220, 0.85);
    text-decoration: none !important;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.sh-dropdown-link:link,
.sh-dropdown-link:visited,
.sh-dropdown-link:hover,
.sh-dropdown-link:active {
    text-decoration: none !important;
}

.sh-dropdown-link:hover {
    color: var(--sh-chartreuse);
}

/* ========================================
   Right Section
   ======================================== */
.sh-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ========================================
   Avatar Icon (always visible)
   ======================================== */
.sh-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--sh-cream);
    text-decoration: none !important;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    border-radius: 50%;
}

.sh-avatar:link,
.sh-avatar:visited,
.sh-avatar:hover,
.sh-avatar:active {
    text-decoration: none !important;
}

.sh-avatar:hover {
    color: var(--sh-chartreuse);
    transform: scale(1.1);
}

.sh-avatar svg {
    width: 24px;
    height: 24px;
}

/* ========================================
   Avatar Dropdown
   ======================================== */
.sh-avatar-dropdown {
    position: relative;
}

.sh-avatar-dropdown .sh-avatar {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.sh-avatar-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    background: rgba(45, 36, 36, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 8px;
    border: 1px solid rgba(245, 245, 220, 0.1);
}

.sh-avatar-dropdown.active .sh-avatar {
    color: var(--sh-chartreuse);
}

.sh-avatar-dropdown.active .sh-avatar-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sh-avatar-link {
    display: block;
    width: 100%;
    padding: 0.5rem 1.25rem;
    font-family: var(--font-primary, 'Montserrat', sans-serif);
    font-size: 0.8rem;
    font-weight: 400;
    color: rgba(245, 245, 220, 0.7);
    text-decoration: none !important;
    text-align: right;
    white-space: nowrap;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.3s ease;
}

.sh-avatar-link:link,
.sh-avatar-link:visited,
.sh-avatar-link:hover,
.sh-avatar-link:active {
    text-decoration: none !important;
}

.sh-avatar-link:hover {
    color: var(--sh-chartreuse);
}

/* ========================================
   Two-Line Burger
   ======================================== */
.sh-burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    width: 44px;
    height: 44px;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.sh-burger span {
    display: block;
    height: 2px;
    background: var(--sh-cream);
    border-radius: 2px;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center;
}

.sh-burger span:nth-child(1) {
    width: 28px;
}

.sh-burger span:nth-child(2) {
    width: 20px;
}

.sh-burger:hover span {
    background: var(--sh-chartreuse);
}

.sh-burger:hover span:nth-child(2) {
    width: 28px;
}

/* Active state - X */
.sh-burger.active span {
    background: var(--sh-chartreuse);
    width: 28px;
}

.sh-burger.active span:nth-child(1) {
    transform: rotate(45deg) translate(3px, 3px);
}

.sh-burger.active span:nth-child(2) {
    transform: rotate(-45deg) translate(3px, -3px);
}

/* ========================================
   Mobile Drawer
   ======================================== */
.sh-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 240px;
    background: var(--sh-brown);
    z-index: 1005;
    transform: translateX(100%);
    transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    overflow-y: auto;
    display: none;
}

.sh-drawer.active {
    transform: translateX(0);
}

.sh-drawer-inner {
    padding: 5rem 2rem 2rem;
}

.sh-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 16, 16, 0.5);
    z-index: 1004;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    display: none;
}

.sh-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   Mobile Navigation
   ======================================== */
.sh-mobile-nav {
    display: flex;
    flex-direction: column;
}

.sh-mobile-link {
    display: block;
    padding: 0.75rem 0;
    font-family: var(--font-primary, 'Montserrat', sans-serif);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--sh-cream);
    text-decoration: none !important;
    background: none;
    border: none;
    cursor: pointer;
    text-align: right;
    width: 100%;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    border-bottom: 1px solid rgba(245, 245, 220, 0.06);
}

.sh-mobile-link:link,
.sh-mobile-link:visited,
.sh-mobile-link:hover,
.sh-mobile-link:active {
    text-decoration: none !important;
}

.sh-mobile-link:hover {
    color: var(--sh-chartreuse);
    padding-right: 0.5rem;
}

.sh-mobile-link--primary {
    font-size: 1.25rem;
    font-weight: 600;
}

.sh-mobile-link--accent {
    color: var(--sh-chartreuse);
}

.sh-mobile-section {
    margin: 0.75rem 0;
}

.sh-mobile-label {
    display: block;
    font-family: var(--font-primary, 'Montserrat', sans-serif);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(245, 245, 220, 0.4);
    padding: 0.5rem 0;
    text-align: right;
}

.sh-mobile-section .sh-mobile-link {
    font-size: 0.95rem;
    font-weight: 400;
    padding: 0.625rem 0;
}

.sh-mobile-divider {
    height: 1px;
    background: rgba(245, 245, 220, 0.08);
    margin: 1rem 0;
}

/* ========================================
   Focus States
   ======================================== */
.sh-nav-link:focus-visible,
.sh-avatar:focus-visible,
.sh-dropdown-link:focus-visible,
.sh-burger:focus-visible,
.sh-mobile-link:focus-visible {
    outline: 2px solid var(--sh-chartreuse);
    outline-offset: 4px;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 960px) {
    .sh {
        padding: 1.25rem 1.5rem;
    }

    .sh--scrolled {
        padding: 1rem 1.5rem;
    }

    .sh-nav {
        display: none !important;
    }

    .sh-drawer,
    .sh-overlay {
        display: block;
    }

    .sh-drawer {
        max-width: 200px;
    }

    .sh-avatar-menu {
        display: none !important;
    }
}

/* ========================================
   Reduced Motion
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    * {
        transition-duration: 0.1s !important;
        animation-duration: 0.1s !important;
    }
}

/* ========================================
   Utility
   ======================================== */
body.sh-menu-open {
    overflow: hidden;
}

/* Raise header above drawer so burger (X) stays clickable */
body.sh-menu-open .sh {
    z-index: 1006;
}

body.questionnaire-active .sh,
body.questionnaire-active .sh-drawer,
body.questionnaire-active .sh-overlay {
    display: none;
}
