/**
 * Map viewer styles for EO DataLabs data visualization.
 */

/* Main container layout */
#map-container {
    height: calc(100vh - 120px);
    display: flex;
}

#map {
    flex: 1;
    height: 100%;
    z-index: 1;
}

#sidebar {
    width: 380px;
    background: #f8f9fa;
    border-left: 1px solid #dee2e6;
    overflow-y: auto;
    padding: 1rem;
    z-index: 10;
}

/* Responsive layout */
@media (max-width: 992px) {
    #sidebar {
        width: 320px;
    }
}

@media (max-width: 768px) {
    #map-container {
        flex-direction: column-reverse;
        height: calc(100vh - 60px);
    }
    #sidebar {
        width: 100%;
        max-height: 40vh;
        border-left: none;
        border-top: 1px solid #dee2e6;
    }
    #map {
        height: 60vh;
    }
}

/* Layer item cards */
.layer-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    transition: box-shadow 0.2s;
}

.layer-item:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.layer-item .form-range {
    width: 100%;
    height: 8px;
}

.layer-item .btn-group-sm .btn {
    padding: 0.15rem 0.35rem;
}

/* Search result items */
.search-result-item {
    cursor: pointer;
    transition: background-color 0.15s;
}

.search-result-item:hover {
    background-color: #f0f0f0;
}

.search-result-item.active {
    background-color: #e7f1ff;
    border-left: 3px solid #0d6efd;
}

/* Timeline controls */
.timeline-container {
    background: white;
    border-radius: 6px;
    padding: 0.75rem;
}

.timeline-slider {
    width: 100%;
    margin: 0.5rem 0;
}

.timeline-controls .btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.timeline-date {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Band combination selector */
.band-selector {
    background: white;
    border-radius: 6px;
    padding: 0.75rem;
}

.band-preset {
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.15s;
}

.band-preset:hover {
    background-color: #f0f0f0;
}

.band-preset.active {
    background-color: #e7f1ff;
    border: 1px solid #0d6efd;
}

/* Analysis tools */
.analysis-tools .btn {
    position: relative;
}

.analysis-tools .btn.active {
    background-color: #0d6efd;
    color: white;
}

.query-marker {
    background: transparent;
    border: none;
}

/* Point info popup */
.point-info-popup {
    min-width: 200px;
}

.point-info-popup table {
    width: 100%;
    font-size: 0.8rem;
}

.point-info-popup th {
    font-weight: 600;
    padding-right: 0.5rem;
}

/* Coordinates display */
.leaflet-control-coords {
    font-family: monospace;
    font-size: 0.75rem;
    background: rgba(255,255,255,0.9) !important;
}

/* Custom Leaflet controls */
.leaflet-control-layers {
    border-radius: 6px;
}

.leaflet-control-zoom {
    border-radius: 6px;
}

.leaflet-control-zoom a {
    border-radius: 4px;
}

/* Loading spinner for sidebar */
.sidebar-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Collapsible panels */
.panel-collapse-toggle {
    cursor: pointer;
    user-select: none;
}

.panel-collapse-toggle:hover {
    background-color: rgba(0,0,0,0.05);
}

.panel-collapse-toggle i.rotate {
    transition: transform 0.2s;
}

.panel-collapse-toggle.collapsed i.rotate {
    transform: rotate(-90deg);
}

/* Quick navigation buttons */
.quick-nav-btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Measurement tooltip */
.leaflet-tooltip.measurement-label {
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    font-weight: 500;
}
