/* Interactive Maps Frontend Styles */

.interactive-maps-container {
    position: relative;
    width: 100%;
    margin: 20px 0;
}

.map-controls {
    background: #fff;
    padding: 16px;
    border: 1px solid #e1e1e1;
    border-radius: 12px;
    margin-bottom: 16px;
}

.map-controls h3 {
    margin: 0 0 12px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 500;
}

.controls-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 0;
}

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

.control-group label {
    margin-bottom: 4px;
    font-weight: 500;
    color: #4a5568;
    font-size: 13px;
}

.control-group select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.control-group select:focus {
    outline: none;
    border-color: #3b82f6;
}

.control-group select:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Map Container */

.map-wrapper {
    position: relative;
    border: 1px solid #e1e1e1;
    border-radius: 12px;
    overflow: hidden;
}

#interactive-map {
    width: 100%;
    height: 500px;
    border: none;
}

/* Loading Overlay */

.map-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Leaflet Popup Styles */

.leaflet-popup-content-wrapper {
    border-radius: 12px;
    overflow: hidden;
}

.custom-info-window {
    max-width: 500px;
    padding: 0;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.leaflet-popup-content {
    margin: 0;
    padding: 0;
    width: auto !important;
}

.info-window-header {
    padding: 12px;
    background: transparent;
    color: #2c3e50;
    border-bottom: 1px solid #e1e1e1;
}

.info-window-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.info-window-content {
    padding: 12px;
}

.info-window-description {
    margin-bottom: 15px;
    color: #555;
    line-height: 1.5;
}

/* Image Slider */

.image-slider {
    position: relative;
    margin-bottom: 15px;
}

.slider-container {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    border-radius: 8px;
}

.slider-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
}

.slider-slide {
    min-width: 100%;
    height: 100%;
}

.slider-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.slider-nav:hover {
    background: rgba(0, 0, 0, 0.9);
}

.slider-nav.prev {
    left: 10px;
}

.slider-nav.next {
    right: 10px;
}

.slider-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.slider-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.slider-indicator.active {
    background: white;
}

/* No Images State */

.no-images {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    background: #f9f9f9;
    border-radius: 5px;
}

.no-images .icon {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.4;
}

/* Responsive Design */

@media (max-width: 768px) {
    .map-controls {
        padding: 15px;
    }
    
    .controls-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    #interactive-map {
        height: 400px;
    }
    
    .custom-info-window {
        max-width: 380px;
    }
    
    .leaflet-popup-content-wrapper {
        max-width: 380px;
    }
    
    .info-window-header {
        padding: 12px;
    }
    
    .info-window-header h3 {
        font-size: 16px;
    }
    
    .info-window-content {
        padding: 12px;
    }
    
    .slider-container {
        height: 160px;
    }
    
    .slider-nav {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .map-controls {
        padding: 10px;
    }
    
    #interactive-map {
        height: 350px;
    }
    
    .custom-info-window {
        max-width: 320px;
    }
    
    .leaflet-popup-content-wrapper {
        max-width: 320px;
    }
    
    .slider-container {
        height: 140px;
    }
    
    .info-window-header {
        padding: 10px;
    }
    
    .info-window-content {
        padding: 10px;
    }
}

/* Animation Classes */

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Custom Map Controls */






/* Error States */

.map-error {
    text-align: center;
    padding: 40px 20px;
    background: #fff7f7;
    border: 1px solid #ffcdd2;
    border-radius: 8px;
    color: #d32f2f;
}

.map-error .icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.map-error h3 {
    margin: 0 0 10px 0;
    color: #d32f2f;
}

.map-error p {
    margin: 0;
    color: #666;
}

/* Geolocation Button */
.leaflet-control-geolocation {
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.65);
}

.geolocation-btn {
    background: white;
    border: none;
    padding: 8px;
    cursor: pointer;
    font-size: 16px;
    border-radius: 4px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.geolocation-btn:hover {
    background: #f4f4f4;
}

.geolocation-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Side Panel Styles */
.map-wrapper {
    position: relative;
}

.location-side-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 350px;
    height: 100%;
    background: white;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease-in-out;
    border-radius: 8px 0 0 8px;
}

.location-side-panel.hidden {
    transform: translateX(100%);
}

.location-side-panel.visible {
    transform: translateX(0);
}

.side-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e1e1e1;
    background: #f8f9fa;
    border-radius: 8px 0 0 0;
}

.side-panel-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.panel-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.panel-close-btn:hover {
    background: #e9ecef;
    color: #333;
}

.side-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.panel-image-slider {
    margin-bottom: 20px;
}

.panel-image-slider .image-slider {
    margin-bottom: 0;
}

.panel-image-slider .slider-container {
    height: 200px;
    border-radius: 8px;
}

.panel-location-description {
    color: #555;
    line-height: 1.6;
    font-size: 14px;
}

.panel-no-images {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
}

.panel-no-images .icon {
    font-size: 24px;
    margin-bottom: 8px;
}

/* Responsive adjustments for side panel */
@media (max-width: 768px) {
    .location-side-panel {
        width: 100%;
        border-radius: 0;
    }
    
    .side-panel-header {
        border-radius: 0;
    }
}
