:root {
    --finder-primary: #6366f1;
    --finder-secondary: #8b5cf6;
    --finder-warning: #f59e0b;
    --finder-success: #10b981;
    --finder-danger: #ef4444;
    --finder-gray-50: #f9fafb;
    --finder-gray-100: #f3f4f6;
    --finder-gray-200: #e5e7eb;
    --finder-gray-300: #d1d5db;
    --finder-gray-400: #9ca3af;
    --finder-gray-500: #6b7280;
    --finder-gray-600: #4b5563;
    --finder-gray-700: #374151;
    --finder-gray-800: #1f2937;
    
    /* Layout Constants */
    --filters-height: 80px;
    --filters-height-expanded: 180px;
    --sidebar-header-height: 60px;
}

/* Filter count badge */
.filter-count-badge {
    background: var(--finder-primary);
    color: white;
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    margin-left: 0.5rem;
    font-weight: 600;
}

/* Race type multi-select container */
.race-type-multi-select {
    position: relative;
}

/* Enhanced dropdown button */
.filter-dropdown-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border: 1px solid var(--finder-gray-300);
    border-radius: 4px;
    padding: 0.375rem 0.5rem;
    font-size: 0.8rem;
    height: 32px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-dropdown-btn:hover {
    border-color: var(--finder-primary);
}

.filter-dropdown-btn.active,
.filter-dropdown-btn:focus {
    border-color: var(--finder-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
    outline: none;
}

.dropdown-icon {
    color: var(--finder-gray-500);
    transition: transform 0.2s ease;
}

.filter-dropdown-btn.active .dropdown-icon {
    transform: rotate(180deg);
}

/* Enhanced dropdown menu */
.enhanced-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--finder-gray-200);
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
    max-height: 400px;
    overflow: hidden;
    margin-top: 4px;
}

.enhanced-dropdown-menu.show {
    display: block;
}

/* Quick action buttons */
.dropdown-quick-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--finder-gray-200);
    background: var(--finder-gray-50);
}

.quick-select-btn {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--finder-gray-300);
    background: white;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.quick-select-btn:hover {
    background: var(--finder-primary);
    color: white;
    border-color: var(--finder-primary);
}

.quick-select-btn.active {
    background: var(--finder-primary);
    color: white;
    border-color: var(--finder-primary);
}

/* Options container with scroll */
.dropdown-options-container {
    max-height: 280px;
    overflow-y: auto;
    padding: 0.5rem 0;
}

/* Category sections */
.option-category {
    margin-bottom: 0.5rem;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--finder-gray-100);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--finder-gray-700);
    border-bottom: 1px solid var(--finder-gray-200);
    position: sticky;
    top: 0;
    z-index: 1;
}

.category-header i {
    color: var(--finder-primary);
    width: 16px;
}

/* Enhanced checkbox items */
.dropdown-item-check {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin: 0;
    border: none;
}

.dropdown-item-check:hover {
    background: var(--finder-gray-50);
}

.dropdown-item-check input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
}

.option-label {
    flex: 1;
    font-size: 0.85rem;
    color: var(--finder-gray-800);
}

/* Option badges */
.option-badge {
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.option-badge.running {
    background: #10b981;
    color: white;
}

.option-badge.trail {
    background: #8b5a3c;
    color: white;
}

.option-badge.cycling {
    background: #3b82f6;
    color: white;
}

.option-badge.triathlon {
    background: #6366f1;
    color: white;
}

.option-badge.obstacle {
    background: #ef4444;
    color: white;
}

.option-badge.walking {
    background: #84cc16;
    color: white;
}

.option-badge.kids {
    background: #f59e0b;
    color: white;
}

.option-badge.relay {
    background: #8b5cf6;
    color: white;
}

.option-badge.other {
    background: var(--finder-gray-500);
    color: white;
}

/* Dropdown footer */
.dropdown-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border-top: 1px solid var(--finder-gray-200);
    background: var(--finder-gray-50);
}

.selected-summary {
    font-size: 0.8rem;
    color: var(--finder-gray-600);
    font-weight: 500;
}

.apply-selection-btn {
    background: var(--finder-primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.apply-selection-btn:hover {
    background: #5855eb;
    transform: translateY(-1px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .enhanced-dropdown-menu {
        max-height: 300px;
    }
    
    .dropdown-options-container {
        max-height: 200px;
    }
    
    .dropdown-quick-actions {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .quick-select-btn {
        font-size: 0.7rem;
        padding: 0.375rem;
    }
    
    .category-header {
        font-size: 0.75rem;
        padding: 0.375rem 0.5rem;
    }
    
    .dropdown-item-check {
        padding: 0.375rem 0.5rem;
    }
    
    .option-label {
        font-size: 0.8rem;
    }
    
    .option-badge {
        font-size: 0.6rem;
        padding: 0.15rem 0.375rem;
    }
}

/* Custom scrollbar for options container */
.dropdown-options-container::-webkit-scrollbar {
    width: 6px;
}
.loading-subtle {
    opacity: 0.9 !important;
    pointer-events: auto !important;
}

.subtle-update {
    background-color: rgba(0, 123, 255, 0.05);
    transition: background-color 0.3s ease;
}

.race-card-compact.updating {
    /* Remove or make very subtle */
    opacity: 1;
}

.race-card-compact.updated {
    /* Make very subtle */
    transform: none;
    background-color: rgba(40, 167, 69, 0.03);
}
.dropdown-options-container::-webkit-scrollbar-track {
    background: var(--finder-gray-100);
    border-radius: 3px;
}

.dropdown-options-container::-webkit-scrollbar-thumb {
    background: var(--finder-gray-300);
    border-radius: 3px;
}

.dropdown-options-container::-webkit-scrollbar-thumb:hover {
    background: var(--finder-gray-400);
}

/* Animation for dropdown */
.enhanced-dropdown-menu {
    animation: dropdownFadeIn 0.2s ease-out;
    transform-origin: top;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scaleY(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scaleY(1);
    }
}

/* Improved grid layout for 4 filters */
.filters-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr 0.8fr; /* Give race types more space, actions less */
    gap: 1rem;
    align-items: end;
}

@media (max-width: 768px) {
    .filters-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}
/* Enhanced loading overlay for cards */
.cards-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(2px);
    border-radius: 8px;
}

.loading-content {
    text-align: center;
    color: var(--finder-gray-600);
}

.loading-content .spinner-border {
    margin-bottom: 1rem;
}

/* Enhanced custom map controls */
.custom-map-controls {
    background: white !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    border: 1px solid #e5e7eb;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.custom-map-controls .btn {
    border-radius: 6px;
    font-size: 0.8rem;
    padding: 0.5rem;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--finder-gray-300);
    background: white;
    color: var(--finder-gray-600);
    transition: all 0.2s ease;
}

.custom-map-controls .btn:hover {
    background: var(--finder-primary);
    color: white;
    border-color: var(--finder-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

.custom-map-controls .btn.active {
    background: var(--finder-primary);
    color: white;
    border-color: var(--finder-primary);
}

/* Enhanced sidebar with bounds info */
.sidebar-bounds-info {
    background: var(--finder-gray-50);
    border-bottom: 1px solid var(--finder-gray-200);
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    color: var(--finder-gray-600);
    display: none;
}

.sidebar-bounds-info.show {
    display: block;
}

.bounds-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.bounds-metric:last-child {
    margin-bottom: 0;
}

.bounds-value {
    font-weight: 600;
    color: var(--finder-primary);
}

/* Map status indicator */
.map-status-indicator {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: white;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid var(--finder-gray-200);
    font-size: 0.8rem;
    color: var(--finder-gray-600);
    display: none;
}

.map-status-indicator.show {
    display: block;
}

.status-indicator-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.status-indicator-item:last-child {
    margin-bottom: 0;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--finder-success);
}

.status-dot.updating {
    background: var(--finder-warning);
    animation: pulse 1s infinite;
}

.status-dot.error {
    background: var(--finder-danger);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Enhanced race cards with update animations */
.race-card-compact.updating {
    opacity: 0.7;
    transition: opacity 0.2s ease;
    position: relative;
}

.race-card-compact.updating::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

.race-card-compact.updated {
    animation: cardUpdated 0.6s ease;
}

@keyframes cardUpdated {
    0% { 
        background-color: rgba(99, 102, 241, 0.1);
        transform: scale(1.02);
    }
    100% { 
        background-color: transparent;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Auto-update status */
.auto-update-status {
    font-size: 0.7rem;
    color: var(--finder-gray-500);
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.auto-update-status.disabled {
    color: var(--finder-warning);
}

.update-frequency-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--finder-success);
    animation: blink 2s infinite;
}

.update-frequency-dot.paused {
    background: var(--finder-warning);
    animation: none;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Responsive enhancements */
@media (max-width: 768px) {
    .sidebar-bounds-info {
        display: none !important;
    }
    
    .map-status-indicator {
        top: 10px;
        left: 10px;
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .custom-map-controls .btn {
        min-width: 36px;
        height: 36px;
        font-size: 0.75rem;
    }
}

/* All the existing styles from your original race_map.html */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--finder-gray-50);
    overflow-x: hidden;
}

/* =================
   MOBILE-FIRST FILTERS SECTION
================= */
.map-filters-section {
    background: white;
    border-bottom: 1px solid var(--finder-gray-200);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.map-filters-section.collapsed {
    height: auto;
    overflow: visible;
}

.map-filters-section.collapsed .filters-content {
    display: none !important;
}

.map-filters-section.collapsed .enhanced-filters-grid {
    display: none !important;
}

/* Desktop Filter Header */
.desktop-filter-header {
    display: none;
    padding: 1rem;
    border-bottom: 1px solid var(--finder-gray-200);
}

.desktop-header-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* Removed h2 styling since title was removed */

.desktop-action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Mobile Filter Header */
.mobile-filter-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    height: var(--filters-height);
}

/* Removed h1 styling since title was removed */

.mobile-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.mobile-filter-toggle {
    background: var(--finder-primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-filter-toggle:hover {
    background: #5855eb;
    transform: translateY(-1px);
}

.mobile-filter-toggle.active {
    background: var(--finder-secondary);
}

/* Desktop Filter Content */
.filters-content {
    display: none;
    padding: 0 1rem 1rem 1rem;
    background: white;
}

.filters-content.show {
    display: block;
}

/* Desktop Filter Grid */
.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--finder-gray-600);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.filter-label i {
    font-size: 0.875rem;
    color: var(--finder-primary);
}

/* Form Controls */
.form-control,
.form-select,
.filter-dropdown-btn {
    border: 2px solid var(--finder-gray-200);
    border-radius: 8px;
    font-size: 0.875rem;
    height: 44px;
    padding: 0.75rem;
    background: white;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--finder-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    outline: none;
}

/* =================
   MAIN LAYOUT - RESPONSIVE APPROACH
================= */
.map-content-container {
    position: fixed;
    top: var(--filters-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--finder-gray-50);
    transition: top 0.3s ease;
    z-index: 1;
}

.map-content-container.filters-expanded {
    top: var(--filters-height-expanded);
}

/* Desktop Layout */
.desktop-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    height: 100%;
    overflow: hidden;
}

/* Mobile Layout */
.mobile-layout {
    display: block;
    height: 100%;
}

/* =================
   RACE CARDS SIDEBAR - DESKTOP ONLY
================= */
.race-cards-sidebar {
    background: white;
    border-right: 1px solid var(--finder-gray-200);
    display: grid;
    grid-template-rows: var(--sidebar-header-height) auto 1fr;
    overflow: hidden;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--finder-gray-200);
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.sidebar-header h6 {
    font-weight: 600;
    color: var(--finder-gray-700);
    margin: 0;
    line-height: 1.2;
    font-size: 0.9rem;
}

.view-controls {
    display: flex;
    gap: 0.375rem;
}

.race-cards-container {
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 0.75rem 1rem 0.75rem;
    background: var(--finder-gray-50);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--finder-gray-400) var(--finder-gray-200);
    position: relative;
}

.race-cards-container::-webkit-scrollbar {
    width: 8px;
}

.race-cards-container::-webkit-scrollbar-track {
    background: var(--finder-gray-200);
    border-radius: 4px;
}

.race-cards-container::-webkit-scrollbar-thumb {
    background: var(--finder-gray-400);
    border-radius: 4px;
    border: 1px solid var(--finder-gray-200);
}

.race-cards-container::-webkit-scrollbar-thumb:hover {
    background: var(--finder-gray-500);
}

/* =================
   MAP CONTAINER
================= */
.map-container-main {
    position: relative;
    overflow: hidden;
    background: var(--finder-gray-100);
}

#races-map, #races-map-mobile {
    height: 100%;
    width: 100%;
}

.map-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.map-control-btn {
    background: white;
    border: 2px solid var(--finder-gray-200);
    border-radius: 10px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--finder-gray-600);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.map-control-btn:hover {
    background: var(--finder-primary);
    color: white;
    border-color: var(--finder-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

/* Map Legend */
.map-legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: white;
    border-radius: 8px;
    padding: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--finder-gray-200);
    min-width: 180px;
    z-index: 1000;
}

.legend-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--finder-gray-700);
    border-bottom: 1px solid var(--finder-gray-200);
    padding-bottom: 0.5rem;
}

.legend-header i {
    color: var(--finder-primary);
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--finder-gray-600);
}

.legend-marker {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: white;
    flex-shrink: 0;
}

.legend-marker.regular {
    background: var(--finder-primary);
}

.legend-marker.featured {
    background: #f59e0b;
}

.legend-marker.registration-closed {
    background: #000000;
}

/* List View Overlay */
.list-view-overlay {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.list-view-overlay .btn {
    background: var(--finder-primary);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    transition: all 0.2s ease;
}

.list-view-overlay .btn:hover {
    background: #5855eb;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.list-view-overlay .btn i {
    margin-right: 0.5rem;
}

/* Mobile list overlay positioning */
.mobile-list-overlay {
    bottom: 15px;
    right: 15px;
}

.mobile-list-overlay .btn {
    padding: 0.625rem 0.875rem;
    font-size: 0.9rem;
}

/* =================
   RESPONSIVE DESIGN
================= */
@media (min-width: 769px) {
    /* Desktop: Always show filters, hide mobile header */
    .mobile-filter-header {
        display: none;
    }
    
    .filters-content {
        display: block !important;
        padding: 1rem;
    }
    
    .map-content-container {
        top: auto;
        position: relative;
        height: calc(100vh - 140px);
    }
    
    .map-filters-section {
        position: relative;
        top: auto;
    }
    
    .desktop-layout {
        display: grid;
    }
    
    .mobile-layout {
        display: none;
    }
}

@media (max-width: 768px) {
    :root {
        --filters-height: 70px;
        --filters-height-expanded: 280px;
    }
    
    /* Mobile: Hide desktop layout, show mobile layout */
    .desktop-layout {
        display: none;
    }
    
    .mobile-layout {
        display: block;
    }
    
    .mobile-filter-header h1 {
        font-size: 1.25rem;
    }
    
    .mobile-header-actions {
        gap: 0.375rem;
    }
    
    .mobile-filter-toggle {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .filter-actions {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .btn {
        padding: 0.625rem 0.875rem;
        font-size: 0.8rem;
        min-height: 40px;
    }
    
    .form-control,
    .form-select,
    .filter-dropdown-btn {
        height: 40px;
        padding: 0.625rem;
        font-size: 0.8rem;
    }
    
    .input-group-text {
        padding: 0.625rem;
        min-width: 44px;
    }
    
    .map-controls {
        top: 15px;
        right: 15px;
    }
    
    .map-control-btn {
        width: 40px;
        height: 40px;
    }
    
    /* Fix mobile map container */
    .mobile-layout .map-container-main {
        height: 100%;
        width: 100%;
    }
    
    #races-map-mobile {
        height: 100% !important;
        width: 100% !important;
    }
}

/* =================
   ENHANCED FILTER LAYOUT
================= */
.enhanced-filters-grid {
    display: grid;
    grid-template-columns: 1.5fr 1.5fr 1fr 1.5fr 1fr 0.8fr;
    gap: 0.75rem;
    align-items: end;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-label-compact {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--finder-gray-700);
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.filter-label-compact i {
    font-size: 0.7rem;
    color: var(--finder-primary);
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.range-input {
    flex: 1;
    min-width: 60px;
}

/* Remove compact restrictions to let filters fill space */

/* Price filter row layout */
.price-inputs-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.price-input {
    flex: 1;
    min-width: 70px;
}

/* Filter actions group - align with other inputs */
.filter-actions-aligned {
    display: flex;
    align-items: end;
    height: 32px; /* Same height as filter-dropdown-btn */
}

.clear-all-btn {
    height: 32px;
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 4px;
    border: 1px solid #dc3545;
    background: #dc3545;
    color: white;
    transition: all 0.2s ease;
    font-weight: 500;
}

.clear-all-btn:hover {
    background: #c82333;
    border-color: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

/* Remove specific grid positioning to keep everything on one row */

/* Price presets under label */
.price-presets-under-label {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.25rem;
    flex-wrap: wrap;
}

.price-presets-under-label .preset-btn {
    font-size: 0.65rem;
    padding: 0.15rem 0.3rem;
    border-radius: 3px;
}

/* Map Action Buttons Overlay */
.map-action-buttons {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    justify-content: center;
}

.map-action-btn {
    background: white;
    border: 1px solid var(--finder-gray-300);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--finder-gray-700);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    cursor: pointer;
    min-width: 120px;
    justify-content: center;
}

.map-action-btn:hover {
    background: var(--finder-primary);
    color: white;
    border-color: var(--finder-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    text-decoration: none;
}

.map-action-btn i {
    font-size: 0.875rem;
}

.list-view-btn {
    background: var(--finder-primary);
    color: white;
    border-color: var(--finder-primary);
}

.list-view-btn:hover {
    background: #5855eb;
    border-color: #5855eb;
    color: white;
}

.show-filters-btn {
    background: var(--finder-success);
    color: white;
    border-color: var(--finder-success);
}

.show-filters-btn:hover {
    background: #059669;
    border-color: #059669;
    color: white;
}

/* Mobile action buttons positioning */
.mobile-action-buttons {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: row;
    justify-content: center;
}

/* Hide filters row (legacy - now unused) */
.hide-filters-row {
    display: none;
}

.range-separator {
    font-size: 0.8rem;
    color: var(--finder-gray-500);
    font-weight: 500;
    padding: 0 0.25rem;
}

.preset-buttons {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.25rem;
    flex-wrap: wrap;
}

.preset-btn {
    background: var(--finder-gray-100);
    border: 1px solid var(--finder-gray-300);
    border-radius: 4px;
    padding: 0.2rem 0.4rem;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--finder-gray-700);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1;
}

.preset-btn:hover {
    background: var(--finder-primary);
    color: white;
    border-color: var(--finder-primary);
}

.preset-btn.active {
    background: var(--finder-primary);
    color: white;
    border-color: var(--finder-primary);
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

.preset-btn-success {
    background: var(--finder-success);
    color: white;
    border-color: var(--finder-success);
}

.preset-btn-success:hover {
    background: #059669;
    border-color: #059669;
}

/* Form control sizing */
.form-control-sm {
    height: 32px;
    padding: 0.375rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 4px;
    border: 1px solid var(--finder-gray-300);
    transition: border-color 0.2s ease;
}

.form-control-sm:focus {
    border-color: var(--finder-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
    outline: none;
}

/* Category select with color indicator */
.category-filter select {
    border-left-width: 1px;
    transition: border-left-width 0.2s ease, border-left-color 0.2s ease;
}

.category-filter select[style*="border-left-color"] {
    border-left-width: 4px !important;
}

/* Filter group specific styling - all filters now have equal sizing */

/* Mobile responsive for enhanced filters */
@media (max-width: 768px) {
    .enhanced-filters-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 0.75rem;
    }
    
    .filter-group {
        grid-column: span 1;
    }
    
    .preset-buttons {
        justify-content: center;
    }
    
    .range-inputs {
        justify-content: center;
    }
}

@media (max-width: 1200px) {
    .enhanced-filters-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 0.5rem;
    }
    
    .filter-group {
        grid-column: span 1;
    }
}

/* Loading state for filters */
.filter-group.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Multi-race popup improvements */
.multi-race-item {
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s ease, transform 0.1s ease;
    padding: 0.75rem;
    border: 1px solid var(--finder-gray-200);
    margin-bottom: 0.5rem;
}

.multi-race-item:hover {
    background-color: var(--finder-gray-50);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.multi-race-actions {
    font-size: 0.75rem;
    color: var(--finder-primary);
    margin-top: 0.5rem;
    font-weight: 500;
}

.multi-race-item:hover .multi-race-actions {
    color: var(--finder-primary);
}

.filter-group.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid var(--finder-gray-300);
    border-top: 2px solid var(--finder-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}