/* Header Container */
.header {
    position: relative;
    z-index: 2;
    width: calc(100% - 32px);
    max-width: 1152px;
    margin: 12px auto 8px;
    padding: 14px 20px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
}

@media (min-width: 640px) {
    .header {
        width: calc(100% - 48px);
        margin: 16px auto 12px;
        padding: 16px 28px;
    }
}

@media (min-width: 1024px) {
    .header {
        width: calc(100% - 80px);
        margin: 20px auto 16px;
        padding: 18px 40px;
    }
}

/* Logo */
.header-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex: 0 0 auto;
}

.header-logo img {
    height: 24px;
    width: auto;
    display: block;
}

@media (min-width: 1024px) {
    .header-logo {
        flex: 1;
    }
}

/* Desktop Navigation */
.header-nav {
    display: none;
    gap: 32px;
    align-items: center;
    justify-content: center;
}

@media (min-width: 1024px) {
    .header-nav {
        display: flex;
        flex: 1;
    }
}

.header-nav a {
    font-weight: 300;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
    font-size: 0.9375rem;
}

.header-nav a:hover {
    color: #fff;
    font-weight: 500;
}

/* Desktop Login Button */
.header-login {
    display: none;
}

@media (min-width: 1024px) {
    .header-login {
        display: flex;
        flex: 1;
        justify-content: flex-end;
    }
}

.login-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.75rem;
    border-radius: 9999px;
    border: 1px solid rgba(167, 139, 250, 0.3);
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.15), rgba(66, 42, 213, 0.1));
    backdrop-filter: blur(8px);
    color: white;
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
    box-shadow: 0 2px 8px rgba(167, 139, 250, 0.1),
                0 0 0 0 rgba(167, 139, 250, 0);
    overflow: hidden;
}

.login-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    padding: 1px;
    background: linear-gradient(
        135deg,
        rgba(167, 139, 250, 0.4),
        rgba(66, 42, 213, 0.3),
        rgba(167, 139, 250, 0.4)
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box,
                  linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.login-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.2), rgba(66, 42, 213, 0.15));
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: -1;
}

.login-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(167, 139, 250, 0.5);
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.25), rgba(66, 42, 213, 0.2));
    box-shadow: 0 2px 8px rgba(167, 139, 250, 0.15),
                0 0 8px rgba(167, 139, 250, 0.08);
}

.login-btn:hover::before {
    opacity: 1;
}

.login-btn:hover::after {
    opacity: 1;
}

.login-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(167, 139, 250, 0.2);
}

.login-btn.connected {
    gap: 0.5rem;
}

.login-btn img,
.login-btn .user-initial {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-btn .user-initial {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

/* Hamburger Button (Mobile) */
.header-hamburger {
    display: flex;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-direction: column;
    gap: 4px;
}

.hamburger-bar {
    width: 20px;
    height: 2px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 1px;
    transition: all 0.15s ease;
    display: block;
    flex-shrink: 0;
}

@media (min-width: 1024px) {
    .header-hamburger {
        display: none;
    }
}

/* Mobile Menu Panel */
.mobile-menu-panel {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(26, 26, 46, 0.98);
    backdrop-filter: blur(10px);
    z-index: 100;
    padding: 24px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}

.mobile-menu-panel.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.mobile-menu-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
}

.mobile-menu-links {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
    margin-top: 24px;
}

.mobile-menu-links a {
    font-weight: 300;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.15s ease;
    padding: 8px 0;
}

.mobile-menu-links a:hover {
    color: #fff;
}

.mobile-menu-divider {
    width: 100%;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 16px 0;
}

.mobile-menu-login {
    margin-top: 16px;
}

.mobile-menu-login .login-btn {
    width: 100%;
    max-width: 100%;
    justify-content: center;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    box-sizing: border-box;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

