/* Global Header Styles */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    padding: 0 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(25px);
    background: rgba(15, 23, 42, 0.25);
    border-bottom: 1px solid rgba(37, 99, 255, 0.2);
    z-index: 100;
}

.logo-box {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: var(--text, #e2e8f0);
}

.logo-box span {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: .5px;
}

.logo-icon {
    height: 48px;
    width: auto;
    /* Allow horizontal logos */
    max-width: 200px;
    /* Prevent too wide */
    display: flex;
    align-items: center;
}

.logo-icon img {
    height: 100%;
    width: auto;
    object-fit: contain;
    /* Preserve aspect ratio */
    margin-top: 8px;
    /* Push logo slightly lower */
}

/* Desktop navigation (inside header-right) */
.header-right nav {
    display: flex;
    align-items: center;
}

.header-right nav a {
    color: var(--text2, #94a3b8);
    margin-left: 2.5rem;
    text-decoration: none;
    font-weight: 500;
    transition: .3s;
    position: relative;
}

.header-right nav a:hover,
.header-right nav a.active {
    color: white;
}

.header-right nav a.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent, #2563ff);
    border-radius: 2px;
}

/* Global Particles Background */
#particles {
    position: fixed;
    inset: 0;
    z-index: -2;
}

/* ==================== HAMBURGER BUTTON ==================== */

.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.hamburger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text, #e2e8f0);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Hamburger animation when active */
.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ==================== MOBILE MENU ==================== */

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    z-index: 999;
    padding: 80px 24px 24px;
    transition: right 0.3s ease;
    border-left: 1px solid rgba(37, 99, 255, 0.2);
}

.mobile-menu.active {
    right: 0;
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
}


.mobile-nav a {
    color: var(--text2, #94a3b8);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 12px 32px;
    border-radius: 8px;
    transition: all 0.2s;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}


.mobile-nav a:hover,
.mobile-nav a.active {
    color: white;
    background: rgba(37, 99, 255, 0.15);
}

.mobile-auth {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    width: 100%;
}

.mobile-auth-link {
    color: var(--text2, #94a3b8);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 12px 16px;
    border-radius: 8px;
    transition: all 0.2s;
    text-align: center;
    width: 100%;
}

.mobile-auth-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.mobile-auth-btn {
    display: block;
    padding: 14px 24px;
    border-radius: 8px;
    background: var(--accent, #2563ff);
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    transition: all 0.3s;
    width: 100%;
}

.mobile-auth-btn:hover {
    background: #1d4ed8;

}

/* ==================== MOBILE RESPONSIVE HEADER ==================== */

@media (max-width: 768px) {
    header {
        height: 60px;
        padding: 0 3%;
    }

    .logo-box {
        gap: 10px;
    }

    .logo-box span {
        font-size: 1.1rem;
    }

    .logo-icon {
        height: 36px;
        width: auto;
        max-width: 150px;
    }

    .logo-icon img {
        height: 100%;
        width: auto;
        object-fit: contain;
    }

    /* Hide desktop navigation on mobile */
    .header-right {
        display: none !important;
    }

    /* Show hamburger button */
    .hamburger-btn {
        display: flex;
    }

    /* Show mobile menu structure */
    .mobile-menu {
        display: block;
    }
}

@media (max-width: 480px) {
    header {
        height: 56px;
        padding: 0 3%;
    }

    .logo-box {
        gap: 8px;
    }

    .logo-box span {
        font-size: 0.95rem;
    }

    .logo-icon {
        height: 32px;
        width: auto;
        max-width: 120px;
    }

    .mobile-menu {
        width: 100%;
        right: -100%;
    }
}

/* Very small screens - logo text still visible */