/* ============================================================
   ZAINIFY AI — Header — Dark Premium Glassmorphic Theme
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@700;800&display=swap');

/* Header Base */
header {
    background: rgba(11, 14, 20, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0;
    font-family: 'Inter', sans-serif;
    position: sticky;
    top: 0;
    z-index: 500;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
    gap: 12px;
}

/* Brand */
.header-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}

.brand-logo {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #a855f7, #6366f1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.02em;
}

.brand-badge {
    font-size: 0.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, #a855f7, #6366f1);
    color: white;
    padding: 2px 7px;
    border-radius: 99px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* User Info */
.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #94a3b8;
    flex-shrink: 0;
}

.user-welcome {
    font-size: 0.82rem;
    font-weight: 500;
    color: #94a3b8;
}

.user-balance {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(99, 102, 241, 0.2));
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #e2e8f0;
    padding: 5px 12px;
    border-radius: 99px;
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

/* Navigation */
.header-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    justify-content: center;
}

.nav-link {
    color: #94a3b8;
    text-decoration: none;
    padding: 7px 13px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.nav-link:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: #a855f7;
    background: rgba(168, 85, 247, 0.1);
    font-weight: 600;
}

.icon {
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.mobile-menu-btn:hover { background: rgba(255, 255, 255, 0.1); }

.mobile-menu-btn span {
    width: 18px;
    height: 2px;
    background: #e2e8f0;
    margin: 2px 0;
    transition: all 0.2s ease;
    border-radius: 2px;
    display: block;
}

/* Auth buttons in header */
.header-user a {
    text-decoration: none;
}

/* Responsive — Tablet */
@media (max-width: 968px) {
    .user-welcome { display: none; }
    .nav-link span:not(.icon) { display: none; }
    .nav-link { padding: 8px 10px; }
}

/* Responsive — Mobile */
@media (max-width: 768px) {
    .mobile-menu-btn { display: flex; }

    .header-nav {
        position: fixed;
        top: 64px;
        left: 0;
        width: 100%;
        background: rgba(11, 14, 20, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 16px;
        gap: 6px;
        transform: translateY(-110%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.28s cubic-bezier(0.4,0,0.2,1);
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        box-shadow: 0 8px 24px rgba(0,0,0,0.5);
        z-index: 400;
    }

    .header-nav.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: 12px 16px;
        font-size: 0.95rem;
        border-radius: 10px;
    }

    .nav-link span:not(.icon) { display: inline; }

    .nav-link:hover {
        background: rgba(255, 255, 255, 0.05);
        padding-left: 20px;
    }
}

@media (max-width: 480px) {
    .header-container { height: 58px; padding: 0 14px; }
    .brand-logo { font-size: 1.1rem; }
    .user-balance { font-size: 0.75rem; padding: 4px 10px; }
    .header-nav { top: 58px; }
}

/* Mobile menu open animation */
.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}