/* =============================================
   DROPDOWN NAVIGATION STYLES
   ============================================= */

/* Desktop Navigation Base */
.desktop-nav {
    position: relative;
    z-index: 1000;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    gap: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: var(--light-text, #333);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 0 0.25rem;
}

.nav-link:hover {
    color: var(--primary-color, #007cba);
    background-color: rgba(0, 124, 186, 0.1);
    transform: translateY(-1px);
}

/* Dropdown Arrow */
.dropdown-arrow {
    margin-left: 0.5rem;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
    min-width: 250px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
    backdrop-filter: blur(10px);
}

.dropdown:hover .dropdown-menu,
.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown Items */
.dropdown-item {
    margin: 0;
    padding: 0;
}

.dropdown-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--light-text, #333);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border-radius: 0;
    margin: 0;
}

.dropdown-link:hover {
    background-color: rgba(0, 124, 186, 0.08);
    color: var(--primary-color, #007cba);
    transform: translateX(5px);
}

.dropdown-link i {
    margin-right: 0.75rem;
    width: 16px;
    text-align: center;
    color: var(--primary-color, #007cba);
    font-size: 0.85rem;
}

/* Special styling for "View All" link */
.dropdown-link.view-all {
    font-weight: 600;
    color: var(--primary-color, #007cba);
}

.dropdown-link.view-all:hover {
    background-color: var(--primary-color, #007cba);
    color: white;
}

.dropdown-link.view-all:hover i {
    color: white;
}

/* Dropdown Divider */
.dropdown-divider {
    height: 1px;
    background-color: rgba(0, 0, 0, 0.1);
    margin: 0.5rem 1rem;
    list-style: none;
}

/* Dark Mode Support */
.dark-mode .nav-link {
    color: var(--dark-text, #e5e5e5);
}

.dark-mode .nav-link:hover {
    color: var(--primary-color, #38bdf8);
    background-color: rgba(56, 189, 248, 0.1);
}

.dark-mode .dropdown-menu {
    background: var(--dark-card-bg, #1f2937);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.dark-mode .dropdown-link {
    color: var(--dark-text, #e5e5e5);
}

.dark-mode .dropdown-link:hover {
    background-color: rgba(56, 189, 248, 0.1);
    color: var(--primary-color, #38bdf8);
}

.dark-mode .dropdown-link i {
    color: var(--primary-color, #38bdf8);
}

.dark-mode .dropdown-divider {
    background-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .dropdown-link.view-all {
    color: var(--primary-color, #38bdf8);
}

.dark-mode .dropdown-link.view-all:hover {
    background-color: var(--primary-color, #38bdf8);
    color: var(--dark-bg, #111827);
}

/* Animation for dropdown items */
.dropdown-menu .dropdown-item {
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.2s ease;
}

.dropdown:hover .dropdown-menu .dropdown-item,
.dropdown.active .dropdown-menu .dropdown-item {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation delay */
.dropdown-menu .dropdown-item:nth-child(1) { transition-delay: 0.05s; }
.dropdown-menu .dropdown-item:nth-child(2) { transition-delay: 0.1s; }
.dropdown-menu .dropdown-item:nth-child(3) { transition-delay: 0.15s; }
.dropdown-menu .dropdown-item:nth-child(4) { transition-delay: 0.2s; }
.dropdown-menu .dropdown-item:nth-child(5) { transition-delay: 0.25s; }
.dropdown-menu .dropdown-item:nth-child(6) { transition-delay: 0.3s; }

/* Mobile Responsive */
@media (max-width: 768px) {
    .desktop-nav {
        display: none;
    }
}

/* Tablet adjustments */
@media (max-width: 1024px) {
    .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .dropdown-menu {
        min-width: 220px;
    }
    
    .dropdown-link {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
}

/* Large screen optimizations */
@media (min-width: 1200px) {
    .nav-link {
        padding: 1rem 1.75rem;
    }
    
    .dropdown-menu {
        min-width: 280px;
    }
}

/* Accessibility improvements */
.nav-link:focus,
.dropdown-link:focus {
    outline: 2px solid var(--primary-color, #007cba);
    outline-offset: 2px;
}

/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

/* Prevent dropdown from going off-screen */
.nav-item:last-child .dropdown-menu {
    right: 0;
    left: auto;
}

/* Loading state for dynamic content */
.dropdown-menu.loading {
    opacity: 0.7;
}

.dropdown-menu.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color, #007cba);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Hover effects for better UX */
.nav-item:hover .nav-link {
    color: var(--primary-color, #007cba);
}

/* Active state for current page */
.nav-item.active .nav-link {
    color: var(--primary-color, #007cba);
    background-color: rgba(0, 124, 186, 0.1);
}

/* Mega menu support (for future expansion) */
.dropdown-menu.mega-menu {
    min-width: 600px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1.5rem;
}

.mega-menu .dropdown-item {
    margin-bottom: 0.5rem;
}