.hamburger-menu {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 22px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1001;
}

/* Add a pseudo-element to ensure full clickable area */
.hamburger-menu::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    z-index: -1;
}

.hamburger-menu span {
    display: block;
    width: 100%;
    height: 3px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    left: 0;
}

.hamburger-menu span:nth-child(1) {
    top: 0px;
    transform-origin: center;
}

.hamburger-menu span:nth-child(2) {
    top: 9px;
    transform-origin: center;
}

.hamburger-menu span:nth-child(3) {
    top: 18px;
    transform-origin: center;
}

.hamburger-menu:hover span {
    background: #fbbf24;
    opacity: 0.8;
}

.hamburger-menu:hover span:nth-child(1) {
    transform: translateY(-1px);
}

.hamburger-menu:hover span:nth-child(3) {
    transform: translateY(1px);
}

.hamburger-menu:active {
    transform: scale(0.95);
    width: 14px;
}

.hamburger-menu:active span {
    background: #fbbf24;
    transform: scaleX(0.95);
}

/* Animated Hamburger Menu (Active State) */
.hamburger-menu.active span:nth-child(1) {
    top: 9px;
    width: 0%;
    left: 50%;
}

.hamburger-menu.active span:nth-child(2) {
    top: 9px;
    transform: rotate(45deg);
}

.hamburger-menu.active span:nth-child(3) {
    top: 9px;
    transform: rotate(-45deg);
}

/* Ensure clickable area remains in active state */
.hamburger-menu.active::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    z-index: -1;
}

/* Navigation Menu */
.nav-menu {
    position: absolute;
    top: 25%;
    left: 0;
    background: rgba(255, 255, 255, 0.98);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(5, 150, 105, 0.15);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow: visible;
}

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

.nav-menu ul {
    list-style: none;
    margin: 0;
    padding: 0.75rem 0;
}

.nav-menu li {
    margin: 0;
    position: relative;
}

.nav-menu li::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1.5rem;
    right: 1.5rem;
    height: 1px;
    background: rgba(5, 150, 105, 0.1);
    transition: all 0.3s ease;
}

.nav-menu li:last-child::after {
    display: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    color: #2d3748;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    position: relative;
    font-size: 0.95rem;
}

.nav-link:hover {
    background: rgba(5, 150, 105, 0.08);
    color: #059669;
    transform: translateX(5px);
}

.nav-link.active {
    background: rgba(5, 150, 105, 0.12);
    color: #059669;
    font-weight: 600;
    border-left: 3px solid #059669;
}

.nav-link i {
    font-size: 1rem;
    width: 18px;
    text-align: center;
    transition: all 0.3s ease;
}

.nav-link:hover i {
    transform: scale(1.1);
}

.submenu-toggle {
    cursor: pointer;
}

.submenu-caret {
    margin-left: auto;
    font-size: 0.85rem;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.has-submenu.open .submenu-caret {
    transform: rotate(180deg);
}

.has-submenu {
    position: relative;
}

.submenu {
    list-style: none;
    margin: 0;
    padding: 0.75rem;
    display: none;
    position: absolute;
    top: 0.5rem;
    left: calc(100% + 0.5rem);
    background: rgba(255, 255, 255, 0.98);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(5, 150, 105, 0.15);
    min-width: 260px;
    max-width: 340px;
    z-index: 1001;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.has-submenu.open > .submenu {
    display: flex;
}

.submenu li::after {
    display: none;
}

.nav-sublink {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.9rem;
    color: #2d3748;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    background: transparent;
    width: auto;
    position: relative;
    font-size: 0.9rem;
    border-radius: 12px;
}

.nav-sublink:hover {
    background: rgba(5, 150, 105, 0.08);
    color: #059669;
    transform: translateX(5px);
}

.nav-sublink.active {
    background: rgba(5, 150, 105, 0.12);
    color: #059669;
    font-weight: 600;
}

.nav-sublink i {
    font-size: 1rem;
    width: 18px;
    text-align: center;
    transition: all 0.3s ease;
}

.nav-sublink:hover i {
    transform: scale(1.1);
}

@media (max-width: 520px) {
    .submenu {
        position: static;
        top: auto;
        left: auto;
        margin: 0.25rem 1rem 0.75rem;
        min-width: 0;
        max-width: none;
        box-shadow: none;
        border-radius: 12px;
    }
}
