/* ===== CSS Variables ===== */
:root {
    --primary-color: #1a365d;
    --secondary-color: #7c3aed;
    --accent-color: #ffffff;
    --text-dark: #2d3748;
    --text-light: #718096;
    --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    --gradient-secondary: linear-gradient(135deg, var(--secondary-color) 0%, #a855f7 100%);
    --shadow-soft: 0 10px 25px rgba(0,0,0,0.1);
    --shadow-strong: 0 25px 50px rgba(0,0,0,0.15);
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
}

body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* ===== HEADER - FIXED ALIGNMENT ===== */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 16px 5vw;
    background: rgba(26, 54, 93, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    z-index: 1000;
    transition: var(--transition);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* CRITICAL FIX: Header Container Alignment */
.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 48px; /* FIXED HEIGHT for consistent alignment */
    position: relative;
}

/* LOGO - LEFT ALIGNED */
.logo {
    font-size: clamp(20px, 4.5vw, 28px);
    font-weight: 800;
    color: var(--accent-color);
    text-shadow: 0 2px 20px rgba(124, 58, 237, 0.5);
    position: relative;
    transition: var(--transition);
    z-index: 1001;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.2;
    display: flex;
    align-items: center;
    height: 100%; /* MATCH parent height */
}

.logo::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--gradient-secondary);
    transition: var(--transition);
    border-radius: 2px;
}

.logo:hover::after {
    width: 100%;
}

/* MOBILE MENU TOGGLE - RIGHT ALIGNED */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    transition: var(--transition);
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    position: relative;
}

.mobile-menu-toggle span {
    width: 26px;
    height: 3px;
    background: var(--accent-color);
    border-radius: 3px;
    transition: var(--transition);
    display: block;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* NAVIGATION - DESKTOP */
.nav-menu {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: clamp(15px, 3vw, 40px);
}

.nav-menu a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    padding: 12px 0;
    transition: var(--transition);
    min-height: 44px;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.nav-menu a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--secondary-color);
    transition: var(--transition);
    transform: translateX(-50%);
}

.nav-menu a:hover::before {
    width: 100%;
}

.nav-menu a.active,
.nav-menu a[style*="color: rgb(124, 255, 255)"] {
    color: rgb(124, 255, 255) !important;
}

.nav-menu a.active::before,
.nav-menu a[style*="color: rgb(124, 255, 255)"]:not(.login-btn)::before {
    width: 100%;
    background: rgb(124, 255, 255);
}

.login-btn::before {
    display: none !important;
}

/* LOGIN BUTTON - DESKTOP */
.login-btn {
    padding: 16px 36px;
    border: 2px solid var(--secondary-color);
    color: var(--accent-color) !important;
    border-radius: 50px;
    background: linear-gradient(135deg, #7b2aaa, #7494ec);
    font-weight: 600;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    min-height: 52px;
    font-size: 1rem;
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4);
}

.login-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: left 0.6s ease;
}

.login-btn:hover::before {
    left: 100%;
}

.login-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(124, 58, 237, 0.6);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* ===== RESPONSIVE - TABLET & MOBILE ===== */

/* Desktop - Large Screens */
@media (min-width: 1025px) {
    header {
        padding: 16px clamp(30px, 5vw, 50px);
    }

    .login-btn {
        padding: 18px 40px !important;
        border-radius: 50px !important;
        min-height: 54px !important;
        font-size: 1.05rem !important;
        box-shadow: 0 10px 35px rgba(124, 58, 237, 0.5) !important;
    }
    
    .login-btn:hover {
        transform: translateY(-3px) !important;
        box-shadow: 0 15px 45px rgba(124, 58, 237, 0.7) !important;
    }
}

/* TABLETS AND BELOW - MOBILE MENU */
@media (max-width: 1024px) {
    header {
        padding: 14px 20px;
    }

    .header-container {
        height: 50px; /* Slightly taller on mobile */
    }

    .logo {
        font-size: 22px;
    }

    .mobile-menu-toggle {
        display: flex;
    }
    
    /* MOBILE MENU OVERLAY */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(340px, 85vw);
        height: 100vh;
        background: rgba(26, 54, 93, 0.98);
        backdrop-filter: blur(30px) saturate(200%);
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 100px 35px 40px;
        gap: 0; /* REMOVED gap - using margin instead */
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
        overflow-y: auto;
        z-index: 999; /* Below hamburger (1001) */
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    /* MOBILE MENU LINKS - VISIBLE */
    .nav-menu a {
        width: 100%;
        padding: 18px 0;
        font-size: 1.1rem;
        font-weight: 600;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        color: var(--accent-color) !important;
        display: block;
        line-height: 1.4;
        margin: 0; /* CRITICAL: Remove any margin */
        opacity: 1 !important; /* Force visibility */
        visibility: visible !important; /* Force visibility */
    }
    
    .nav-menu a::before {
        left: 0;
        transform: translateX(0);
        bottom: 0;
    }
    
    .nav-menu a:hover::before,
    .nav-menu a.active::before,
    .nav-menu a[style*="color: rgb(124, 255, 255)"]:not(.login-btn)::before {
        width: 60px;
    }
    
    /* LOGIN BUTTON IN MOBILE MENU */
    .login-btn {
        width: 100% !important;
        text-align: center !important;
        justify-content: center !important;
        margin-top: 20px !important;
        padding: 18px 32px !important;
        font-size: 1.1rem !important;
        min-height: 56px !important;
        border-radius: 50px !important;
        border-bottom: none !important;
    }
}

/* LARGE PHONES */
@media (max-width: 768px) {
    header {
        padding: 13px 18px;
    }
    
    .header-container {
        height: 48px;
    }
    
    .logo {
        font-size: 21px;
    }

    .mobile-menu-toggle {
        width: 46px;
        height: 46px;
        gap: 5px;
    }

    .mobile-menu-toggle span {
        width: 26px;
        height: 3px;
    }

    .nav-menu {
        padding: 90px 30px 35px;
    }

    .nav-menu a {
        font-size: 1.05rem;
        padding: 16px 0;
    }
    
    .login-btn {
        padding: 16px 30px !important;
        font-size: 1.05rem !important;
        min-height: 52px !important;
    }
}

/* MEDIUM PHONES */
@media (max-width: 640px) {
    header {
        padding: 12px 16px;
    }

    .header-container {
        height: 46px;
    }

    .logo {
        font-size: 20px;
    }

    .mobile-menu-toggle {
        width: 44px;
        height: 44px;
        gap: 4.5px;
    }

    .mobile-menu-toggle span {
        width: 24px;
        height: 2.5px;
    }

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

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .nav-menu {
        width: 90vw;
        padding: 85px 28px 30px;
    }

    .nav-menu a {
        font-size: 1rem;
        padding: 15px 0;
    }

    .login-btn {
        padding: 15px 28px !important;
        font-size: 1rem !important;
        min-height: 50px !important;
    }
}

/* SMALL PHONES */
@media (max-width: 480px) {
    header {
        padding: 11px 15px;
    }
    
    .header-container {
        height: 44px;
    }
    
    .logo {
        font-size: 19px;
    }

    .mobile-menu-toggle {
        width: 42px;
        height: 42px;
        gap: 4px;
    }

    .mobile-menu-toggle span {
        width: 23px;
        height: 2.5px;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: translateY(6.5px) rotate(45deg);
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: translateY(-6.5px) rotate(-45deg);
    }
    
    .nav-menu {
        width: 100%;
        padding: 80px 25px 25px;
    }
    
    .nav-menu a {
        font-size: 0.95rem;
        padding: 14px 0;
    }
    
    .login-btn {
        padding: 14px 26px !important;
        font-size: 0.95rem !important;
        min-height: 48px !important;
    }
}

/* EXTRA SMALL DEVICES */
@media (max-width: 360px) {
    header {
        padding: 10px 12px;
    }

    .header-container {
        height: 42px;
    }

    .logo {
        font-size: 18px;
    }

    .mobile-menu-toggle {
        width: 40px;
        height: 40px;
        gap: 4px;
    }

    .mobile-menu-toggle span {
        width: 22px;
        height: 2px;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }
    
    .login-btn {
        padding: 13px 24px !important;
        font-size: 0.9rem !important;
        min-height: 46px !important;
    }
}

/* TECNO SPARK 10C FIX (361px-414px) */
@media (min-width: 361px) and (max-width: 414px) {
    header {
        padding: 13px 17px;
    }

    .header-container {
        height: 46px;
    }

    .logo {
        font-size: 20px;
        line-height: 1.2;
    }

    .mobile-menu-toggle {
        width: 44px;
        height: 44px;
        gap: 4.5px;
    }

    .mobile-menu-toggle span {
        width: 24px;
        height: 2.5px;
    }

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

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .nav-menu {
        width: 85vw;
        padding: 85px 28px 30px;
    }

    .nav-menu a {
        font-size: 1.05rem;
        padding: 16px 0;
    }

    .login-btn {
        padding: 16px 30px !important;
        font-size: 1.05rem !important;
        min-height: 52px !important;
    }
}

/* DISABLE HOVER ON TOUCH DEVICES */
@media (hover: none) and (pointer: coarse) {
    .login-btn:hover {
        transform: none !important;
        box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4) !important;
    }
    
    .nav-menu a:hover::before {
        width: 0;
    }
    
    .logo:hover::after {
        width: 0;
    }
}

/* LANDSCAPE ORIENTATION */
@media (max-width: 896px) and (orientation: landscape) {
    header {
        padding: 10px 15px;
    }

    .header-container {
        height: 40px;
    }

    .logo {
        font-size: 18px;
    }

    .mobile-menu-toggle {
        width: 40px;
        height: 40px;
    }

    .nav-menu {
        width: min(320px, 50vw);
        padding: 70px 25px 20px;
    }

    .nav-menu a {
        padding: 12px 0;
        font-size: 0.95rem;
    }

    .login-btn {
        padding: 12px 24px !important;
        font-size: 0.95rem !important;
        min-height: 44px !important;
    }
}


/* PRINT */
@media print {
    header {
        position: relative;
        background: var(--primary-color);
    }
    
    .mobile-menu-toggle {
        display: none;
    }
}