/* --- public/css/header.css --- */
.site-header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light, #E1E8ED);
    z-index: 1000;
    height: 76px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.header-container {
    width: 100%;
    max-width: var(--max-width, 1200px);
    margin: 0 auto;
    padding: 0 20px; 
    display: flex;
    align-items: center;
    flex-wrap: wrap; /* Allows wrapping on smaller screens */
}

/* Logo Styling */
.logo {
    margin-right: 40px; 
}

.logo a {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    line-height: 1.1;
}

.logo-zh {
    font-size: 1.4rem;
    font-weight: 800;
    background: var(--brand-gradient);
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.logo-en {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 2px;
}

/* Navigation Links */
.main-nav {
    display: flex;
    gap: 28px;
}

.nav-item {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.nav-item:hover {
    color: var(--brand-accent); 
}

/* Discord Login Button Area */
.auth-section {
    margin-left: auto; /* Pushes the auth button to the far right on desktop */
}

.btn-discord {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #5865F2; 
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 50px; 
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3);
}

.btn-discord:hover {
    background-color: #4752c4;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(88, 101, 242, 0.4);
}

.btn-discord i {
    font-size: 1.1rem;
}

/* =========================================
   MOBILE RESPONSIVENESS (Two-Story Header)
   ========================================= */
@media (max-width: 768px) {
    .site-header {
        height: auto; 
        padding: 12px 0; 
    }

    .header-container {
        padding: 0 16px; 
        justify-content: space-between; /* Ensures Logo and Auth sit on opposite edges */
    }
    
    /* 1. Keep Logo on the Top Left */
    .logo {
        margin-right: 0;
        order: 1; 
    }

    /* 2. Pull Auth Section to the Top Right */
    .auth-section {
        order: 2;
        margin-left: 0; 
    }

    /* 3. Push Navigation down to the Second Row */
    .main-nav {
        order: 3; 
        width: 100%; 
        justify-content: center; 
        gap: 20px;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid var(--border-light, #E1E8ED); 
    }
    
    .logo-zh {
        font-size: 1.25rem;
    }
    
    .logo-en {
        font-size: 0.6rem;
    }

    /* Transform Discord button into a circle */
    .btn-discord span { 
        display: none; 
    }
    
    .btn-discord {
        width: 40px;
        height: 40px;
        padding: 0;
        border-radius: 50%;
        justify-content: center;
    }
    
    .nav-item {
        font-size: 0.9rem; 
    }
}