/* Navbar */
.navbar {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 95%;
    padding: 1rem 0;
    max-width: 100%;
}

.logo {
    font-weight: 700;
    font-size: 1.3rem;
    color: #2563eb;
}

/* Nav Menu */
.nav-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: #111827;
    font-weight: 500;
    /* Removal : start */
    padding: 0.5rem;
    transition: color 0.2s ease;
    /* Removal : end */

    /* Addition : start */
    padding: 0.6rem 0.9rem;
    border-radius: 6px;
    /* soft corners for hover effect */
    transition: background 0.2s ease, color 0.2s ease;
    /* Addition : end */
}

.nav-menu a:hover {
    color: #2563eb;
    /* Addition : start */
    background: #f3f4f6;
    /* Addition : end */
}

/* Dropdown link hover (inside submenu) */
.nav-menu .dropdown a:hover {
    background: #e5e7eb;
    /* slightly darker hover for submenu */
    color: #2563eb;
}

/* Dropdowns */
.has-dropdown {
    position: relative;
}

.has-dropdown>a::after {
    content: " ▾";
    font-size: 0.7rem;
}

.dropdown {
    display: none;
    position: absolute;
    top: 110%;
    left: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .05);
    min-width: 180px;
    z-index: 500;
}

.dropdown li {
    padding: 0;
}

.dropdown a {
    display: block;
    padding: 0.7rem 1rem;
    white-space: nowrap;
}

.dropdown a:hover {
    background: #f3f4f6;
}

/* Show dropdown on hover (desktop) */
.has-dropdown:hover>.dropdown {
    display: block;
}

/* Nested dropdown (second level) */
.dropdown .has-dropdown {
    position: relative;
}

.dropdown .has-dropdown>.dropdown {
    top: 0;
    left: 100%;
    margin-left: 5px;
}

/* Hamburger (hidden on desktop) */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: #111827;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Mobile styles */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 75px;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        border-top: 1px solid #e5e7eb;
    }

    .nav-menu ul {
        flex-direction: column;
        gap: 0;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu a {
        display: block;
        padding: 1rem;
    }

    /* Hide all dropdowns by default */
    .nav-menu .dropdown {
        display: none;
        position: absolute;
        top: 110%;
        left: 0;
        background: white;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, .05);
        min-width: 180px;
        z-index: 500;
    }

    .nav-menu .has-dropdown.open>.dropdown {
        display: block;
    }

    .nav-menu .has-dropdown.close>.dropdown {
        display: none;
    }
}

/* Show dropdown only on hover */
.nav-menu .has-dropdown:hover>.dropdown {
    display: block;
}

/* Nested dropdown (second level) */
.nav-menu .dropdown .has-dropdown {
    position: relative;
}

.nav-menu .dropdown .has-dropdown>.dropdown {
    top: 0;
    left: 100%;
    margin-left: 5px;
}

/* Force all dropdowns hidden by default */
.nav-menu ul ul {
    display: none !important;
    position: absolute;
    top: 110%;
    left: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .05);
    min-width: 180px;
    z-index: 500;
    padding: 0;
    margin: 0;
}

/* Show only the hovered dropdown */
.nav-menu li.has-dropdown:hover>ul {
    display: block !important;
}

/* Nested dropdowns */
.nav-menu ul ul ul {
    top: 0;
    left: 100%;
    margin-left: 5px;
}

/* Show dropdown when .open class is added */
.nav-menu li.has-dropdown.open>ul {
    display: block !important;
}

.nav-menu li.has-dropdown.close>ul {
    display: none !important;
}

/* Active state for menu items */
.nav-menu a.active {
    background: #2563eb;
    /* brand blue background */
    color: #fff !important;
    /* white text for contrast */
    border-radius: 6px;
}

/* Active state for dropdown links */
.nav-menu .dropdown a.active {
    background: #2563eb;
    color: #fff !important;
}