/* Custom fixes for mobile menu and navigation */

/* Fix spacing between icon and text in navigation links */
.nav-link {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    white-space: nowrap !important;
}

.nav-link i {
    margin-right: 0.3rem !important;
}

/* Fix for header logo in mobile view */
.logo-link {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1005; /* Ensure it's above mobile menu */
}

/* Prevent clicks on logo from being intercepted */
.header-content .logo-container {
    position: relative;
    z-index: 1005;
}

/* Improve mobile menu toggle design */
.mobile-menu-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.mobile-menu-toggle .hamburger {
    width: 20px;
    height: 16px;
    position: relative;
}

.mobile-menu-toggle .hamburger span {
    display: block;
    position: absolute;
    height: 2px;
    width: 100%;
    background: #ffffff;
    border-radius: 2px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: .25s ease-in-out;
}

.mobile-menu-toggle .hamburger span:nth-child(1) {
    top: 0px;
}

.mobile-menu-toggle .hamburger span:nth-child(2),
.mobile-menu-toggle .hamburger span:nth-child(3) {
    top: 7px;
}

.mobile-menu-toggle .hamburger span:nth-child(4) {
    top: 14px;
}

/* Mobile dropdown styles */
@media (max-width: 768px) {
    /* Hide original dropdown content in mobile view */
    .dropdown-content {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
    
    /* Remove before and after pseudo-elements from nav and nav-link */
    nav::before, 
    nav::after,
    .nav-link::before,
    .nav-link::after {
        display: none !important;
        content: none !important;
    }
    
    /* Fix for mobile navigation structure */
    nav {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        padding-top: 70px !important; /* Ensure space for fixed header */
    }
    
    /* Fixed header in mobile view */
    header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        z-index: 9999 !important; /* Ensure header is always on top */
    }
    
    /* Improved dropdown positioning */
    .dropdown {
        position: relative;
        margin-bottom: 0.5rem;
    }
    
    /* Fix dropdown positioning so it doesn't overlap elements */
    .dropdown.active {
        margin-bottom: 200px !important; /* Add space for dropdown content */
        transition: margin-bottom 0.3s ease;
    }
    
    /* Remove old margin positioning that caused overlaps */
    .dropdown.active + .dropdown {
        margin-top: 0 !important; 
    }
    
    /* Center the mobile dropdown content */
    .mobile-dropdown-content {
        position: absolute !important;
        top: 100% !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 90% !important;
        max-width: 300px !important;
        margin: 0.5rem auto !important;
        z-index: 1000 !important;
        background-color: rgba(30, 60, 90, 0.95) !important;
        border-radius: 12px !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
        padding: 1rem !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        max-height: 300px !important;
        overflow-y: auto !important;
    }
    
    /* Ensure dropdown content doesn't push other elements */
    .mobile-dropdown-content {
        position: absolute !important;
        box-sizing: border-box !important;
    }
    
    /* Dark theme support for mobile dropdown content */
    body.dark-theme .mobile-dropdown-content {
        background-color: rgba(40, 40, 40, 0.95) !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        transition: background-color 0.3s ease, box-shadow 0.3s ease, border 0.3s ease !important;
    }
    
    /* Ensure dropdown items are properly styled */
    .dropdown-toggle {
        display: flex !important;
        align-items: center !important;
        gap: 0.5rem !important;
        width: 100% !important;
        justify-content: space-between !important;
    }
    
    .dropdown-toggle i {
        margin-right: 0.3rem !important;
    }
    
    .dropdown-item {
        display: flex !important;
        align-items: center !important;
        gap: 0.5rem !important;
        width: 100% !important;
        padding: 0.75rem 1rem !important;
        margin: 0.3rem 0 !important;
        border-radius: 8px !important;
        background-color: rgba(255, 255, 255, 0.1) !important;
        transition: background-color 0.3s ease !important;
    }
    
    .dropdown-item:hover {
        background-color: rgba(255, 255, 255, 0.2) !important;
    }
    
    /* Dark theme support for dropdown items in mobile dropdown */
    body.dark-theme .mobile-dropdown-content .dropdown-item {
        background-color: rgba(255, 255, 255, 0.05) !important;
        color: var(--text-color-dark, #e0e0e0) !important;
        transition: background-color 0.3s ease, color 0.3s ease !important;
    }
    
    body.dark-theme .mobile-dropdown-content .dropdown-item:hover {
        background-color: rgba(255, 255, 255, 0.1) !important;
    }
    
    body.dark-theme .mobile-dropdown-content .dropdown-item i {
        color: var(--secondary-color-light, #8ab4f8) !important;
        transition: color 0.3s ease !important;
    }
    
    .dropdown-item i {
        margin-right: 0.3rem !important;
    }
    
    /* Add indicator for dropdown toggle */
    .dropdown-toggle::after {
        content: '\f107' !important; /* Font Awesome down arrow */
        font-family: 'Font Awesome 5 Free' !important;
        font-weight: 900 !important;
        margin-left: 0.5rem !important;
        transition: transform 0.3s ease !important;
    }
    
    /* Dark theme support for dropdown toggle indicator */
    body.dark-theme .dropdown-toggle::after {
        color: var(--text-color-dark, #e0e0e0) !important;
    }
    
    .dropdown.active .dropdown-toggle::after {
        transform: rotate(180deg) !important;
    }
}

/* Fix for mobile navigation links */
@media (max-width: 768px) {
    .nav-link {
        padding: 0.8rem 1rem !important;
        margin: 0.5rem 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
        justify-content: flex-start !important;
    }
    
    /* Ensure proper z-index for dropdowns */
    .dropdown {
        z-index: 1 !important;
    }
    
    .dropdown.active {
        z-index: 2 !important;
    }
    
    /* Main content adjustment for mobile dropdown */
    main {
        padding-top: var(--header-height, 60px);
        position: relative;
        z-index: 1;
    }
} 