/* =====================================================
   UNIVERSAL NAVBAR CSS
   Ensures consistent header/navbar styling across all pages
   in both desktop and mobile views.
   
   IMPORTANT: This file should be loaded LAST among navbar CSS
   files to ensure it takes precedence.
   ===================================================== */

/* ========== BODY STATE FOR MOBILE MENU ========== */
body.nav-open {
    overflow: hidden !important;
}

/* ========== BASE HEADER STYLES ========== */
header {
    padding: 10px 0 !important;
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: fixed !important;
    width: 100% !important;
    top: 0 !important;
    z-index: 1000 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

nav {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    position: relative;
    min-height: 60px !important;
}

/* ========== LOGO STYLES ========== */
.logo {
    cursor: pointer;
    display: flex;
    align-items: center;
}

.logo img {
    width: 120px !important;
    height: auto !important;
    transition: transform 0.3s ease;
}

.logo:hover img {
    transform: scale(1.02);
}

/* ========== HAMBURGER MENU STYLES ========== */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.hamburger span,
.hamburger::before,
.hamburger::after {
    content: '';
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger:hover span,
.hamburger:hover::before,
.hamburger:hover::after {
    background: rgba(255, 255, 255, 0.8);
}

/* Hamburger animation when active */
.hamburger.active::before {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span {
    opacity: 0;
}

.hamburger.active::after {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ========== NAVIGATION LINKS ========== */
.nav-links {
    display: flex !important;
    gap: 25px !important;
    list-style: none !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.9) !important;
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: rgba(255, 255, 255, 0.9) !important;
    background-clip: unset !important;
    text-decoration: none !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    transition: all 0.3s ease;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    display: inline-block !important;
    line-height: 1.4 !important;
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    transform: none !important;
}

/* ========== PROFILE CONTAINER ========== */
.profile-container {
    position: relative;
    display: flex;
    align-items: center;
}

.profile-pic {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #E31837, #FF6B6B);
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.profile-pic:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.profile-initials {
    color: white;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
}

.profile-dropdown {
    display: none;
    position: absolute;
    top: 50px;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    min-width: 150px;
}

.profile-dropdown.active {
    display: block;
}

.profile-dropdown a,
.profile-dropdown button {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
}

.profile-dropdown a:hover,
.profile-dropdown button:hover {
    background: #f5f5f5;
    color: #E31837;
}

/* =====================================================
   RESPONSIVE BREAKPOINTS - MOBILE FULL-SCREEN MENU
   ===================================================== */

@media (max-width: 768px) {
    nav {
        display: flex !important;
        justify-content: center !important;
        position: relative !important;
        align-items: center !important;
        min-height: 60px !important;
        padding: 0 15px !important;
    }

    .logo {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        flex-grow: 1 !important;
        position: relative !important;
        z-index: 1002 !important;
    }

    .hamburger {
        display: flex !important;
        position: absolute !important;
        left: 15px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 1003 !important;
    }

    .profile-container {
        position: absolute !important;
        right: 15px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 1003 !important;
    }

    .profile-pic {
        position: static !important;
        transform: none !important;
    }

    /* Full-screen mobile menu */
    .nav-links {
        display: none !important;
        flex-direction: column !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        height: 100dvh !important;
        background: linear-gradient(135deg, #1E3A8A 0%, #4338CA 50%, #E31837 100%) !important;
        padding: 100px 30px 30px !important;
        z-index: 1001 !important;
        justify-content: flex-start !important;
        align-items: center !important;
        gap: 0 !important;
        overflow-y: auto !important;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease !important;
    }

    .nav-links.active {
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .nav-links li {
        width: 100% !important;
        max-width: 300px !important;
        text-align: center !important;
        margin: 8px 0 !important;
    }

    .nav-links a {
        display: block !important;
        padding: 18px 24px !important;
        font-size: 18px !important;
        color: #fff !important;
        -webkit-text-fill-color: #fff !important;
        background: rgba(255, 255, 255, 0.1) !important;
        border-radius: 12px !important;
        font-weight: 600 !important;
        letter-spacing: 0.5px;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        transition: all 0.3s ease !important;
    }

    .nav-links a:hover,
    .nav-links a.active {
        background: rgba(255, 255, 255, 0.25) !important;
        border-color: rgba(255, 255, 255, 0.4) !important;
        transform: scale(1.02);
        -webkit-text-fill-color: #fff !important;
    }

    .profile-dropdown {
        top: 50px !important;
        right: 0 !important;
    }
}

/* Small phones */
@media (max-width: 480px) {
    nav {
        padding: 0 10px !important;
    }

    .hamburger {
        left: 10px !important;
    }

    .profile-container {
        right: 10px !important;
    }

    .nav-links {
        padding: 90px 20px 20px !important;
    }

    .nav-links a {
        font-size: 16px !important;
        padding: 16px 20px !important;
    }
}

/* Very small phones */
@media (max-width: 360px) {
    .logo img {
        width: 100px !important;
    }

    .nav-links a {
        font-size: 15px !important;
        padding: 14px 16px !important;
    }
}
