/* Add this at the top for better mobile handling */
html, body {
    overflow-x: hidden;
    width: 100%;
}

#main-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--dark-bg);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    transition: all 0.4s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#main-navbar.navbar-scrolled {
    padding: 10px 0;
    background: var(--darker-bg);
}

/* Nav Container */
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: visible;
}

/* Brand Logo */
.navbar-brand {
    color: var(--white);
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    white-space: nowrap;
    z-index: 1002;
}

.navbar-logo {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    border: 2px solid var(--primary-color);
    object-fit: cover;
    flex-shrink: 0;
}

/* ============================================= */
/* HAMBURGER MENU - FIXED FOR VISIBILITY */
/* ============================================= */

/* Hamburger Toggle Button - COMPLETELY FIXED */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 44px;
    height: 44px;
    padding: 0;
    z-index: 1100;
    flex-shrink: 0;
    position: relative;
    transition: all 0.3s ease;
}

.nav-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
}

.nav-toggle:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Hamburger lines - MADE THICKER AND MORE VISIBLE */
.hamburger-line {
    display: block;
    width: 25px; /* Fixed width */
    height: 4px; /* THICKER - was 3px */
    background: #ffffff !important; /* Force white color */
    margin: 4px 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 3px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.5); /* Add shadow for contrast */
}

/* Position each line */
.hamburger-line:nth-child(1) {
    top: 12px;
}

.hamburger-line:nth-child(2) {
    top: 20px;
}

.hamburger-line:nth-child(3) {
    top: 28px;
}

/* X animation when active */
.nav-toggle.active .hamburger-line:nth-child(1) {
    transform: translateX(-50%) rotate(45deg);
    top: 20px;
    background: #ffffff !important;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}

.nav-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: translateX(-50%) scale(0);
}

.nav-toggle.active .hamburger-line:nth-child(3) {
    transform: translateX(-50%) rotate(-45deg);
    top: 20px;
    background: #ffffff !important;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 5px;
}

.nav-item {
    position: relative;
}

/* Nav Links */
.nav-link {
    color: var(--white) !important;
    font-weight: 500;
    font-size: 1rem;
    padding: 8px 15px !important;
    transition: var(--transition);
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    display: inline-block;
    border-radius: 4px;
    white-space: nowrap;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color) !important;
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.05);
}

/* Dropdown Styles */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
}

.dropdown-arrow {
    font-size: 0.8rem;
    transition: var(--transition);
}

.dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 250px;
    background: black;
    color: white;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 1001;
    list-style: none;
    margin-top: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    color: var(--white);
    padding: 10px 20px;
    transition: var(--transition);
    border-radius: 5px;
    text-decoration: none;
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
}

.dropdown-item:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateX(5px);
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 10px 0;
    border: none;
}

/* Desktop hover effect for dropdown */
@media (min-width: 993px) {
    .dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

/* ============================================= */
/* MOBILE RESPONSIVE - FIXED */
/* ============================================= */
@media (max-width: 992px) {
    /* SHOW THE HAMBURGER BUTTON CLEARLY */
    .nav-toggle {
        display: flex !important; /* Force display */
        align-items: center !important;
        justify-content: center !important;     
    }
    
    /* Ensure hamburger lines are visible */
    .hamburger-line {
        background: #ffffff !important; /* Force white */
        height: 4px !important; /* Thicker */
        width: 25px !important;
    }

    /* Mobile menu container */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        max-width: 350px;
        height: 100vh;
        background: var(--darker-bg);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: flex-start;
        padding: 100px 20px 40px;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        overflow-x: hidden;
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
        z-index: 1050;
        -webkit-overflow-scrolling: touch;
        visibility: hidden;
    }

    .nav-menu.active {
        right: 0;
        visibility: visible;
    }

    /* Backdrop overlay for mobile menu */
    .nav-menu::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.7);
        z-index: -1;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .nav-menu.active::before {
        opacity: 1;
        visibility: visible;
    }

    .nav-list {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }

    .nav-item {
        width: 100%;
    }

    .nav-link {
        padding: 15px !important;
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        white-space: normal;
        font-size: 1.1rem;
    }

    .dropdown-menu {
        position: static;
        opacity: 0;
        visibility: hidden;
        transform: none;
        background: rgba(30, 30, 30, 0.95);
        border: none;
        border-radius: 0;
        margin-top: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, opacity 0.3s ease;
        padding: 0;
        width: 100%;
        box-shadow: none;
        border-left: 3px solid var(--primary-color);
    }

    .dropdown-menu.show {
        opacity: 1;
        visibility: visible;
        max-height: 500px;
        padding: 10px 0;
    }

    .dropdown-item {
        padding: 12px 25px;
        border-radius: 0;
        font-size: 1rem;
    }

    .dropdown-divider {
        margin: 8px 25px;
    }

    .navbar-brand span {
        font-size: 1.5rem;
    }

    /* Prevent body scroll when menu is open */
    body.menu-open {
        overflow: hidden;
    }

    #main-navbar {
        z-index: 1000;
    }
}

/* Extra Small Screens */
@media (max-width: 650px) {
    .nav-container {
        padding: 0 15px;
    }
    
    .navbar-brand span {
        font-size: 1.3rem;
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .navbar-logo {
        width: 50px;
        height: 50px;
    }
    
    .nav-menu {
        max-width: 300px;
        padding: 90px 15px 30px;
    }
    
    .nav-link {
        font-size: 1rem;
        padding: 12px 15px !important;
    }
}

@media (max-width: 480px) {
    .navbar-brand span {
        font-size: 1.1rem;
        max-width: 150px;
    }
    
    .nav-menu {
        padding: 80px 15px 30px;
        max-width: 280px;
    }
    
    .nav-link {
        font-size: 0.95rem;
        padding: 12px 15px !important;
    }
    
    .dropdown-item {
        padding: 10px 20px;
    }
    
    /* Make hamburger even more visible on very small screens */
    .nav-toggle {
        width: 40px !important;
        height: 40px !important;
    }
    
    .hamburger-line {
        width: 22px !important;
        height: 3.5px !important;
    }
}