
/* ==================== MEGA MENU NAVIGATION ==================== */
/* Mega Menu Container */
.mega-menu-nav {
    background: #ffffff !important;
    border-top: 1px solid #e5e7eb;
    padding: 0;
}

.mega-menu-nav .navbar-nav {
    width: 100%;
}

/* Nav Links Styling */
.nav-link-modern {
    color: #1f2937 !important;
    font-weight: 600;
    padding: 1rem 1.25rem !important;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    white-space: nowrap;
    font-size: 0.95rem;
}

.nav-link-modern:hover {
    color: var(--primary-color) !important;
    background-color: rgba(124, 58, 237, 0.08);
    transform: translateY(-1px);
}

.nav-link-modern i {
    font-size: 0.7rem;
}

/* Dropdown Toggle Arrow */
.dropdown-toggle::after {
    margin-right: 0.5rem;
    vertical-align: 0.15em;
    transition: transform 0.3s ease;
}

.dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

/* Standard Dropdown Menu */
.dropdown-menu {
    border: none;
    border-radius: 12px;
    padding: 0.5rem;
    margin-top: 0.5rem;
    min-width: 250px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Mega Menu (Large Dropdown) */
.mega-menu {
    width: 100%;
    max-width: 900px;
    border: none;
    background: #ffffff !important;
    border-radius: 16px;
    padding: 2.5rem 2rem;
    margin-top: 0.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12) !important;
    animation: megaMenuFadeIn 0.3s ease;
    min-width: 600px;
}

@keyframes megaMenuFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mega Menu Sections */
.mega-menu-section {
    padding: 0.85rem 1rem;
    min-height: 100%;
}

.mega-menu-title {
    color: #1f2937;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(124, 58, 237, 0.15);
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.mega-menu-title i {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-left: 0.5rem;
}

.mega-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-menu-list li {
    margin-bottom: 0.5rem;
}

.mega-menu-list a {
    color: #4b5563;
    text-decoration: none;
    display: block;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    white-space: nowrap;
}

.mega-menu-list a:hover {
    background-color: rgba(124, 58, 237, 0.08);
    color: var(--primary-color);
    transform: translateX(-3px);
}

/* Mega Menu Highlight Section */
.mega-menu-highlight {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(124, 58, 237, 0.06));
    padding: 1.25rem;
    border-radius: 12px;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.highlight-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.mega-menu-highlight h6 {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.4rem;
    color: #1f2937;
}

.mega-menu-highlight p {
    color: #6b7280;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.mega-menu-highlight .btn {
    background: var(--primary-color);
    border: none;
    padding: 0.5rem 1rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.mega-menu-highlight .btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* Mega Menu on Desktop - Hover to Show */
@media (min-width: 992px) {
    .mega-dropdown:hover > .mega-menu {
        display: block;
    }
    
    .nav-item.dropdown:hover > .dropdown-menu {
        display: block;
    }
}

/* Dropdown Divider */
.dropdown-divider {
    border-color: #e5e7eb;
    margin: 0.5rem 0;
}

/* Mobile Menu Adjustments */
@media (max-width: 991px) {
    .mega-menu-nav .navbar-collapse {
        background: #ffffff;
        padding: 1rem;
        border-radius: 12px;
        margin-top: 1rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    .mega-menu {
        position: static !important;
        transform: none !important;
        width: 100%;
        max-width: 100%;
        padding: 1rem;
        box-shadow: none;
        border: 1px solid #e5e7eb;
        margin-top: 0.5rem;
    }
    
    .mega-menu .container {
        padding: 0;
    }
    
    .mega-menu .row {
        margin: 0;
    }
    
    .mega-menu .col-md-3,
    .mega-menu .col-md-4 {
        padding: 0;
    }
    
    .nav-link-modern {
        padding: 0.75rem 1rem !important;
    }
    
    .dropdown-menu {
        border: 1px solid #e5e7eb;
        margin-top: 0.25rem;
        box-shadow: none;
    }
    
    .dropdown-header {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }
    
    .dropdown-item {
        font-size: 0.85rem;
        padding: 0.4rem 0.75rem;
    }
}

/* Animation for Dropdown */
@media (min-width: 992px) {
    .dropdown-menu,
    .mega-menu {
        animation: fadeInUp 0.3s ease;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Active Menu Item */
.nav-item .nav-link-modern.active {
    color: var(--primary-color) !important;
    background-color: rgba(124, 58, 237, 0.1);
    font-weight: 600;
}

/* Icon Colors in Menu */
.nav-link-modern i {
    font-size: 0.9rem;
}

/* Ensure proper RTL behavior */
[dir="rtl"] .dropdown-toggle::after {
    margin-right: 0.5rem;
    margin-left: 0;
}

[dir="rtl"] .dropdown-item:hover {
    transform: translateX(3px);
}

/* Mobile Menu Toggle Button Enhancement */
@media (max-width: 991px) {
    .navbar-toggler {
        border: none;
        padding: 0.5rem;
    }
    
    .navbar-toggler:focus {
        box-shadow: none;
    }
}

/* Ensure mega menu stays within viewport */
.mega-dropdown .mega-menu {
    left: 50%;
    transform: translateX(-50%);
}

@media (max-width: 991px) {
    .mega-dropdown .mega-menu {
        left: 0;
        transform: none;
    }
}
