/* =========================================================
   PALETTE ALPINA – Variabili globali
   ========================================================= */
:root {
    --verde-bosco: #2F5D50;
    --blu-ghiaccio: #6BAED6;
    --bianco-neve: #F5F9FA;
    --grigio-roccia: #2A2A2A;

    --ombra-morbida: 0 4px 12px rgba(0,0,0,0.12);
    --raggio: 10px;
    --max-width: 900px;
}

/* =========================================================
   BASE
   ========================================================= */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Helvetica Neue", Arial, sans-serif;
    background: var(--bianco-neve);
    color: var(--grigio-roccia);
    line-height: 1.6;
}

img {
    display: block;
    height: auto;
}

/* Link */
a {
    color: var(--verde-bosco);
    text-decoration: none;
    transition: 0.2s;
}

a:hover {
    color: var(--blu-ghiaccio);
}

/* Contenitori */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================================
   HEADER
   ========================================================= */
header {
    text-align: center;
    padding: 80px 20px 40px;
    background: linear-gradient(135deg, var(--verde-bosco), var(--blu-ghiaccio));
    color: white;
}

header h1 {
    margin: 0;
    font-size: 2.2rem;
}

/* =========================================================
   NAVBAR
   ========================================================= */
nav {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 20px 0;
}

nav a {
    background: var(--verde-bosco);
    color: white;
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 500;
    transition: 0.3s ease;
}

nav a:hover {
    background: var(--blu-ghiaccio);
    transform: translateY(-2px);
}

/* =========================================================
   HERO BANNER (Homepage)
   ========================================================= */
.hero {
    width: 100%;
    height: 320px;
    background: #2F5D50;
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    margin: 20px auto 40px auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    padding: 20px;
    box-shadow: var(--ombra-morbida);
}

.hero h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.hero a {
    margin-top: 15px;
    padding: 10px 20px;
    background: white;
    color: #2F5D50;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    transition: 0.2s;
}

.hero a:hover {
    background: #e8e8e8;
}

/* =========================================================
   MINIATURE WEBCAM (Homepage)
   ========================================================= */
.miniature-container {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin: 30px auto;
    flex-wrap: wrap;
}

.miniatura {
    width: 300px;
    max-width: 300px;
    flex: 0 0 300px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--ombra-morbida);
    transition: transform 0.2s;
}

.miniatura:hover {
    transform: scale(1.03);
}

.miniatura img {
    width: 100%;
    height: auto;
    display: block;
}

/* =========================================================
   CARD CHI SONO (Homepage)
   ========================================================= */
.card {
    max-width: 900px;
    margin: 40px auto;
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--ombra-morbida);
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.card-text {
    flex: 1 1 400px;
}

.card-radar {
    flex: 0 0 300px;
}

.card-radar img {
    width: 100%;
    border-radius: 10px;
    box-shadow: var(--ombra-morbida);
}

@media (max-width: 700px) {
    .card {
        flex-direction: column;
        align-items: center;
    }
}

/* =========================================================
   POPUP FULLSCREEN (Webcam page)
   ========================================================= */
.popup {
    display: none;
    position: fixed;
    z-index: 9999;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.85);
}

.popup-content {
    margin: auto;
    display: block;
    max-width: 95%;
    max-height: 90%;
    border-radius: var(--raggio);
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

/* =========================================================
   TABELLE METEO (Stazione Meteo)
   ========================================================= */
.table-wrapper {
    overflow-x: auto;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 1rem;
}

th, td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
    text-align: center;
}

th {
    background: var(--verde-bosco);
    color: white;
}

tr:hover {
    background: #F0F7F5;
}

/* Box errore */
#erroreMeteo {
    display: none;
    background: #D9534F;
    color: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: bold;
}

/* =========================================================
   GRAFICI (Stazione Meteo)
   ========================================================= */
canvas {
    margin-top: 40px;
    box-shadow: var(--ombra-morbida);
    border-radius: var(--raggio);
    background: white;
    padding: 10px;
}

/* =========================================================
   FOOTER
   ========================================================= */
footer {
    text-align: center;
    padding: 40px 0;
    color: var(--verde-bosco);
    font-size: 0.9rem;
    border-top: 1px solid var(--blu-ghiaccio);
}
