.mega-dropdown {
    position: static;
}

.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    min-width: 800px;
    background: #ffffff;
    border: 1px solid hsl(214.3 31.8% 91.4%);
    border-radius: 8px;
    padding: 2rem 0;
    margin-top: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.mega-menu-section {
    padding: 0 1.5rem;
}

.mega-menu-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: hsl(222.2 84% 4.9%);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid hsl(214.3 31.8% 91.4%);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mega-menu-subtitle {
    font-size: 0.8rem;
    font-weight: 500;
    color: hsl(215.4 16.3% 46.9%);
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

.mega-menu-list {
    margin-bottom: 0;
}

.mega-menu-list li {
    margin-bottom: 0.25rem;
}

.mega-menu-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    color: hsl(222.2 84% 4.9%);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    line-height: 1.4;
}

.mega-menu-link:hover {
    background-color: hsl(210 40% 98%);
    color: hsl(222.2 84% 4.9%);
    transform: translateX(2px);
}

.mega-menu-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.menu-text {
    font-weight: 400;
}

.mega-menu-link:hover .menu-text {
    font-weight: 500;
}

/* Subsection Styles */
.mega-menu-subsection {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid hsl(214.3 31.8% 91.4%);
}

.mega-menu-sublist {
    margin-left: 1rem;
}

.mega-menu-sublist li {
    margin-bottom: 0.1rem;
}

.mega-menu-sublink {
    display: flex;
    align-items: center;
    padding: 0.3rem 0.5rem;
    color: hsl(215.4 16.3% 46.9%);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 0.8rem;
}

.mega-menu-sublink:hover {
    background-color: hsl(210 40% 96%);
    color: hsl(222.2 84% 4.9%);
    transform: translateX(2px);
}

.submenu-text {
    font-weight: 400;
}

.mega-menu-sublink:hover .submenu-text {
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .mega-menu {
        position: static;
        width: 100%;
        min-width: auto;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 1rem;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: hsl(210 40% 98%);
    }
    
    .mega-menu-section {
        padding: 1rem 0;
        border-bottom: 1px solid hsl(214.3 31.8% 91.4%);
    }
    
    .mega-menu-section:last-child {
        border-bottom: none;
    }
    
    .mega-menu-title {
        font-size: 1rem;
    }
    
    .mega-menu-link {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

/* Dark navbar compatibility */
.navbar-dark .mega-dropdown .nav-link {
    color: rgba(255, 255, 255, 0.85);
}

.navbar-dark .mega-dropdown .nav-link:hover,
.navbar-dark .mega-dropdown .nav-link:focus {
    color: #fff;
}

/* Animation improvements */
.mega-menu-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 3px;
    height: 0;
    background: var(--primary-color);
    border-radius: 2px;
    transition: height 0.2s ease;
    transform: translateY(-50%);
}

.mega-menu-link:hover::before {
    height: 60%;
}

.mega-menu-sublink::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 2px;
    height: 0;
    background: hsl(215.4 16.3% 46.9%);
    border-radius: 1px;
    transition: height 0.2s ease;
    transform: translateY(-50%);
}

.mega-menu-sublink:hover::before {
    height: 40%;
}


