body {

    margin: 0;

    font-family: Arial, Helvetica, sans-serif;

    background: #eef5ff;

}

.page {

    max-width: 1600px;

    margin: auto;

}

.header {

    text-align: center;

    padding: 25px 20px;

}

.header h1 {

    color: #2563eb;

    margin: 0;

    font-size: 42px;

}

.header p {

    color: #555;

    margin-top: 10px;

}

.toolbar {

    display: flex;

    justify-content: center;

    gap: 15px;

    padding-bottom: 20px;

    flex-wrap: wrap;

}

.toolbar button {

    background: #2563eb;

    color: white;

    border: none;

    padding: 12px 22px;

    border-radius: 8px;

    cursor: pointer;

    font-size: 16px;

    transition:
        background .2s ease,
        box-shadow .2s ease,
        transform .2s ease;

}

.toolbar button:hover {

    background: #1d4ed8;

}

.toolbar button.active {

    background: #1d4ed8;

    box-shadow: 0 0 12px rgba(37, 99, 235, .4);

    transform: translateY(-1px);

}

/*
|--------------------------------------------------------------------------
| Modalità Radar precipitazioni
|--------------------------------------------------------------------------
*/

.radar-mode {

    width: 100%;

    box-sizing: border-box;

    transition:
        opacity .25s ease,
        transform .25s ease;

}

.radar-mode[hidden] {

    display: none;

}

/*
|--------------------------------------------------------------------------
| Timeline RainViewer
|--------------------------------------------------------------------------
*/

.radar-timeline {

    max-width: 1100px;

    margin: 0 auto 12px;

    padding: 15px 20px;

    background: white;

    border-radius: 12px;

    box-shadow: 0 6px 18px rgba(0, 0, 0, .10);

}

.radar-timeline-header {

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 8px;

    color: #333;

}

.radar-timeline-header strong {

    color: #2563eb;

    font-size: 16px;

}

#radarTime {

    font-weight: bold;

    color: #555;

}

/*
|--------------------------------------------------------------------------
| Informazioni timeline
|--------------------------------------------------------------------------
*/

.radar-timeline-info {

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 10px;

    font-size: 13px;

    color: #6b7280;

}

#radarFrameInfo {

    font-weight: 600;

    color: #555;

}

#radarRelativeTime {

    font-weight: 700;

    color: #2563eb;

}

/*
|--------------------------------------------------------------------------
| Controlli timeline
|--------------------------------------------------------------------------
*/

.radar-timeline-controls {

    display: flex;

    align-items: center;

    gap: 10px;

}

.radar-timeline-controls button {

    width: 42px;

    height: 38px;

    border: none;

    border-radius: 8px;

    background: #2563eb;

    color: white;

    cursor: pointer;

    font-size: 16px;

    flex-shrink: 0;

}

.radar-timeline-controls button:hover {

    background: #1d4ed8;

}

#radarSlider {

    flex: 1;

    cursor: pointer;

    accent-color: #2563eb;

}

/*
|--------------------------------------------------------------------------
| Etichette temporali
|--------------------------------------------------------------------------
*/

.radar-timeline-labels {

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin: 5px 52px 0;

    color: #888;

    font-size: 11px;

    user-select: none;

}

.radar-timeline-labels span:last-child {

    color: #2563eb;

    font-weight: 700;

}

.radar-timeline-labels span.nowcast-placeholder:last-child {

    color: #b8bec8 !important;

    font-weight: 600 !important;

}

/*
|--------------------------------------------------------------------------
| Pulsante Play
|--------------------------------------------------------------------------
*/

.radar-timeline-footer {

    display: flex;

    justify-content: center;

    margin-top: 12px;

}

#radarPlay {

    border: none;

    border-radius: 8px;

    padding: 9px 22px;

    background: #2563eb;

    color: white;

    cursor: pointer;

    font-size: 15px;

    transition:
        background .2s ease,
        transform .2s ease;

}

#radarPlay:hover {

    background: #1d4ed8;

    transform: translateY(-1px);

}

/*
|--------------------------------------------------------------------------
| Legenda precipitazioni
|--------------------------------------------------------------------------
*/

.radar-legend {
    max-width: 1100px;
    margin: 0 auto 20px;
    padding: 14px 20px;

    background: rgba(255, 255, 255, .97);

    border-radius: 12px;

    box-shadow:
        0 5px 16px rgba(0, 0, 0, .08);
}

.radar-legend[hidden] {
    display: none;
}

.radar-legend-title {
    text-align: center;
    margin-bottom: 11px;

    color: #333;

    font-size: 13px;
    font-weight: 700;
}

.radar-legend-scale {
    display: flex;
    justify-content: center;
    align-items: stretch;

    gap: 8px;

    flex-wrap: wrap;
}

.radar-legend-item {
    display: flex;
    align-items: center;

    gap: 6px;

    padding: 4px 7px;

    color: #444;

    font-size: 11px;
    font-weight: 500;

    white-space: nowrap;

    border-radius: 6px;
}

.radar-color {
    width: 26px;
    height: 13px;

    border-radius: 4px;

    display: inline-block;

    box-shadow:
        inset 0 0 0 1px rgba(0, 0, 0, .12),
        0 1px 3px rgba(0, 0, 0, .12);
}

/*
|--------------------------------------------------------------------------
| Scala intensità precipitazioni
|--------------------------------------------------------------------------
*/

.radar-color-1 {
    background: #3b82f6;
}

.radar-color-2 {
    background: #22c55e;
}

.radar-color-3 {
    background: #eab308;
}

.radar-color-4 {
    background: #f97316;
}

.radar-color-5 {
    background: #ef4444;
}

.radar-color-6 {
    background: #a855f7;
}

/*
|--------------------------------------------------------------------------
| Mappa Windy
|--------------------------------------------------------------------------
*/

#windy {

    width: 100%;

    height: 80vh;

    border-radius: 15px;

    overflow: hidden;

    box-shadow: 0 10px 25px rgba(0, 0, 0, .15);

}

/*
|--------------------------------------------------------------------------
| Footer
|--------------------------------------------------------------------------
*/

.footer {

    text-align: center;

    padding: 15px 20px;

    color: #777;

    font-size: 13px;

}

.footer p {

    margin: 0;

}

/*
|--------------------------------------------------------------------------
| Mobile
|--------------------------------------------------------------------------
*/

@media (max-width: 600px) {

    .header {

        padding: 18px 12px;

    }

    .header h1 {

        font-size: 30px;

    }

    .header p {

        font-size: 14px;

    }

    .toolbar {

        gap: 8px;

        padding-left: 10px;

        padding-right: 10px;

    }

    .toolbar button {

        padding: 10px 14px;

        font-size: 14px;

    }

    .radar-timeline {

        margin-left: 10px;

        margin-right: 10px;

        padding: 12px;

    }

    .radar-timeline-header {

        font-size: 14px;

    }

    .radar-timeline-controls button {

        width: 38px;

        height: 36px;

    }

    .radar-timeline-labels {

        margin-left: 48px;

        margin-right: 48px;

        font-size: 10px;

    }

    .radar-timeline-info {

        font-size: 12px;

    }

    .radar-legend {

        margin-left: 10px;

        margin-right: 10px;

        padding: 10px;

    }

    .radar-legend-scale {

        gap: 9px;

    }

    .radar-legend-item {

        font-size: 10px;

    }

    .radar-color {

        width: 15px;

        height: 10px;

    }

    #radarPlay {

        padding: 8px 20px;

    }

    #windy {

        height: 75vh;

        border-radius: 10px;

    }

}
/*
|--------------------------------------------------------------------------
| Timeline nowcast
|--------------------------------------------------------------------------
*/

.radar-timeline-labels .nowcast-separator {

    color: #2563eb;

    font-weight: 700;

    white-space: nowrap;

}

.radar-timeline-labels .nowcast-placeholder {

    color: #b8bec8;

    font-weight: 600;

    opacity: 0.65;

    white-space: nowrap;

}

.radar-timeline-labels .radar-past-label {

    white-space: nowrap;

}

.radar-timeline-labels .current {

    color: #2563eb;

    font-weight: 700;

}

@media (max-width: 900px) {

    .radar-timeline-labels {

        gap: 8px;

        overflow-x: auto;

        justify-content: flex-start;

        padding-bottom: 3px;

        scrollbar-width: thin;

    }

    .radar-timeline-labels span {

        flex: 0 0 auto;

    }

}

/*
|--------------------------------------------------------------------------
| Fulmini Xweather
|--------------------------------------------------------------------------
*/

.lightning-marker {
    background: transparent !important;
    border: none !important;
}

.lightning-marker span {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;

    color: #ffd400;
    font-size: 25px;
    line-height: 1;

    text-shadow:
        0 0 3px #ffffff,
        0 0 7px #ffd400,
        0 0 14px #ffb300;

    filter: drop-shadow(
        0 0 5px rgba(255, 210, 0, .9)
    );

    animation: lightningFlash 1.2s ease-in-out infinite;
}

@keyframes lightningFlash {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    45% {
        opacity: .45;
        transform: scale(.88);
    }

    55% {
        opacity: 1;
        transform: scale(1.08);
    }
}


/*
|--------------------------------------------------------------------------
| Pannello informazioni fulmini
|--------------------------------------------------------------------------
*/

.lightning-info {
    position: absolute;
    right: 20px;
    bottom: 20px;
    z-index: 1000;

    min-width: 220px;
    padding: 14px 16px;

    background: rgba(15, 23, 42, .92);
    color: #fff;

    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 12px;

    box-shadow: 0 8px 25px rgba(0, 0, 0, .30);

    font-family: Arial, Helvetica, sans-serif;
    backdrop-filter: blur(8px);
}

.lightning-info-title {
    margin-bottom: 10px;

    font-size: 17px;
    font-weight: 700;

    color: #ffd400;
}

.lightning-info-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;

    margin: 6px 0;

    font-size: 13px;
}

.lightning-info-row strong {
    font-weight: 700;
    color: #fff;
}

.lightning-info-status {
    margin-top: 10px;
    padding-top: 8px;

    border-top: 1px solid rgba(255, 255, 255, .12);

    font-size: 11px;
    color: #a7f3d0;
}

/*
|--------------------------------------------------------------------------
| Pannello informazioni raffiche vento
|--------------------------------------------------------------------------
*/

.gust-info {
    position: absolute;
    right: 20px;
    bottom: 20px;
    z-index: 1000;

    min-width: 220px;
    padding: 14px 16px;

    background: rgba(15, 23, 42, .92);
    color: #fff;

    border: 1px solid rgba(125, 211, 252, .30);
    border-radius: 12px;

    box-shadow: 0 8px 25px rgba(0, 0, 0, .30);

    font-family: Arial, Helvetica, sans-serif;
    backdrop-filter: blur(8px);
}

.gust-info[hidden] {
    display: none;
}

.gust-info-title {
    margin-bottom: 10px;

    font-size: 17px;
    font-weight: 700;

    color: #7dd3fc;
}

.gust-info-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;

    margin: 6px 0;

    font-size: 13px;
}

.gust-info-row strong {
    font-weight: 700;
    color: #fff;
}

.gust-info-status {
    margin-top: 10px;
    padding-top: 8px;

    border-top: 1px solid rgba(255, 255, 255, .12);

    font-size: 11px;
    color: #a7f3d0;
}

@media (max-width: 576px) {

    .gust-info {
        right: 10px;
        bottom: 10px;

        min-width: 200px;
        max-width: calc(100% - 20px);

        padding: 12px 14px;
    }

    .gust-info-title {
        font-size: 15px;
    }

    .gust-info-row {
        font-size: 12px;
    }
}



/* --------------------------------------------------------------------------
   Pannello informazioni Maree
   -------------------------------------------------------------------------- */

.tide-info {
    position: absolute;
    right: 20px;
    bottom: 20px;
    z-index: 1000;

    min-width: 280px;
    max-width: 360px;
    padding: 14px 16px;

    background: rgba(15, 23, 42, .94);
    color: #fff;

    border: 1px solid rgba(56, 189, 248, .35);
    border-radius: 12px;

    box-shadow: 0 8px 25px rgba(0, 0, 0, .30);

    font-family: Arial, Helvetica, sans-serif;
    backdrop-filter: blur(8px);
}

.tide-info[hidden] {
    display: none;
}

.tide-info-title {
    margin-bottom: 10px;

    font-size: 17px;
    font-weight: 700;

    color: #7dd3fc;
}

.tide-info-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;

    margin: 6px 0;

    font-size: 13px;
}

.tide-info-row strong {
    font-weight: 700;
    color: #fff;
    text-align: right;
}

.tide-info-status {
    margin-top: 10px;
    padding-top: 8px;

    border-top: 1px solid rgba(255, 255, 255, .12);

    font-size: 11px;
    color: #a7f3d0;
}

.tide-info-mose {
    margin-top: 8px;
    padding-top: 8px;

    border-top: 1px solid rgba(255, 255, 255, .12);

    font-size: 12px;
    line-height: 1.55;

    color: #e2e8f0;
}

.tide-info-mose strong {
    color: #7dd3fc;
}

.tide-info-mose .mose-open {
    color: #86efac;
}

.tide-info-mose .mose-closed {
    color: #fca5a5;
}

.tide-info-mose .mose-unknown {
    color: #fde68a;
}

@media (max-width: 576px) {

    .tide-info {
        right: 10px;
        bottom: 10px;

        min-width: 0;
        width: calc(100% - 20px);
        max-width: calc(100% - 20px);

        padding: 12px 14px;
    }

    .tide-info-title {
        font-size: 15px;
    }

    .tide-info-row {
        font-size: 12px;
    }

    .tide-info-mose {
        font-size: 11px;
    }
}

/* --------------------------------------------------------------------------
   Satellite EUMETSAT
   -------------------------------------------------------------------------- */

.toolbar button#btnSatellite {
    position: relative;
}

.toolbar button#btnSatellite.active {
    background: rgba(30, 144, 255, .90);
    color: #fff;
    border-color: rgba(255, 255, 255, .55);
    box-shadow: 0 0 12px rgba(30, 144, 255, .55);
}

.toolbar button#btnSatellite.active::after {
    content: "LIVE";
    position: absolute;
    top: -7px;
    right: -7px;
    padding: 2px 5px;
    border-radius: 5px;
    background: #e53935;
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .4px;
}


/* --------------------------------------------------------------------------
   Controllo opacità Satellite
   -------------------------------------------------------------------------- */

.satellite-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 8px;
    background: rgba(0, 0, 0, .65);
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, .25);
    backdrop-filter: blur(6px);
}

.satellite-controls label {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.satellite-controls label strong {
    color: #7dd3fc;
}

.satellite-controls input[type="range"] {
    width: 110px;
    cursor: pointer;
}


/* --------------------------------------------------------------------------
   Indicatore raffiche reali Meteopego
   -------------------------------------------------------------------------- */

.gust-indicator {
    position: absolute;
    left: 20px;
    top: 20px;
    z-index: 1000;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 9px 13px;

    background: rgba(15, 23, 42, .92);
    color: #fff;

    border: 1px solid rgba(125, 211, 252, .35);
    border-radius: 12px;

    box-shadow: 0 8px 25px rgba(0, 0, 0, .30);

    font-family: Arial, Helvetica, sans-serif;
    backdrop-filter: blur(8px);
}

.gust-indicator[hidden] {
    display: none;
}

.gust-indicator-arrow {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: rgba(125, 211, 252, .15);
    border: 1px solid rgba(125, 211, 252, .35);

    color: #7dd3fc;
    font-size: 27px;
    font-weight: 700;

    line-height: 1;

    transition: transform .4s ease;
}

.gust-indicator-value {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

@media (max-width: 576px) {

    .gust-indicator {
        left: 10px;
        top: 10px;
        padding: 7px 10px;
    }

    .gust-indicator-arrow {
        width: 34px;
        height: 34px;
        font-size: 23px;
    }

    .gust-indicator-value {
        font-size: 12px;
    }

}
