/* ==============================================
   LOCATION SEARCH POPUP - CUSTOM STYLES
   Tailwind-first approach with minimal custom CSS
   ============================================== */

/* Modal container - hidden by default */
[data-location-search-modal] {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* Modal show state - must override Tailwind's hidden class */
[data-location-search-modal].show {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Modal entrance animation */
@keyframes modal-slide-in {
    from {
        opacity: 0;
        transform: translateY(-16px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.animate-modal-slide-in {
    animation: modal-slide-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Apply animation to modal dialog */
[data-location-search-modal].show > div:nth-child(2) {
    animation: modal-slide-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Custom scrollbar for results list */
[data-location-results]::-webkit-scrollbar {
    width: 6px;
}

[data-location-results]::-webkit-scrollbar-track {
    background: rgba(147, 51, 234, 0.1);
    border-radius: 3px;
}

[data-location-results]::-webkit-scrollbar-thumb {
    background: rgba(147, 51, 234, 0.3);
    border-radius: 3px;
    transition: background 0.2s ease;
}

[data-location-results]::-webkit-scrollbar-thumb:hover {
    background: rgba(147, 51, 234, 0.5);
}

/* Firefox scrollbar styling */
[data-location-results] {
    scrollbar-width: thin;
    scrollbar-color: rgba(147, 51, 234, 0.3) rgba(147, 51, 234, 0.1);
}

/* Backdrop blur fallback for older browsers */
@supports not (backdrop-filter: blur(8px)) {
    [data-location-backdrop] {
        background: rgba(0, 0, 0, 0.5) !important;
    }

    [data-location-search-modal] > div:nth-child(2) {
        background: rgba(255, 255, 255, 1) !important;
    }
}

/* Focus visible styles for accessibility */
.location-item:focus-visible {
    outline: 2px solid rgb(147, 51, 234);
    outline-offset: 2px;
}

#locationSearchInput:focus-visible {
    outline: 2px solid rgb(147, 51, 234);
    outline-offset: 2px;
}

[data-location-close]:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* Prevent body scroll when modal is open */
body.location-modal-open {
    overflow: hidden;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    [data-location-search-modal] {
        padding: 1rem;
    }

    .animate-modal-slide-in {
        animation: modal-slide-in 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    }

    [data-location-search-modal].show > div:nth-child(2) {
        animation: modal-slide-in 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    }
}
