/* Simple Dropdown Menu Styles */
.nav-item {
    position: relative;
    display: inline-block;
}

.nav-link {
    color: #374151;
    font-weight: 500;
    padding: 10px 16px;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.nav-link:hover {
    color: #2563eb;
    background-color: #f3f4f6;
}

.nav-link.active {
    color: #2563eb;
    background-color: #eff6ff;
}

/* Dropdown container - hidden by default */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    min-width: 220px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    z-index: 10000 !important; /* High z-index to stay above all elements */
    padding: 8px 0;
    margin-top: 5px;
}

/* Show dropdown on hover - with proper event handling */
.nav-item:hover .dropdown-menu {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: #374151;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 0;
}

.dropdown-menu a:hover {
    background-color: #f3f4f6;
    color: #2563eb;
    padding-left: 25px;
}

.dropdown-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.nav-item:hover .dropdown-icon {
    transform: rotate(180deg);
}

/* Ensure dropdown parent has proper stacking context */
.nav-item.dropdown {
    z-index: 9998;
}

/* Mobile Dropdown */
@media (max-width: 768px) {
    .nav-item {
        display: block;
        width: 100%;
    }
    
    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        background: #f8fafc;
        margin-top: 5px;
        border-radius: 4px;
    }
    
    .nav-item:hover .dropdown-icon {
        transform: rotate(180deg);
    }
}

/* Mega Menu for Courses */
.mega-menu {
    min-width: 900px;
    max-width: 900px;
    padding: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.mega-menu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.mega-menu-column h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #667eea;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mega-menu-column h4 i {
    color: #667eea;
    font-size: 1rem;
}

.mega-menu-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mega-menu-items a {
    padding: 8px 12px;
    font-size: 0.9rem;
    border-radius: 4px;
}

.mega-menu-items a:hover {
    padding-left: 16px;
}

/* Update mobile styles for mega menu */
@media (max-width: 768px) {
    .mega-menu {
        min-width: 100%;
        padding: 15px;
    }
    
    .mega-menu-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}
