/* ========================================
   FLEX CONTAINER FOR TIMELINE AND LEGENDS
   ======================================== */

.map-ui-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: row;
    justify-content: right;
    align-items: end;
    padding: 20px;
    box-sizing: border-box;
    pointer-events: none;
    z-index: 900;
    overflow-x: hidden;
    
}

.map-ui-container,
.map-ui-container * {
  line-height: normal;
}

.map-ui-container .scalar-thermometer *:not(.scalar-indicator-value) {
    line-height: 20px !important;
}

/* To ensure that elements inside the ui-container have the appropriate pointer events */
.map-ui-container > * {
    pointer-events: auto;
}






/* Legend container with fixed width to center the timeline */
.legend-container {
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: calc(50vw - 355px);
    min-width: fit-content;
    flex-shrink: 0;
}

/* ========================================
   TIMELINE CONTROL STYLES
   ======================================== */

.timeline-control {
    position: relative;
    flex-shrink: 1;
    flex-grow: 1;
    max-width: 650px;
    min-width: 300px;
    width: auto;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    padding: 20px 30px;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    z-index: 1000;
    font-family: "Segoe UI", Arial, sans-serif;
    display: none;
    margin-left: auto;
    margin-right: 15px;
}

.timeline-control.active {
    display: block;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timeline-title {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.timeline-time {
    font-size: 13px;
    font-weight: 600;
    color: rgb(255, 255, 255);
}

.timeline-slider-container {
    margin: 10px 0 15px 0;
    position: relative;
}

.timeline-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e5e5e7;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    position: relative;
    cursor: pointer;
}

.timeline-slider.animating {
    pointer-events: none;
}

.timeline-slider-wrapper {
    position: relative;
    width: 100%;
}

/* Vertical line to show NOW */
.timeline-slider-now-marker {
    position: absolute;
    top: 7px;
    height: 50%;
    width: 2px;
    background: #0f5a7c;
    z-index: 5;
    pointer-events: none;
    transform: translateX(-6px);

}

.timeline-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #4fc3f7 0%, #4fc3f7 var(--progress, 0%), #e5e5e7 var(--progress, 0%), #e5e5e7 100%);
}

.timeline-slider::-moz-range-track {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e5e5e7;
}

.timeline-slider::-moz-range-progress {
    height: 6px;
    border-radius: 3px;
    background: #4fc3f7;
}

.timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    cursor: grab;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border: 2px solid #4fc3f7;
    transition: transform 0.1s ease;
    margin-top: -6px;
}

.timeline-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    cursor: grab;
}

.timeline-slider::-webkit-slider-thumb:active {
    transform: scale(0.95);
    cursor: grabbing;
}

.timeline-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    cursor: grab;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border: 2px solid #4fc3f7;
    transition: transform 0.1s ease;
    border: none;
}

.timeline-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
    cursor: grab;
}

.timeline-slider::-moz-range-thumb:active {
    transform: scale(0.95);
    cursor: grabbing;
}

.timeline-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #ffffff;
    margin-top: 8px;
    font-weight: 500;
}

.timeline-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: -15px;
}

.timeline-btn {
    width: 42px;
    height: 42px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #ffffff38;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

.timeline-btn:hover {
    background: #ffffff4f;
    transform: scale(1.05);
}

.timeline-btn:active {
    transform: scale(0.95);
}

.timeline-btn.active {
    background: #4fc3f7;
    color: white;
}

.timeline-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* ========================================
   MEDIA QUERIES
   ======================================== */

/* Tablets and medium screens */
@media (max-width: 850px) {
    .map-ui-container {
        padding: 15px;
    }
    
    .timeline-control {
        max-width: 500px;
        min-width: 250px;
        padding: 15px 20px;
        margin-right: 10px;
    }
    
   
    .timeline-title {
        font-size: 12px;
    }
    
    .timeline-time {
        font-size: 11px;
    }
    
    .timeline-slider-container {
        margin: 8px 0 10px 0;
    }
    
    .timeline-labels {
        font-size: 9px;
    }
}

/* Mobile screens */
@media (max-width: 700px) {
    .map-ui-container {
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
        bottom: 10px;
        left: 10px;
        right: 10px;
        width: calc(100% - 20px);
    }
    
    .legend-container {
        width: 100%;
        min-width: 0;
        flex-shrink: 1;
    }
    
    .timeline-control {
        max-width: 100%;
        min-width: 0;
        padding: 12px 15px;
        margin-right: 0;
        margin-bottom: 10px;
        margin-left: 0;
    }
    
    .timeline-header {
        flex-direction: column;
        gap: 5px;
    }
    
    .timeline-title {
        font-size: 11px;
    }
    
    .timeline-time {
        font-size: 10px;
    }
    
    .timeline-slider-container {
        margin: 5px 0 8px 0;
    }
    
    .timeline-labels {
        font-size: 8px;
    }
    
    .timeline-controls {
        gap: 8px;
        margin-top: -10px;
    }
    
    .timeline-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .timeline-btn svg {
        width: 16px;
        height: 16px;
    }
    
    
}
