/* Bootstrap Location Dropdown Styles */
.location-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-color, #333);
    transition: all 0.15s ease-in-out;
    cursor: pointer;
    font-weight: 500;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    border-radius: 0;
    overflow: hidden;
}

.location-item:hover {
    background-color: #e3f2fd;
    color: #0d6efd;
    text-decoration: none;
    transform: none;
    font-weight: 700;
}

.location-item:active {
    background-color: #bbdefb;
    transform: none;
    font-weight: 700;
}

.location-item .name {
    flex: 1;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Custom dropdown arrow styling */
.dropdown-icon {
    transition: transform 0.3s ease;
    font-size: 0.875rem;
    color: inherit;
}

/* Hide Bootstrap's default dropdown arrow */
.dropdown-toggle::after {
    display: none !important;
}

/* Rotate chevron when dropdown is open */
.dropdown-toggle[aria-expanded="true"] .dropdown-icon {
    transform: rotate(180deg);
}

/* Remove border radius when dropdown is active */
.dropdown-toggle:focus,
.dropdown-toggle:active,
.dropdown-toggle.show,
.dropdown-toggle[aria-expanded="true"] {
    border-radius: 0 !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Navbar specific styles */
.navbar .dropdown-menu {
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    min-width: 160px;
    overflow: hidden;
    z-index: 9999 !important; /* Ensure high z-index */
    position: absolute !important; /* Force absolute positioning */
}

.navbar .dropdown-item {
    padding: 0.75rem 1rem;
    font-weight: 500;
    color: #333;
    transition: all 0.15s ease-in-out;
    border-radius: 0;
    overflow: hidden;
}

.navbar .dropdown-item:hover {
    background-color: #e3f2fd;
    color: #0d6efd;
    transform: none;
    font-weight: 700;
}

.navbar .dropdown-item:active {
    background-color: #bbdefb;
    transform: none;
    font-weight: 700;
}

/* Add underline effect for location dropdown like other nav items */
.navbar .dropdown-toggle {
    position: relative;
    text-decoration: none;
}

.navbar .dropdown-toggle::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: #0d6efd;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar .dropdown-toggle:hover::before {
    width: 100%;
}

.navbar .dropdown-toggle[aria-expanded="true"]::before {
    width: 100%;
}

/* Ensure dropdown is always visible when shown */
.navbar .dropdown-menu.show {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

/* Force dropdown positioning */
.navbar .nav-item.dropdown {
    position: relative;
}

.navbar .dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: auto !important;
    transform: none !important;
}

/* Mobile specific stacking context fixes */
@media (max-width: 991.98px) {
    /* Create a new stacking context for the navbar */
    .navbar {
        position: relative;
        z-index: 1030;
    }
    
    /* Ensure the collapse container has proper stacking */
    .navbar-collapse {
        position: relative;
        z-index: 1020;
    }
    
    /* Force the dropdown to be on top */
    .navbar-collapse .nav-item.dropdown {
        position: relative;
        z-index: 1035 !important;
    }
    
    .navbar-collapse .dropdown-menu {
        position: relative !important;
        z-index: 1035 !important;
        transform: none !important;
    }
    
    .navbar-collapse .dropdown-menu.show {
        position: relative !important;
        z-index: 1035 !important;
        transform: none !important;
    }
}

/* Mobile hamburger menu specific styles */
@media (max-width: 991.98px) {
    /* Ensure navbar collapse has proper z-index */
    .navbar-collapse {
        z-index: 1020 !important;
        position: relative;
    }
    
    .navbar-collapse .dropdown-menu {
        position: static !important;
        float: none;
        width: 100%;
        margin-top: 0;
        box-shadow: none;
        border: none;
        background: transparent;
        padding: 0;
        overflow: hidden;
        max-height: 0;
        transition: max-height 0.3s ease-in-out;
        z-index: 1035 !important; /* Higher than navbar (1030) */
        position: relative !important;
    }
    
    .navbar-collapse .dropdown-menu.show {
        max-height: 300px; /* Adjust based on content */
        padding: 0.5rem 0;
        z-index: 1035 !important; /* Higher than navbar (1030) */
        background-color: rgba(255, 255, 255, 0.98) !important; /* Ensure visibility */
        backdrop-filter: blur(10px) !important; /* Add blur effect for better visibility */
        border-radius: 8px;
        margin: 0.5rem 0;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
    
    .navbar-collapse .dropdown-item {
        padding: 0.75rem 1rem;
        color: #333;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        border-radius: 0;
        overflow: hidden;
        opacity: 0;
        transform: translateY(-10px);
        transition: all 0.3s ease;
        z-index: 1035 !important; /* Higher than navbar (1030) */
        position: relative;
    }
    
    .navbar-collapse .dropdown-menu.show .dropdown-item {
        opacity: 1;
        transform: translateY(0);
        z-index: 1035 !important; /* Higher than navbar (1030) */
    }
    
    .navbar-collapse .dropdown-item:hover {
        background-color: #e3f2fd;
        color: #0d6efd;
        transform: none;
        font-weight: 700;
    }
    
    .navbar-collapse .dropdown-item:last-child {
        border-bottom: none;
    }
    
    /* Ensure proper alignment in mobile menu */
    .navbar-collapse .nav-item.dropdown {
        width: 100%;
        z-index: 1035 !important; /* Higher than navbar (1030) */
        position: relative;
    }
    
    .navbar-collapse .dropdown-toggle {
        width: 100%;
        text-align: left;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        position: relative;
        cursor: pointer;
        z-index: 1035 !important; /* Higher than navbar (1030) */
    }
    
    /* Hide Bootstrap arrow in mobile too */
    .navbar-collapse .dropdown-toggle::after {
        display: none !important;
    }
    
    /* Remove border radius in mobile too */
    .navbar-collapse .dropdown-toggle:focus,
    .navbar-collapse .dropdown-toggle:active,
    .navbar-collapse .dropdown-toggle.show,
    .navbar-collapse .dropdown-toggle[aria-expanded="true"] {
        border-radius: 0 !important;
        outline: none !important;
        box-shadow: none !important;
        background-color: #f8f9fa;
    }
    
    /* Remove underline effect in mobile hamburger menu */
    .navbar-collapse .dropdown-toggle::before {
        display: none;
    }
    
    /* Rotate chevron when dropdown is open in mobile */
    .navbar-collapse .dropdown-toggle[aria-expanded="true"] .dropdown-icon {
        transform: rotate(180deg);
    }
    
    /* Ensure dropdown items are properly spaced */
    .navbar-collapse .dropdown-menu li {
        margin: 0;
        padding: 0;
        z-index: 1035 !important; /* Higher than navbar (1030) */
        position: relative;
    }
    
    /* Add subtle background to dropdown items */
    .navbar-collapse .dropdown-item {
        background-color: rgba(0, 0, 0, 0.02);
        margin: 0 0.5rem;
        border-radius: 4px;
    }
    
    .navbar-collapse .dropdown-item:hover {
        background-color: #e3f2fd;
        color: #0d6efd;
        transform: translateX(5px);
    }
}

/* Desktop specific styles */
@media (min-width: 992px) {
    .navbar .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
        z-index: 1000;
        display: none;
        min-width: 160px;
        padding: 0.5rem 0;
        margin: 0;
        background-color: #fff;
        border: 1px solid rgba(0, 0, 0, 0.15);
        border-radius: 0.375rem;
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.175);
        overflow: hidden;
    }
    
    .navbar .dropdown-menu.show {
        display: block;
    }
    
    .navbar .dropdown-item {
        display: block;
        width: 100%;
        padding: 0.5rem 1rem;
        clear: both;
        font-weight: 400;
        color: #212529;
        text-align: inherit;
        text-decoration: none;
        white-space: nowrap;
        background-color: transparent;
        border: 0;
        border-radius: 0;
        overflow: hidden;
    }
    
    .navbar .dropdown-item:hover,
    .navbar .dropdown-item:focus {
        color: #0d6efd;
        background-color: #e3f2fd;
        font-weight: 700;
    }
    
    .navbar .dropdown-item:active {
        color: #0d6efd;
        background-color: #bbdefb;
        font-weight: 700;
    }
}

/* Focus States for Accessibility */
.dropdown-toggle:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.dropdown-item:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Animation for smooth transitions */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 300px;
        opacity: 1;
    }
}

.dropdown-menu.show {
    animation: fadeInDown 0.3s ease-out;
}

/* Mobile specific animations */
@media (max-width: 991.98px) {
    .navbar-collapse .dropdown-menu {
        animation: slideInDown 0.3s ease-out;
    }
    
    .navbar-collapse .dropdown-item {
        animation: fadeInDown 0.3s ease-out;
        animation-delay: calc(var(--item-index, 0) * 0.1s);
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .dropdown-menu {
        border: 2px solid #000;
    }
    
    .dropdown-item:hover {
        background: #000;
        color: #fff;
    }
} 