* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #081c30;
    color: white;
}

#map {
    position: absolute;
    inset: 0;
}

#header,
#layers,
#regions,
#forecast-info,
#legend {
    position: absolute;
    z-index: 10;
    background: rgba(8, 28, 48, 0.92);
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(0,0,0,.25);
    padding: 14px;
}

#header {
    top: 15px;
    left: 15px;
}

.brand {
    font-size: 23px;
    font-weight: bold;
}

.brand span {
    color: #48b8ff;
}

.subtitle {
    font-size: 12px;
    color: #b5cde0;
    margin-top: 5px;
}

#layers {
    right: 15px;
    top: 130px;
    width: 180px;
}

.panel-title {
    font-size: 12px;
    color: #b5cde0;
    margin-bottom: 12px;
}

button {
    color: white;
    background: #183b57;
    border: 0;
    border-radius: 6px;
    padding: 10px;
    cursor: pointer;
}

button:hover {
    background: #24608a;
}

.layer {
    display: block;
    width: 100%;
    margin-bottom: 5px;
    text-align: left;
}

.layer.active {
    background: #0878c9;
}

.layer:disabled {
    opacity: .45;
    cursor: default;
}

#regions {
    top: 100px;
    left: 15px;
    display: flex;
    gap: 5px;
}

#forecast-info {
    bottom: 110px;
    left: 15px;
    font-size: 13px;
    line-height: 1.7;
}

#legend {
    bottom: 30px;
    left: 15px;
    width: 350px;
    max-width: calc(100% - 30px);
}

.legend-title {
    font-size: 12px;
    margin-bottom: 8px;
}

.gradient {
    height: 12px;
    border-radius: 4px;
    background: linear-gradient(
        to right,
        rgb(35,65,145) 0%,
        rgb(40,110,210) 3.33%,
        rgb(45,170,220) 6.67%,
        rgb(40,200,150) 13.33%,
        rgb(90,210,75) 20%,
        rgb(190,220,45) 26.67%,
        rgb(245,220,40) 33.33%,
        rgb(250,150,35) 40%,
        rgb(235,65,45) 53.33%,
        rgb(190,35,90) 66.67%,
        rgb(155,45,180) 80%,
        rgb(245,220,255) 100%
    );
}

.legend-values {
    position: relative;
    height: 18px;
    font-size: 10px;
    margin-top: 5px;
}

.legend-values span {
    position: absolute;
    transform: translateX(-50%);
}

.legend-values span:nth-child(1) { left: 0%; }
.legend-values span:nth-child(2) { left: 13.33%; }
.legend-values span:nth-child(3) { left: 26.67%; }
.legend-values span:nth-child(4) { left: 40%; }
.legend-values span:nth-child(5) { left: 53.33%; }
.legend-values span:nth-child(6) { left: 66.67%; }
.legend-values span:nth-child(7) { left: 100%; }

.maplibregl-popup-content {
    color: #183b57;
    font-size: 14px;
    line-height: 1.7;
}

@media(max-width: 700px) {

    .brand {
        font-size: 18px;
    }

    #layers {
        top: 140px;
        width: 120px;
        padding: 8px;
    }

    .layer {
        font-size: 11px;
        padding: 8px;
    }

    #regions {
        top: 85px;
        padding: 6px;
    }

    #regions button {
        font-size: 10px;
        padding: 7px;
    }

    #forecast-info {
        font-size: 11px;
        bottom: 110px;
    }

}

body.embed #header,
body.embed #regions,
body.embed #layers {
    display: none;
}

.wind-particles { position:absolute; inset:0; pointer-events:none; z-index:1; }
#wind-controls { position:absolute; z-index:10; right:15px; bottom:30px; background:rgba(8,28,48,.94); border-radius:10px; padding:12px; font-size:12px; display:grid; gap:8px; }
#wind-controls label { display:flex; align-items:center; gap:6px; justify-content:space-between; }
#wind-controls input[type=range] { width:90px; }
#wind-controls select { background:#183b57; color:white; border:1px solid #54738b; border-radius:4px; padding:4px; }
#animation-status:empty { display:none; }
@media(max-width:700px) { #wind-controls { bottom:100px; right:8px; padding:7px; font-size:11px; } #forecast-info { max-width:45%; } #layers { max-height:35vh; overflow:auto; } }
@media(max-height:500px) { #layers { display:none; } #wind-controls { bottom:90px; } #forecast-info { bottom:100px; } }

#timeline {position:absolute;z-index:12;bottom:24px;left:15px;right:15px;background:rgba(8,28,48,.95);padding:10px 14px;border-radius:10px;font-size:12px;}
#timeline[hidden]{display:none} .time-row{display:flex;gap:8px;align-items:center} #forecast-slider{width:100%;margin:8px 0;accent-color:#48b8ff} #time-status{min-height:14px} body.has-timeline #legend{bottom:145px} body.has-timeline #forecast-info{bottom:220px} body.has-timeline #wind-controls{bottom:145px} @media(max-width:700px){body.has-timeline #wind-controls{bottom:220px} body.has-timeline #forecast-info{bottom:220px} body.has-timeline #layers{max-height:22vh}} @media(max-height:500px){body.has-timeline #forecast-info,body.has-timeline #wind-controls{display:none}}
