/**
 * Museum Map Styles
 * 
 * CSS styles for the interactive museum map interface
 * Includes responsive design and brand color integration
 * 
 * @package AutomuseumsCore
 * @version 1.0.0
 * @author  Synergy Marketing info@synergymarketing.mk
 */

/* Museum Map Wrapper - Controls layout ordering */
.museum-map-wrapper {
    display: block;
    width: 100%;
    position: relative;
    z-index: 1; /* Establish stacking context for children */
}

/* Ensure map-only wrapper also has proper stacking */
.museum-map-only-wrapper {
    position: relative;
    z-index: 1;
}

/* Map Container Styles */
.museum-map-container {
    position: relative;
    z-index: 1; /* IMPORTANT: Creates stacking context to contain Leaflet's internal z-indexes */
    width: 100%;
    height: 500px;
    min-height: 400px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background: #f9f9f9;
}

.museum-map-container.fullscreen {
    height: 100vh;
    border-radius: 0;
}

/* Map Loading Indicator */
.map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: none;
}

.map-loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #0073aa;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Museum Map Loading Overlay with Progress Bar (P1-MAP-2) */
.museum-map-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.museum-map-loading-overlay.visible {
    opacity: 1;
}

.museum-map-loading-overlay.fade-out {
    opacity: 0;
}

.loading-content {
    text-align: center;
    max-width: 300px;
    width: 90%;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

.loading-text {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 15px;
}

.loading-progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.loading-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0073aa, #005177);
    border-radius: 4px;
    transition: width 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 115, 170, 0.4);
}

.loading-percentage {
    font-size: 14px;
    font-weight: 600;
    color: #0073aa;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .loading-content {
        padding: 20px;
        max-width: 250px;
    }

    .loading-spinner {
        width: 40px;
        height: 40px;
        margin-bottom: 15px;
    }

    .loading-text {
        font-size: 14px;
    }

    .loading-percentage {
        font-size: 13px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .loading-spinner {
        animation: none;
        border-top-color: #0073aa;
    }

    .loading-progress-fill {
        transition: none;
    }

    .museum-map-loading-overlay {
        transition: none;
    }
}

/* Map Error Styles */
.map-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #f9f9f9;
    color: #666;
    text-align: center;
    padding: 20px;
}

.map-error p {
    margin: 0;
    font-size: 16px;
}

/* Museum Popup Styles */
.museum-popup {
    max-width: 300px;
    padding: 0;
    font-family: inherit;
}

.museum-popup-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
}

.museum-popup-title a {
    color: #0073aa;
    text-decoration: none;
}

.museum-popup-title a:hover {
    color: #005177;
    text-decoration: underline;
}

.museum-popup-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
}

.museum-popup-address {
    margin: 0 0 8px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

.museum-popup-categories {
    margin: 0 0 12px 0;
    color: #666;
    font-size: 13px;
    font-style: italic;
}

.museum-popup-actions {
    text-align: center;
    margin-top: 10px;
}

.museum-popup-actions .button-primary {
    background: #0073aa;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 3px;
    font-size: 13px;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.museum-popup-actions .button-primary:hover {
    background: #005177;
}

/* Leaflet Customizations */
.leaflet-container {
    font-family: inherit;
}

/* Custom marker cluster styling */
.marker-cluster {
    background-color: rgba(0, 115, 170, 0.8);
    border: 2px solid rgba(0, 115, 170, 1);
}

.marker-cluster div {
    background-color: rgba(0, 115, 170, 0.9);
    color: white;
    font-weight: bold;
    text-align: center;
    border-radius: 50%;
}

.marker-cluster-small {
    width: 40px;
    height: 40px;
}

.marker-cluster-small div {
    width: 30px;
    height: 30px;
    margin: 5px;
    line-height: 30px;
    font-size: 12px;
}

.marker-cluster-medium {
    width: 50px;
    height: 50px;
}

.marker-cluster-medium div {
    width: 40px;
    height: 40px;
    margin: 5px;
    line-height: 40px;
    font-size: 14px;
}

.marker-cluster-large {
    width: 60px;
    height: 60px;
}

.marker-cluster-large div {
    width: 50px;
    height: 50px;
    margin: 5px;
    line-height: 50px;
    font-size: 16px;
}

/* Museum Search Interface Styles */
.museum-search-interface {
    position: relative;
    z-index: 1100;
    margin-bottom: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
}

.museum-search-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.museum-search-input {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
}

.museum-search-input:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
    outline: none;
}

.museum-search-button,
.museum-search-clear {
    padding: 8px 16px;
    border: 1px solid #0073aa;
    background: #0073aa;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
    text-decoration: none;
    transition: all 0.2s ease;
}

.museum-search-clear {
    background: #666;
    border-color: #666;
}

.museum-search-button:hover,
.museum-search-button:focus {
    background: #005177;
    border-color: #005177;
}

.museum-search-clear:hover,
.museum-search-clear:focus {
    background: #444;
    border-color: #444;
}

.museum-search-button:disabled {
    background: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
}

/* Search Results Display */
.museum-search-results {
    margin-top: 10px;
}

.search-message {
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
}

.search-message.search-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.search-message.search-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.search-message.search-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Autocomplete Suggestions */
.autocomplete-suggestions {
    position: absolute;
    z-index: 1000;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    max-height: 200px;
    overflow-y: auto;
    left: 0;
    right: 0;
}

.autocomplete-suggestion {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f1;
    font-size: 14px;
    line-height: 1.4;
}

.autocomplete-suggestion:hover {
    background: #f6f7f7;
}

.autocomplete-suggestion:last-child {
    border-bottom: none;
}

.suggestion-type {
    float: right;
    color: #666;
    font-size: 12px;
    font-style: italic;
}

/* Search Result Markers */
.search-result-marker.highlighted {
    filter: hue-rotate(45deg) brightness(1.2);
    transform: scale(1.1);
    transition: all 0.3s ease;
}

/* Red Search Result Marker Styling */
.search-result-marker-icon {
    filter: drop-shadow(0 2px 4px rgba(214, 54, 56, 0.3));
    transition: all 0.3s ease;
}

.search-result-marker-icon:hover {
    filter: drop-shadow(0 4px 8px rgba(214, 54, 56, 0.5));
    transform: scale(1.05);
}

/* Exact Match Marker with Pulsing Animation */
.exact-match-marker-icon,
.pulsing-exact-match {
    animation: pulseRed 2s infinite;
    filter: drop-shadow(0 3px 6px rgba(214, 54, 56, 0.6));
}

@keyframes pulseRed {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 3px 6px rgba(214, 54, 56, 0.6));
    }
    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 5px 10px rgba(214, 54, 56, 0.8)) brightness(1.2);
    }
    100% {
        transform: scale(1);
        filter: drop-shadow(0 3px 6px rgba(214, 54, 56, 0.6));
    }
}

/* Search Result Popup Styling */
.search-result-popup .search-result-indicator {
    margin-right: 5px;
    font-size: 16px;
}

.search-result-title {
    color: #d63638 !important;
}

/* Exact Match Popup Styling */
.exact-match-popup {
    border: 2px solid #d63638;
    background: #fffef7;
}

.exact-match-popup .museum-popup-title {
    background: linear-gradient(45deg, #d63638, #ff4444);
    color: white !important;
    padding: 8px 12px;
    margin: -12px -12px 12px -12px;
    border-radius: 4px 4px 0 0;
}

.exact-match-popup .museum-popup-title a {
    color: white !important;
}

.exact-match-indicator {
    margin-right: 5px;
    font-size: 18px;
    animation: sparkle 1.5s infinite;
}

.exact-match-label {
    font-size: 10px;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 10px;
    margin-right: 5px;
    text-shadow: none;
}

.match-reason {
    background: #e8f5e8;
    color: #2d5a2d;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    margin: 8px 0;
    border-left: 3px solid #d63638;
}

@keyframes sparkle {
    0%, 100% { 
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    25% { 
        transform: scale(1.2) rotate(90deg);
        opacity: 0.8;
    }
    50% { 
        transform: scale(1) rotate(180deg);
        opacity: 1;
    }
    75% { 
        transform: scale(1.2) rotate(270deg);
        opacity: 0.8;
    }
}

/* Enhanced Search Result Visibility */
.search-result-marker-icon,
.exact-match-marker-icon {
    z-index: 1000 !important;
    position: relative;
}

/* Ensure search results are above regular markers */
.leaflet-marker-pane .search-result-marker-icon,
.leaflet-marker-pane .exact-match-marker-icon {
    z-index: 1000 !important;
}

/* CSS Fallback for when custom icons don't load */
.leaflet-marker-icon.red-marker-fallback {
    filter: hue-rotate(220deg) saturate(2) brightness(0.8) !important;
    border: 3px solid #d63638 !important;
    border-radius: 50% 50% 50% 0 !important;
    transform: rotate(-45deg) scale(1.2) !important;
    box-shadow: 0 3px 6px rgba(214, 54, 56, 0.4) !important;
    animation: redMarkerPulse 2s infinite !important;
}

.leaflet-marker-icon.exact-match-marker.red-marker-fallback {
    transform: rotate(-45deg) scale(1.4) !important;
    animation: redMarkerPulse 1s infinite, exactMatchBounce 3s infinite !important;
    border-width: 4px !important;
}

@keyframes redMarkerPulse {
    0%, 100% { 
        box-shadow: 0 3px 6px rgba(214, 54, 56, 0.4);
        transform: rotate(-45deg) scale(1.2);
    }
    50% { 
        box-shadow: 0 5px 10px rgba(214, 54, 56, 0.8);
        transform: rotate(-45deg) scale(1.3);
    }
}

@keyframes exactMatchBounce {
    0%, 100% { 
        transform: rotate(-45deg) scale(1.4) translateY(0);
    }
    50% { 
        transform: rotate(-45deg) scale(1.5) translateY(-5px);
    }
}

/* Loading States */
.museum-map-container.searching {
    opacity: 0.8;
}

.museum-map-container.searching::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 999;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .museum-search-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .museum-search-input {
        min-width: auto;
        width: 100%;
    }
    
    .museum-search-button,
    .museum-search-clear {
        width: 100%;
        justify-content: center;
    }
    
    .autocomplete-suggestions {
        position: fixed;
        left: 10px;
        right: 10px;
        max-height: 150px;
    }
}

/* Leaflet popup customizations */
.leaflet-popup-content-wrapper {
    border-radius: 6px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-content {
    margin: 12px;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 768px) {
    .museum-map-container {
        height: 400px;
        min-height: 300px;
    }
    
    .museum-popup {
        max-width: 250px;
    }
    
    .museum-popup-image {
        height: 120px;
    }
    
    .museum-popup-title {
        font-size: 15px;
    }
    
    /* Ensure map controls are touch-friendly */
    .leaflet-control-zoom a {
        width: 36px;
        height: 36px;
        line-height: 36px;
        font-size: 18px;
    }
    
    .leaflet-control-attribution {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .museum-map-container {
        height: 350px;
        min-height: 250px;
    }
    
    .museum-popup {
        max-width: 200px;
    }
    
    .museum-popup-image {
        height: 100px;
    }
    
    .map-loading {
        padding: 15px;
        font-size: 14px;
    }
}

/* Museum Filters Interface Styles */
.museum-filters-container {
    position: relative;
    z-index: 1100;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.filters-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filters-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* Collapsible Filter Heading */
.filters-heading-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

.filters-heading-toggle:hover {
    color: #0073aa;
}

.filter-toggle-arrow {
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.filters-heading-toggle.collapsed .filter-toggle-arrow {
    transform: rotate(-90deg);
}

/* Filter Sections Collapse Animation */
.museum-filters-container .filter-sections {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    opacity: 1;
    padding: 0;
}

.museum-filters-container .filter-sections.collapsed {
    max-height: 0 !important;
    opacity: 0 !important;
    padding: 0 !important;
    visibility: hidden;
}

.clear-filters-button {
    background: #dc3545;
    color: white;
    border: 1px solid #dc3545;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-filters-button:hover {
    background: #c82333;
    border-color: #c82333;
}

.filter-section {
    border-bottom: 1px solid #e9ecef;
    padding: 20px;
}

.filter-section:last-child {
    border-bottom: none;
}

.filter-section h5 {
    margin: 0 0 15px 0;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Distance Filter Styles */
.distance-section {
    background: #f8f9ff;
}

.location-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.location-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.15s ease-in-out;
}

.location-input:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.25);
    outline: none;
}

.location-input.required-input {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25);
    animation: shake 0.5s ease-in-out;
}

.location-input.searching {
    border-color: #0073aa;
    background-image: linear-gradient(90deg, #f0f7ff 0%, #ffffff 50%, #f0f7ff 100%);
    background-size: 200% 100%;
    animation: searching-pulse 1.5s ease-in-out infinite;
    font-style: italic;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

@keyframes searching-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.use-location-button {
    background: #28a745;
    color: white;
    border: 1px solid #28a745;
    border-radius: 4px;
    padding: 10px 12px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.use-location-button:hover {
    background: #218838;
    border-color: #218838;
    transform: scale(1.05);
}

.radius-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.radius-selector label {
    font-weight: 500;
    color: #495057;
    white-space: nowrap;
}

/* Radius Controls - manual input and dropdown side-by-side */
.radius-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.radius-input {
    flex: 1;
    min-width: 100px;
    max-width: 150px;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    -moz-appearance: textfield; /* Hide spinner in Firefox */
}

/* Hide number input spinners */
.radius-input::-webkit-outer-spin-button,
.radius-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.radius-input:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.25);
    outline: none;
}

.radius-select {
    flex: 1;
    min-width: 120px;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.radius-select:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.25);
    outline: none;
}

/* Taxonomy Filter Styles */
.taxonomy-section {
    background: #fff8f5;
}

.taxonomy-group {
    margin-bottom: 15px;
}

.taxonomy-group:last-child {
    margin-bottom: 0;
}

.taxonomy-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
    font-size: 13px;
}

.taxonomy-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    transition: border-color 0.15s ease-in-out;
}

.taxonomy-select:focus {
    border-color: #fd7e14;
    box-shadow: 0 0 0 2px rgba(253, 126, 20, 0.25);
    outline: none;
}

/* Map Filter Styles */
.map-section {
    background: #f0f8f0;
}

.enable-map-selection,
.disable-map-selection {
    background: #17a2b8;
    color: white;
    border: 1px solid #17a2b8;
    border-radius: 4px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    width: 100%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.enable-map-selection:hover,
.disable-map-selection:hover {
    background: #138496;
    border-color: #138496;
}

.map-selection-info {
    text-align: center;
    color: #495057;
    font-size: 14px;
    line-height: 1.5;
}

.map-selection-info p {
    margin: 10px 0;
}

.disable-map-selection {
    background: #6c757d;
    border-color: #6c757d;
    font-size: 13px;
    padding: 8px 12px;
    margin-top: 10px;
}

.disable-map-selection:hover {
    background: #545b62;
    border-color: #545b62;
}

/* Active Filters Display */
.active-filters-section {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 15px 20px;
}

.active-filters-display {
    margin-bottom: 10px;
}

.active-filters-label {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.active-filter-tag {
    display: inline-block;
    background: #0073aa;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    margin-right: 6px;
    margin-bottom: 4px;
    font-weight: 500;
}

.filter-results-count {
    text-align: center;
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

.results-count {
    color: #28a745;
}

.filtering-indicator {
    color: #ffc107;
}

.filter-error {
    color: #dc3545;
}

/* Filtered Museum Markers */
.filtered-museum-marker {
    filter: hue-rotate(120deg) saturate(1.5) brightness(1.1);
    z-index: 800;
}

.filtered-popup {
    border: 2px solid #28a745;
}

.filtered-popup .museum-popup-title {
    color: #28a745 !important;
}

.filter-indicator {
    color: #28a745;
    margin-right: 5px;
    font-size: 16px;
}

/* Loading State for Filtering */
.museum-map-container.filtering {
    opacity: 0.7;
    pointer-events: none;
}

.museum-map-container.filtering::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1001;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 50%;
}

/* Mobile Responsive for Filters */
@media (max-width: 768px) {
    .filters-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
        text-align: center;
    }
    
    .clear-filters-button {
        width: 100%;
    }
    
    .filter-section {
        padding: 15px;
    }
    
    .location-input-group {
        flex-direction: column;
    }
    
    .use-location-button {
        order: -1;
        padding: 12px;
        font-size: 14px;
    }
    
    .radius-selector {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }
    
    .radius-selector label {
        font-size: 14px;
    }
    
    .active-filters-section {
        padding: 12px 15px;
    }
    
    .active-filter-tag {
        display: block;
        text-align: center;
        margin: 0 0 8px 0;
        padding: 8px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .filter-section h5 {
        font-size: 13px;
    }
    
    .location-input,
    .radius-input,
    .radius-select,
    .taxonomy-select {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 12px;
    }

    .radius-controls {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }

    .radius-input,
    .radius-select {
        max-width: none;
        width: 100%;
    }
    
    .enable-map-selection,
    .disable-map-selection {
        padding: 12px 16px;
        font-size: 13px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .museum-filters-container {
        border: 2px solid #000;
    }
    
    .filter-section {
        border-bottom: 2px solid #000;
    }
    
    .active-filter-tag {
        background: #000;
        color: #fff;
        border: 1px solid #fff;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .location-input.required-input {
        animation: none;
        border-color: #dc3545;
    }
    
    .use-location-button:hover {
        transform: none;
    }
    
    .museum-map-container.filtering::after {
        animation: none;
    }
}

/* =====================================================
 * USER LOCATION MARKER STYLES (BUG-007-A)
 * Styles for the "Locate Me" feature user marker
 * ===================================================== */

/* User Location Marker Container */
.user-location-marker {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* User Marker Dot - Center blue dot */
.user-marker-dot {
	position: absolute;
	width: 14px;
	height: 14px;
	background: #3388ff;
	border: 3px solid #fff;
	border-radius: 50%;
	box-shadow: 0 2px 6px rgba(51, 136, 255, 0.5);
	z-index: 2;
}

/* User Marker Pulse - Animated ring effect */
.user-marker-pulse {
	position: absolute;
	width: 24px;
	height: 24px;
	background: rgba(51, 136, 255, 0.4);
	border-radius: 50%;
	z-index: 1;
	animation: user-marker-pulse 2s ease-out infinite;
}

/* Pulsing animation keyframes */
@keyframes user-marker-pulse {
	0% {
		transform: scale(0.8);
		opacity: 1;
	}
	50% {
		transform: scale(1.5);
		opacity: 0.5;
	}
	100% {
		transform: scale(2);
		opacity: 0;
	}
}

/* User Location Popup Styling */
.user-location-popup-container .leaflet-popup-content-wrapper {
	background: #3388ff;
	color: #fff;
	border-radius: 8px;
	box-shadow: 0 3px 14px rgba(51, 136, 255, 0.4);
}

.user-location-popup-container .leaflet-popup-tip {
	background: #3388ff;
}

.user-location-popup-container .leaflet-popup-close-button {
	color: #fff;
}

.user-location-popup-container .leaflet-popup-close-button:hover {
	color: rgba(255, 255, 255, 0.8);
}

.user-location-popup {
	text-align: center;
	padding: 4px 8px;
}

.user-location-popup strong {
	display: block;
	font-size: 14px;
	margin-bottom: 4px;
}

.user-location-popup small {
	display: block;
	font-size: 11px;
	opacity: 0.9;
}

/* Radius Circle Hover State */
.leaflet-interactive.user-radius-circle:hover {
	fill-opacity: 0.2;
}

/* Loading state for location button */
.use-location-button.loading {
	opacity: 0.7;
	pointer-events: none;
}

.use-location-button .loading-spinner-small {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

/* Distance section active state */
.distance-section.has-user-location .location-input {
	background: #e8f4fc;
	border-color: #3388ff;
}

.distance-section.has-user-location .use-location-button {
	background: #3388ff;
	color: #fff;
}

/* Reduced motion support for user location marker */
@media (prefers-reduced-motion: reduce) {
	.user-marker-pulse {
		animation: none;
		transform: scale(1.2);
		opacity: 0.4;
	}

	.use-location-button .loading-spinner-small {
		animation: none;
	}
}

/* =====================================================
 * END USER LOCATION MARKER STYLES
 * ===================================================== */

/* Print Styles */
@media print {
    .museum-map-container {
        height: 400px;
        border: 1px solid #000;
    }

    .leaflet-control-container {
        display: none;
    }

    .museum-filters-container {
        display: none;
    }
}

/* ============================================
   Museum Hover Card - Vertical Layout (Image on Top)
   Author: Synergy Marketing
   ============================================ */

/* Card Container - Rectangular, no rounded corners */
.museum-hover-card {
	position: absolute;
	background: #FFFFFF;
	border: 1px solid #E5E7EB;
	border-radius: 0; /* Rectangular - no curves */
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	width: 280px;
	max-width: 320px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-10px);
	transition: all 0.3s ease;
	z-index: 1000;
	overflow: hidden;
}

.museum-hover-card-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.museum-hover-card:hover {
	border: 2px solid #2563EB; /* Brand blue border on hover */
}

/* Close Button - Top Right Corner */
.museum-card-close {
	position: absolute;
	top: 8px;
	right: 8px;
	background: rgba(0, 0, 0, 0.5);
	border: none;
	color: #FFFFFF;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 0; /* Rectangular */
	z-index: 10;
	transition: background 0.2s ease;
}

.museum-card-close:hover {
	background: rgba(0, 0, 0, 0.7);
}

/* Museum Image (Top - Full Width) */
.museum-card-image {
	width: 100%;
	height: 140px;
	overflow: hidden;
	background: #F3F4F6;
}

.museum-card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.museum-card-no-image {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #F3F4F6;
	color: #9CA3AF;
	font-size: 14px;
}

/* Museum Content (Below Image) */
.museum-card-content {
	padding: 12px 16px 16px;
}

/* Museum Title */
.museum-card-title {
	font-size: 16px;
	font-weight: 700;
	color: #1F2937;
	margin: 0 0 8px 0;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Info Rows (Address, Vehicle Types) */
.museum-card-info {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	font-size: 13px;
	color: #6B7280;
	line-height: 1.4;
	margin: 0 0 6px 0;
}

.museum-card-info-icon {
	flex-shrink: 0;
	font-size: 14px;
	margin-top: 1px;
}

.museum-card-info-text {
	flex: 1;
	word-break: break-word;
}

/* Action Buttons */
.museum-card-actions {
	margin-top: 12px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.btn-view-details {
	width: 100%;
	padding: 10px 16px;
	font-size: 14px;
	font-weight: 600;
	border-radius: 0; /* Rectangular */
	border: 1px solid #2563EB; /* Brand blue border */
	cursor: pointer;
	transition: all 0.2s ease;
	text-decoration: none;
	text-align: center;
	display: block;
	background: #2563EB;
	color: #FFFFFF;
}

.btn-view-details:hover {
	background: #1D4ED8;
	border-color: #1D4ED8;
	color: #FFFFFF;
	text-decoration: none;
}

/* Add to Plan Button - Green with white text */
.btn-add-to-plan {
	width: 100%;
	padding: 10px 16px;
	font-size: 14px;
	font-weight: 500;
	border-radius: 0; /* Rectangular */
	border: 1px solid #2563EB; /* Brand blue border */
	cursor: pointer;
	transition: all 0.2s ease;
	text-align: center;
	display: block;
	background: #22C55E; /* Green */
	color: #FFFFFF; /* White text */
}

.btn-add-to-plan:hover {
	background: #16A34A; /* Darker green on hover */
	border-color: #2563EB;
}

.btn-add-to-plan.selected {
	background: #DC2626; /* Red when selected (Remove from Plan) */
	border-color: #2563EB;
	color: #FFFFFF;
}

.btn-add-to-plan.selected:hover {
	background: #B91C1C;
	border-color: #2563EB;
}

/* ============================================
   Mobile-First Responsive Design
   ============================================ */

/* Small Mobile (max 360px) */
@media (max-width: 360px) {
	.museum-hover-card {
		width: calc(100vw - 16px);
		max-width: 280px;
	}

	.museum-card-image {
		height: 120px;
	}

	.museum-card-content {
		padding: 10px 12px 12px;
	}

	.museum-card-title {
		font-size: 14px;
	}

	.museum-card-info {
		font-size: 12px;
	}

	.btn-view-details,
	.btn-add-to-plan {
		padding: 8px 12px;
		font-size: 13px;
	}
}

/* Mobile (361px - 480px) */
@media (min-width: 361px) and (max-width: 480px) {
	.museum-hover-card {
		width: 280px;
		max-width: 300px;
	}

	.museum-card-image {
		height: 130px;
	}
}

/* Tablet and Desktop (481px and above) */
@media (min-width: 481px) {
	.museum-hover-card {
		width: 300px;
		max-width: 320px;
	}

	.museum-card-image {
		height: 150px;
	}
}

/* Touch-Friendly Buttons on Mobile */
@media (max-width: 768px) {
	.btn-view-details,
	.btn-add-to-plan {
		min-height: 44px; /* iOS touch target minimum */
	}

	.museum-card-close {
		min-width: 36px;
		min-height: 36px;
		display: flex;
		align-items: center;
		justify-content: center;
	}
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
	.museum-hover-card {
		border: 2px solid #000;
	}

	.btn-view-details {
		border: 2px solid #000;
	}
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
	.museum-hover-card {
		transition: opacity 0.1s ease;
		transform: none;
	}
}

/* ========================================
   Map Overlay Controls (Travel Plan Map Only)
   Left corner, 1/3 width of map
   ======================================== */

.museum-map-only-wrapper.has-overlay-controls {
    position: relative;
}

.museum-map-only-wrapper .map-overlay-controls {
    position: absolute;
    top: 10px;
    left: 10px;
    width: calc(33.333% - 20px); /* 1/3 width minus padding */
    max-width: 400px;
    max-height: calc(100% - 20px);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0; /* Rectangular - no curved angles */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    overflow-y: auto;
    overflow-x: hidden;
}

/* Search Section - adapt existing museum-search-interface for overlay */
.map-overlay-controls .museum-search-interface {
    border: none;
    padding: 10px;
}

/* Filters Wrapper */
.map-overlay-controls .overlay-filters-wrapper {
    padding: 10px;
}

/* Adapt existing museum-filters-container for overlay */
.map-overlay-controls .museum-filters-container {
    padding: 0;
    border: none;
    background: none;
}

.map-overlay-controls .filter-section {
    margin-bottom: 10px;
}

.map-overlay-controls .filter-section:last-child {
    margin-bottom: 0;
}

.map-overlay-controls .filter-section h5 {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.map-overlay-controls .filter-section label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #555;
}

.map-overlay-controls .filter-section select,
.map-overlay-controls .filter-section input[type="text"],
.map-overlay-controls .filter-section input[type="number"] {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 0; /* Rectangular */
    font-size: 13px;
}

.map-overlay-controls .filter-section select:focus,
.map-overlay-controls .filter-section input:focus {
    border-color: #0073aa;
    outline: none;
}

/* Distance Filter Specifics */
.map-overlay-controls .distance-section {
    margin-bottom: 12px;
}

.map-overlay-controls .location-input-group {
    position: relative;
    margin-bottom: 10px;
}

.map-overlay-controls .location-input {
    padding-right: 45px;
}

.map-overlay-controls .use-location-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    font-size: 18px;
    line-height: 1;
}

.map-overlay-controls .use-location-button:hover {
    opacity: 0.7;
}

.map-overlay-controls .radius-selector {
    display: flex;
    gap: 8px;
    align-items: center;
}

.map-overlay-controls .radius-selector label {
    margin: 0;
    flex-shrink: 0;
}

.map-overlay-controls .radius-selector .radius-input {
    flex: 1;
    min-width: 60px;
}

.map-overlay-controls .radius-selector .radius-unit {
    flex: 0 0 70px;
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
    .museum-map-only-wrapper .map-overlay-controls {
        width: calc(40% - 20px); /* Slightly wider on medium screens */
    }
}

@media (max-width: 768px) {
    .museum-map-only-wrapper .map-overlay-controls {
        width: calc(100% - 20px); /* Full width on mobile */
        max-width: none;
        max-height: 50vh; /* Half screen height */
    }
}

/* ========================================
   Above-Map Filters (filter_position="above")
   Full-width filters rendered above the map
   ======================================== */

.above-map-filters {
    width: 100%;
    margin-bottom: 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 0;
    padding: 16px;
    box-sizing: border-box;
}

.above-map-filters .museum-search-interface {
    margin-bottom: 12px;
}

.above-map-filters .museum-filters-container {
    margin: 0;
}

.above-map-filters .filter-sections {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.above-map-filters .filter-section {
    flex: 1 1 200px;
    min-width: 180px;
}

.above-map-filters .filter-section select,
.above-map-filters .filter-section input[type="text"],
.above-map-filters .filter-section input[type="number"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 0;
    font-size: 14px;
}

.above-map-filters .filter-section select:focus,
.above-map-filters .filter-section input:focus {
    border-color: #0073aa;
    outline: none;
}

@media (max-width: 768px) {
    .above-map-filters .filter-sections {
        flex-direction: column;
    }

    .above-map-filters .filter-section {
        min-width: 100%;
    }
}
