/* ===========================================
   NAVBAR STYLES - FUAD
   =========================================== */

/* IMPROVED NAVBAR STYLES */
.navbar {
    background: rgba(37, 99, 235, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    padding: 15px 0;
}

.navbar.scrolled {
    background: var(--dark-blue);
    padding: 10px 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.8rem;
    color: white !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-brand i {
    font-size: 1.5rem;
    color: var(--secondary-teal);
}

/* MAIN NAV LINKS */
.nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
    padding: 12px 18px !important;
    margin: 0 5px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link:hover {
    color: white !important;
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.nav-link.active {
    color: white !important;
    background: rgba(255,255,255,0.15);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: 0;
    left: 50%;
    background: var(--secondary-teal);
    transition: all 0.3s ease;
    transform: translateX(-50%);
    border-radius: 2px;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

/* IMPROVED DROPDOWN STYLES */
.dropdown-toggle::after {
    display: none; /* Hide default Bootstrap arrow */
}

/* Custom dropdown arrow */
.dropdown-toggle {
    position: relative;
}

.dropdown-toggle::before {
    content: '\f107'; /* FontAwesome chevron-down */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: 8px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.dropdown:hover .dropdown-toggle::before,
.dropdown-toggle[aria-expanded="true"]::before {
    transform: rotate(180deg);
    color: var(--secondary-teal);
}

.dropdown-toggle:hover::before {
    opacity: 1;
    color: var(--secondary-teal);
}

/* ENHANCED DROPDOWN MENU - FIX HOVER BUG */
.dropdown {
    position: relative;
}

.dropdown-menu {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    padding: 15px 0;
    margin-top: 8px; /* Reduced gap */
    min-width: 280px;
    border: 1px solid rgba(37, 99, 235, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
}

/* Add invisible bridge to prevent hover gap */
.dropdown::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 8px; /* Bridge the gap */
    background: transparent;
    z-index: 999;
}

.dropdown:hover .dropdown-menu,
.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ENHANCED DROPDOWN ITEMS */
.dropdown-item {
    color: #334155 !important;
    padding: 14px 25px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border-radius: 12px;
    margin: 3px 15px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dropdown-item::before {
    content: '';
    width: 4px;
    height: 0;
    background: var(--gradient-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
    position: absolute;
    left: 8px;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, var(--light-blue) 0%, rgba(37, 99, 235, 0.1) 100%);
    color: var(--primary-blue) !important;
    transform: translateX(8px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.dropdown-item:hover::before {
    height: 20px;
}

/* DROPDOWN ICONS */
.dropdown-item i {
    width: 16px;
    font-size: 0.9rem;
    color: var(--secondary-teal);
    transition: all 0.3s ease;
}

.dropdown-item:hover i {
    color: var(--primary-blue);
    transform: scale(1.1);
}

/* ENHANCED DROPDOWN SUBMENU */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu > .dropdown-item::after {
    content: '\f105'; /* FontAwesome chevron-right */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: auto;
    font-size: 0.8rem;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.dropdown-submenu:hover > .dropdown-item::after {
    opacity: 1;
    transform: translateX(3px);
    color: var(--primary-blue);
}

.dropdown-submenu .dropdown-menu {
    top: -10px;
    left: 100%;
    margin-top: 0;
    margin-left: 5px; /* Reduced gap */
    min-width: 250px;
}

/* Add bridge for submenu too */
.dropdown-submenu::after {
    content: '';
    position: absolute;
    top: 0;
    right: -5px;
    bottom: 0;
    width: 5px;
    background: transparent;
    z-index: 999;
}

.dropdown-submenu:hover > .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* SUBMENU ITEMS */
.dropdown-submenu .dropdown-menu .dropdown-item {
    padding: 12px 20px;
    font-size: 0.9rem;
    margin: 2px 10px;
}

.dropdown-submenu .dropdown-menu .dropdown-item:hover {
    background: rgba(37, 99, 235, 0.08);
    transform: translateX(5px);
}

/* NAVBAR TOGGLER FOR MOBILE */
.navbar-toggler {
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

.navbar-toggler:hover {
    background: rgba(255,255,255,0.2);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(255,255,255,0.2);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='m4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* MOBILE RESPONSIVE */
@media (max-width: 991px) {
    .navbar-collapse {
        background: rgba(37, 99, 235, 0.98);
        margin-top: 15px;
        border-radius: 16px;
        padding: 20px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    }
    
    .dropdown::before,
    .dropdown-submenu::after {
        display: none; /* Remove bridges on mobile */
    }
    
    .dropdown-menu {
        position: static !important;
        float: none !important;
        width: auto !important;
        margin-top: 10px !important;
        background: rgba(255,255,255,0.1) !important;
        border: 1px solid rgba(255,255,255,0.2) !important;
        box-shadow: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
    }
    
    .dropdown-submenu .dropdown-menu {
        margin-left: 20px !important;
        margin-top: 5px !important;
        background: rgba(255,255,255,0.05) !important;
    }
    
    .dropdown-item {
        color: rgba(255,255,255,0.9) !important;
        margin: 2px 5px !important;
    }
    
    .dropdown-item:hover {
        background: rgba(255,255,255,0.15) !important;
        color: white !important;
    }
    
    .dropdown-submenu .dropdown-menu .dropdown-item {
        padding: 10px 15px !important;
        font-size: 0.85rem !important;
        color: rgba(255,255,255,0.8) !important;
    }
    
    .nav-link {
        margin: 5px 0 !important;
        border-radius: 12px !important;
    }

    .dropdown-menu.show {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
    }
    
    .dropdown-submenu .dropdown-menu.show {
        display: block !important;
    }
}

/* Animation for menu items on page load */
@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-item {
    animation: slideInFromTop 0.6s ease forwards;
}

.nav-item:nth-child(1) { animation-delay: 0.1s; }
.nav-item:nth-child(2) { animation-delay: 0.2s; }
.nav-item:nth-child(3) { animation-delay: 0.3s; }
.nav-item:nth-child(4) { animation-delay: 0.4s; }
.nav-item:nth-child(5) { animation-delay: 0.5s; }
.nav-item:nth-child(6) { animation-delay: 0.6s; }
.nav-item:nth-child(7) { animation-delay: 0.7s; }