/* =========================================================================
   LỚP DỮ LIỆU KIỂU WINDY: thanh chọn lớp + chú giải thang màu
   (tách khỏi style.css; logic ở khối "LỚP DỮ LIỆU KIỂU WINDY" trong app.js)
   ========================================================================= */

/* Thanh chọn lớp: cạnh trái, giữa chiều cao bản đồ (panel phải rộng 420px) */
#layer-rail {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.layer-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 76px;
    padding: 9px 4px 7px;
    background: rgba(11, 16, 28, 0.92);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.75);
    font-family: inherit;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.layer-btn i { font-size: 16px; }
.layer-btn:hover { color: #fff; border-color: rgba(0, 210, 255, 0.5); }
.layer-btn.active {
    color: #fff;
    background: rgba(0, 210, 255, 0.16);
    border-color: #00d2ff;
}
.layer-btn:focus-visible { outline: 2px solid #00d2ff; outline-offset: 2px; }

/* Chú giải lớp mưa: thang màu + kim chỉ giá trị tại con trỏ */
#legend-rain-section[hidden] { display: none; }
.rain-legend-scale { position: relative; margin: 6px 2px 18px; min-width: 240px; }
.rain-legend-bar {
    position: relative;
    height: 10px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.rain-legend-needle {
    position: absolute;
    top: -4px;
    width: 2px;
    height: 18px;
    margin-left: -1px;
    background: #fff;
    border-radius: 1px;
    box-shadow: 0 0 0 1px rgba(11, 16, 28, 0.9);
    transition: left 0.08s linear;
}
.rain-legend-needle[hidden] { display: none; }
.rain-legend-ticks { position: absolute; left: 0; right: 0; top: 14px; height: 12px; }
.rain-legend-ticks span {
    position: absolute;
    transform: translateX(-50%);
    font-size: 9px;
    color: rgba(255, 255, 255, 0.6);
}
.rain-legend-readout { font-size: 11px; color: rgba(255, 255, 255, 0.8); }
.rain-legend-readout b { color: #fff; }
.rain-legend-fresh { margin-top: 3px; font-size: 9.5px; color: rgba(255, 255, 255, 0.5); }

/* Chế độ địa hình 3D: bỏ vòng nhấp nháy + đổ bóng của marker trạm.
   Mỗi marker động buộc trình duyệt tính lại style/vẽ lại từng khung hình trong lúc kéo. */
.og-terrain-3d .marker-pulse { animation: none !important; display: none !important; }
.og-terrain-3d .custom-pulsing-marker svg polygon { filter: none !important; }

@media (max-width: 768px) {
    /* Panel phải thành bottom sheet cao 45vh -> đặt thanh lớp lên trên */
    #layer-rail { top: 120px; bottom: auto; transform: none; }
    .layer-btn { width: 64px; }
}
