/* Header Styles */
:root {
    --primary: #DEB130;
    --primary-hover: rgba(199, 154, 37, 0.7);
    --text: #0d141c;
    --bg: #f8fafc;
    --glass: rgba(166, 166, 166, 0.6);
    --header-height: 74px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 12px 40px;
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: var(--header-height);
    width: 100%;
    background-color: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateY(0);
    transition: transform 0.3s ease, background-color 0.3s ease, padding 0.3s ease;
    will-change: transform, background-color;
    flex-wrap: nowrap;
}

.header.hidden {
    transform: translateY(-100%);
}

.header.scrolled {
    background-color: rgba(166, 166, 166, 0.8);
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    cursor: pointer;
    touch-action: manipulation;
}

.logo-link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
    border-radius: 8px;
}

.logo-img {
    height: clamp(50px, 7vw, 70px);
    width: auto;
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.05);
}

.logo-link:active .logo-img {
    transform: scale(0.97);
}

.nav-links {
    display: flex;
    flex: 1 1 auto;
    justify-content: center;
    align-items: center;
    gap: clamp(0.75rem, 1.5vw, 2.2rem);
    min-width: 0;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    flex-shrink: 0;
}

.mobile-menu-btn {
    display: none;
    position: relative;
    width: 46px;
    height: 46px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 8px;
    border: 1px solid rgba(17, 24, 39, 0.35);
    background: linear-gradient(180deg, #dadada 0%, #bfbfbf 100%);
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.6),
        inset 0 -2px 4px rgba(0, 0, 0, 0.15),
        0 2px 6px rgba(0, 0, 0, 0.15);
    justify-content: center;
    align-items: center;
    padding: 10px;
    gap: 4px;
    flex-direction: column;
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.mobile-menu-btn:hover {
    background: linear-gradient(180deg, #e2e2e2 0%, #c9c9c9 100%);
    border-color: rgba(17, 24, 39, 0.45);
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.7),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2),
        0 6px 18px rgba(15, 23, 42, 0.2);
}

.mobile-menu-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

.mobile-menu-btn.active {
    background: linear-gradient(180deg, #c3c3c3 0%, #a7a7a7 100%);
    border-color: rgba(17, 24, 39, 0.45);
}

.burger-line {
    width: 18px;
    height: 3px;
    background: #1f2933;
    border-radius: 999px;
    display: block;
    margin: 2px auto;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-menu-btn.active .burger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn.active .burger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active .burger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    padding: 0 18px 24px;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 99;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    overflow-y: auto;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.mobile-menu.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.mobile-menu-inner {
    margin: 88px auto 0;
    width: min(520px, 100%);
    background: rgba(248, 250, 252, 0.9);
    border-radius: 24px;
    padding: 32px 32px 40px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.25);
    display: flex;
    flex-direction: column;
    gap: 24px;
    color: var(--text);
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.mobile-nav-links .nav-link {
    font-size: clamp(1rem, 0.5vw + 0.95rem, 1.15rem);
    padding: 10px 0;
}

.mobile-auth {
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-top: 1px solid rgba(15, 23, 42, 0.1);
    padding-top: 20px;
}

.mobile-signin {
    width: 100%;
}

body.mobile-nav-open {
    overflow: hidden;
}

.nav-link {
    font-size: clamp(0.85rem, 0.3vw + 0.82rem, 1.02rem);
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    position: relative;
    padding: 6px 4px;
    transition: color 0.3s ease, transform 0.1s ease;
    white-space: nowrap;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link:active {
    transform: scale(0.96);
}

.nav-link.active {
    color: var(--primary);
}

.nav-link.active::after {
    width: 100%;
}

.signin-btn {
    background-color: rgba(222, 177, 48, 0.6);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    min-width: 84px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.signin-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
}

.signin-btn:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 6px 16px rgba(222, 177, 48, 0.3);
}

.signin-btn:hover::before {
    left: 100%;
}

.signin-btn:active {
    transform: scale(0.96);
}

.signin-btn.is-hidden {
    display: none !important;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-wrap: nowrap;
    max-width: clamp(160px, 20vw, 240px);
    min-width: 0;
    flex: 0 1 auto;
}

.user-section[hidden] {
    display: none !important;
}

.username {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn {
    flex-shrink: 0;
}

.logout-btn {
    background-color: #dc3545 !important;
    color: white !important;
    border: 1px solid #dc3545 !important;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    min-width: 84px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3) !important;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.logout-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
}

.logout-btn:hover {
    background-color: #c82333 !important;
    border-color: #c82333 !important;
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.4) !important;
}

.logout-btn:hover::before {
    left: 100%;
}

.logout-btn:active {
    transform: scale(0.96);
}

.mobile-user-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.06);
}

.mobile-user-section .username {
    text-align: center;
    font-size: 1rem;
}

.mobile-user-section[hidden] {
    display: none !important;
}

.mobile-logout {
    width: 100%;
    text-align: center;
}

/* Responsive styles */
@media (max-width: 1200px) {
    .header {
        padding: 12px 32px;
    }

    .nav-links {
        gap: clamp(0.9rem, 1.5vw, 2rem);
    }

    .nav-link {
        font-size: clamp(0.82rem, 0.28vw + 0.78rem, 0.98rem);
    }

    .user-section {
        max-width: clamp(150px, 18vw, 210px);
    }
}

@media (max-width: 1024px) {
    .logo-img {
        height: clamp(48px, 6vw, 62px);
    }

    .nav-links {
        gap: clamp(0.75rem, 1.2vw, 1.5rem);
    }

    .user-section {
        max-width: clamp(130px, 22vw, 190px);
    }
}

@media (max-width: 900px) {
    .nav-links,
    .header-actions {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .header {
        padding: 12px 20px;
    }
}

@media (max-width: 600px) {
    .header {
        padding: 10px 16px;
    }

    .logo-img {
        height: 48px;
    }

    .mobile-menu-inner {
        margin-top: 72px;
        padding: 28px 20px 32px;
        max-width: 100%;
    }
}

@media (max-width: 480px) and (orientation: landscape) {
    .header {
        padding: 8px 12px;
    }

    .logo-img {
        height: 44px;
    }

    .mobile-menu-inner {
        margin-top: 64px;
        max-height: calc(100vh - 64px);
        overflow-y: auto;
    }
}

