/* ============================================
   Radar Tile Map — Reusable Component
   Shared by live_radar page & weather page embed
   ============================================ */

/* Container */
.radar-tile-map-container {
    height: 800px;

    font-size: 16px;
}

/* When embedded inside the weather page (smaller) */
.radar-tile-map-container--embedded {
    font-size: 16px;
    height: 800px;

}

/* Map */
.rtm-map {
    position: relative;
    top: 0px;
    left: 0px;
    height: calc(100% - 120px);
    width: 100%;
}

/* Header bar (standalone page only) */
.rtm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: #fff;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.rtm-header-left {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.rtm-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
}

.rtm-subtitle {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
}

.rtm-header-right {
    display: flex;
    align-items: center;
}

.rtm-updated {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Layer switcher */
.rtm-layers-container {
    background-color: white;width: max-content;
    border-radius: 5px;
    position: absolute;
    z-index: 1000;
    margin: 10px;
    box-shadow: 0px 0px 10px rgba(0,0,0,0.5);
}

.rtm-layer-tab {

    cursor: pointer;

}

.rtm-layer-tab:hover {
    /* color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.05); */
}

.rtm-layer-tab.active {
    
    font-weight: 700;
}

.radar-tile-map-container .layers-container .active {
    font-weight: 700;
}

/* Timeline */
.rtm-timeline {
    background: rgba(26, 26, 46, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 20px;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.rtm-timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    flex-wrap: wrap;
    gap: 6px;
}

.rtm-timeline-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rtm-timeline-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rtm-timeline-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rtm-utc-badge {
    background: rgba(79, 195, 247, 0.15);
    color: #4fc3f7;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: 0.5px;
    border: 1px solid rgba(79, 195, 247, 0.3);
}

.rtm-timestep-info {
    color: #4fc3f7;
    font-size: 0.85rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Timeline track */
.rtm-track-wrapper {
    position: relative;
    height: 52px;
    margin: 8px 12px 12px;
    cursor: pointer;
    user-select: none;
}

.rtm-track {
    position: absolute;
    top: 18px;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 2px;
}

.rtm-track-fill {
    position: absolute;
    top: 18px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #4fc3f7, #0288d1);
    border-radius: 2px;
    transition: width 0.2s ease;
}

.rtm-track-thumb {
    position: absolute;
    top: 6px;
    left: 0;
    width: 28px;
    height: 28px;
    margin-left: -14px;
    background: #0288d1;
    border: 3px solid #4fc3f7;
    border-radius: 50%;
    z-index: 10;
    transition: left 0.2s ease;
    box-shadow: 0 0 12px rgba(79, 195, 247, 0.5);
}

.rtm-thumb-label {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: 700;
    color: #4fc3f7;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.rtm-tick {
    position: absolute;
    top: 14px;
    width: 1px;
    height: 10px;
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-0.5px);
    cursor: pointer;
}

.rtm-tick-hour {
    height: 14px;
    top: 12px;
    background: rgba(255, 255, 255, 0.35);
    width: 2px;
    transform: translateX(-1px);
}

.rtm-tick-label {
    position: absolute;
    top: 32px;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
    pointer-events: none;
    font-variant-numeric: tabular-nums;
}

.rtm-tick-now {
    position: absolute;
    top: -4px;
    transform: translateX(-50%);
    font-size: 0.65rem;
    font-weight: 700;
    color: #4fc3f7;
    white-space: nowrap;
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Past zone / now line */
.rtm-past-zone {
    position: absolute;
    top: 10px;
    left: 0;
    height: 30px;
    background: rgba(255, 255, 255, 0.03);
    pointer-events: none;
    z-index: 1;
}

.rtm-now-line {
    position: absolute;
    top: 8px;
    width: 2px;
    height: 36px;
    background: #4fc3f7;
    opacity: 0.5;
    pointer-events: none;
    z-index: 2;
}

/* Playback controls */
.rtm-timeline-controls {
    display: flex;
    gap: 4px;
}

.rtm-btn {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.rtm-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Legend */
.rtm-legend {
    background-color: white;width: max-content;
    border-radius: 5px;
    position: absolute;
    z-index: 1000;
    margin: 10px;
    box-shadow: 0px 0px 10px rgba(0,0,0,0.5);
    right: 5px;
    top: 0;

    padding: 10px 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 180px;
}

.rtm-legend-title {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.rtm-legend-bar {
    height: 14px;
    border-radius: 4px;
    /* border: 1px solid #7777776e; */
    background: linear-gradient(to right, transparent, #ff0, #f80, #f00, #b0f);
}

/* Leaflet overrides for dark theme */
/* .radar-tile-map-container .leaflet-control-zoom a {
    background: rgba(26, 26, 46, 0.9);
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
}

.radar-tile-map-container .leaflet-control-zoom a:hover {
    background: rgba(26, 26, 46, 1);
    color: #fff;
}

.radar-tile-map-container .leaflet-control-attribution {
    background: rgba(26, 26, 46, 0.7);
    color: rgba(255, 255, 255, 0.4);
}

.radar-tile-map-container .leaflet-control-attribution a {
    color: rgba(79, 195, 247, 0.6);
} */

/* Responsive */
@media (max-width: 768px) {
    .radar-tile-map-container {
        height: calc(100vh - 60px);
        min-height: 800px;
    }

    .rtm-header {
        padding: 8px 12px;
        flex-wrap: wrap;
    }

    .rtm-title {
        font-size: 1rem;
    }

    .rtm-subtitle {
        display: none;
    }

    .rtm-layers-container {
        top: 50px;
        flex-direction: row;
    }

    .rtm-layer-tab {
        padding: 8px 12px;
        font-size: 0.8rem;
        border-left: none;
        border-bottom: 2px solid transparent;
    }

    .rtm-layer-tab.active {
        border-bottom-color: #4fc3f7;
        border-left-color: transparent;
    }

    .rtm-legend {
        top: 50px;
        right: 8px;
        min-width: 120px;
    }

    .rtm-timeline {
        padding: 8px 12px;
    }

    .rtm-track-wrapper {
        margin: 8px 4px 4px;
    }

    .rtm-thumb-label {
        font-size: 0.65rem;
    }

    .rtm-tick-label {
        font-size: 0.6rem;
    }
}


.s4w-radar-rain{
    filter: blur(2px)
}
.s4w-radar-lightning{
    filter: blur(2px)
}