/* Mega Menu Styles */
.navigation {
    position: relative;
}

.navigation .mega-menu-item,
.navigation .has-dropdown {
    position: relative;
}

.navigation .mega-menu-item > a,
.navigation .has-dropdown > a {
    display: flex;
    align-items: center;
}

.navigation .mega-menu-item > a i,
.navigation .has-dropdown > a i {
    transition: transform 0.3s ease;
}

.navigation .mega-menu-item:hover > a i,
.navigation .has-dropdown:hover > a i {
    transform: rotate(180deg);
}

/* Down arrow indicator for all items with submenus or mega menus */
.navigation .has-dropdown > a::after,
.navigation .mega-menu-item > a::after {
    content: "\f107";
    font-family: "Font Awesome 6 Pro";
    font-weight: 900;
    margin-left: 8px;
    font-size: 0.8em;
}

/* Mega Menu Dropdown */
.mega-menu-dropdown,
.mega-menu-content {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 30px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
    min-width: 600px;
    max-width: 1000px;
}

/* Show mega menu on hover */
.navigation .mega-menu-item:hover .mega-menu-content,
.navigation .has-dropdown:hover .mega-menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Mega Menu Inner Content */
.mega-menu-inner {
    display: grid;
    gap: 30px;
}

/* Remove bottom margin from last block in mega menu */
.mega-menu-inner > *:last-child {
    margin-bottom: 0 !important;
}

/* Course search dropdown styling */
#course-search-dropdown {
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f7fafc;
}

#course-search-dropdown::-webkit-scrollbar {
    width: 6px;
}

#course-search-dropdown::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 3px;
}

#course-search-dropdown::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

#course-search-dropdown::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.search-result-item {
    min-height: 60px;
    display: flex;
    align-items: center;
}

.search-result-item.active {
    background-color: #f7fafc !important;
    color: #2d3748 !important;
}

/* Smooth transition for sticky side-course element */
.side-course {
    transition: transform 0.3s ease-out;
}

/* Column layouts - automatically adjust based on number of columns */
.mega-menu-content[data-columns="2"] .mega-menu-inner {
    grid-template-columns: repeat(2, 1fr);
}

.mega-menu-content[data-columns="3"] .mega-menu-inner {
    grid-template-columns: repeat(3, 1fr);
}

.mega-menu-content[data-columns="4"] .mega-menu-inner {
    grid-template-columns: repeat(4, 1fr);
}

.mega-menu-content[data-columns="5"] .mega-menu-inner {
    grid-template-columns: repeat(5, 1fr);
}

/* Individual mega menu columns */
.mega-menu-column {
    /* Each column will be placed by the grid */
}

/* Mega Menu Typography */
.mega-menu-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1C1E22;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #B17A5C;
}

.mega-menu-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1C1E22;
    margin-bottom: 10px;
}

.mega-menu-content p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.mega-menu-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-menu-content ul li {
    margin-bottom: 8px;
}

.mega-menu-content ul li a {
    color: #666;
    text-decoration: none;
    padding: 5px 0;
    display: block;
    transition: color 0.3s ease;
}

.mega-menu-content ul li a:hover {
    color: #B17A5C;
}

/* Mega Menu Images */
.mega-menu-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 15px;
}

/* Mega Menu Buttons */
.mega-menu-content .btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: #B17A5C;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: background 0.3s ease;
    margin-top: 10px;
}

.mega-menu-content .btn:hover {
    background: #9a6650;
}

/* Regular Dropdown (non-mega) */
.sub-menu:not(.mega-menu-dropdown) {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 15px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
    min-width: 200px;
}

.has-dropdown:hover .sub-menu:not(.mega-menu-dropdown) {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sub-menu:not(.mega-menu-dropdown) li {
    margin: 0;
}

.sub-menu:not(.mega-menu-dropdown) a {
    display: block;
    padding: 10px 20px;
    color: #1C1E22;
    text-decoration: none;
    transition: background 0.3s ease;
}

.sub-menu:not(.mega-menu-dropdown) a:hover {
    background: #f8f9fa;
    color: #B17A5C;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .mega-menu-content,
    .mega-menu-dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: #f8f9fa;
        border-radius: 8px;
        margin-top: 10px;
        padding: 20px;
        min-width: auto;
        max-width: none;
    }
    
    .mega-menu-inner {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
    
    .sub-menu:not(.mega-menu-dropdown) {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: #f8f9fa;
        border-radius: 8px;
        margin-top: 10px;
        padding: 10px 0;
        min-width: auto;
    }
}

/* Hide dropdown indicators on mobile */
@media (max-width: 1024px) {
    .navigation .mega-menu-item > a i,
    .navigation .has-dropdown > a i {
        display: none;
    }
}