



/* =====================
   BASE
===================== */
body {
  margin: 0;
  font-family: 'Inter', Arial, sans-serif;
  background: #0a1621;
  color: white;
  width: 100%;
}

.page {
  max-width: 1400px;
  margin: auto;
  padding: 20px;
  padding-top: 80px;
}

/* 🌞 LIGHT MODE MODERNO */
body.light {
  background: #eef3f8;
  color: #1a2b3c;
}

/* NAVBAR */
body.light .meteo-menu {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  color: #1a2b3c;
}

/* LINK MENU */
body.light .menu-center a {
  color: #2c4a66;
}

body.light .menu-center a:hover {
  color: #000;
}

/* CARD GENERICHE */
body.light .card,
body.light .box,
body.light .chart,
body.light .gauge-card,
body.light .air-panel,
body.light .air-right {
  background: #ffffff;
  color: #1a2b3c;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

/* HEADER */
body.light .header {
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* HERO (meno scuro) */
body.light .hero-img {
  filter: brightness(0.85);
}

body.light .hero-title {
  text-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

/* BOX LIVE */
body.light .live-box {
  background: rgba(255,255,255,0.7);
  color: #1a2b3c;
  border: 1px solid rgba(0,0,0,0.08);
}

/* BOTTONI */
body.light .chart-menu button,
body.light .tab-btn {
  background: #e3edf7;
  color: #2c4a66;
  border: 1px solid rgba(0,0,0,0.05);
}

body.light .chart-menu button:hover,
body.light .tab-btn:hover {
  background: #d3e4f5;
}

body.light .chart-menu button.active,
body.light .tab-btn.active {
  background: #1e88e5;
  color: white;
  box-shadow: 0 0 10px rgba(30,136,229,0.4);
}

/* VALORI */
body.light .value {
  color: #0d47a1;
}

/* MIN/MAX */
body.light .minmax {
  color: #607d8b;
}

/* WIND ROSE */
body.light .windrose {
  background: radial-gradient(circle, #f0f6fb, #dce7f3);
  border: 3px solid #90caf9;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

body.light .dir {
  color: #1a2b3c;
}

/* FRECCIA VENTO */
body.light #windArrow {
  background: #e53935;
  box-shadow: 0 0 8px rgba(229,57,53,0.5);
}

/* FORECAST */
body.light .forecast-card {
  background: #ffffff;
  color: #1a2b3c;
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

body.light .forecast-day,
body.light .forecast-extra,
body.light .forecast-hour {
  color: #607d8b;
}

/* MAPPA CONTROLS */
body.light .map-controls button {
  background: #1e88e5;
}

body.light .map-controls button:hover {
  background: #1565c0;
}

/* FOOTER */
body.light .meteo-footer {
  background: rgba(255,255,255,0.85);
  color: #2c4a66;
  border-top: 1px solid rgba(0,0,0,0.8);
}
/* =====================
   HERO
===================== */
.hero, .hero_index {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: 20px;
}

.hero { height: 260px; }
.hero_index { height: 360px; }

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.9);
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  backdrop-filter: blur(-1px);
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
}

.hero-title {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: 4px;
  text-shadow: 0 0 10px rgba(0,0,0,0.6);
}

.hero-subtitle {
  font-size: 22px;
  opacity: 0.5;
  margin-top: 5px;
}


.hero-time {
  margin-top: 10px;
  font-size: 16px;
  color: #cfd8e3;
}

.hero-logo {
  height: 80px;
  animation: logoFloat 6s ease-in-out infinite;
}

@keyframes logoFloat {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
  100% { transform: translateY(0px); }
}

/* HERO METEO LIVE */
.hero-live {
  display: flex;
  gap: 20px;
  margin-top: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.live-box {
  background: rgba(255,255,255,0.08);
  padding: 10px 16px;
  border-radius: 20px;
  font-size: 16px;
  backdrop-filter: blur(6px);
}

/* =====================
   HEADER
===================== */
.header {
  text-align: center;
  font-size: 28px;
  padding: 20px;
  background: #08111a;
  border-radius: 10px;
  margin-bottom: 10px;
}

.timebox {
  display: grid;
  justify-content: center;
  gap: 10px;
  margin-top: 5px;
}

#time {
  font-size: 16px;
  color: #9fb4c7;
}

#stationStatus {
  text-align: center;
  font-size: 14px;
  opacity: 0.8;
}

/* =====================
   GRID DATI
===================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 20px;
  padding: 20px 0;
}

.card {
  background: linear-gradient(160deg, var(--bg-card), var(--bg-soft));
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.04);

  transition: transform 0.25s, box-shadow 0.25s;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.5);
}

.value {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -1px;
}

.minmax {
  font-size: 13px;
  color: var(--text-soft);
}

.label {
  font-size: 14px;
  color: var(--text-soft);
}

/* =====================
   CHART MENU
===================== */
.chart-menu {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.chart-menu button {
  border-radius: 20px;
  padding: 8px 16px;
  font-weight: 500;
}

.chart-menu button:hover {
  background: #1d364a;
}

.chart-menu button.active {
  background: var(--accent);
}

.chart-box {
    width: 100%;
    height: 300px; /* altezza grafico */
    position: relative;
}

#tempChart {
    width: 100% !important;
    height: 100% !important;
}ls 

/* =====================
   GAUGES
===================== */
.gauges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 30px;
}

canvas {
  max-width: 100%;
  /* Per Chart.js / Gauge.js: altezza consigliata in JS */
  height: auto;
}

/* =====================
   ROSA DEI VENTI
===================== */
.windrose-panel {
  width: 240px;
  text-align: center;
  margin: auto;
}

.windrose {
  border: 3px solid var(--accent);
  background: radial-gradient(circle, #102a3a, #08111a);
}

.dir {
  position: absolute;
  font-size: 16px;
  font-weight: bold;
  color: white;
}

.n { top: 8px; left: 50%; transform: translateX(-50%); }
.s { bottom: 8px; left: 50%; transform: translateX(-50%); }
.e { right: 8px; top: 50%; transform: translateY(-50%); }
.w { left: 8px; top: 50%; transform: translateY(-50%); }

.ne { top: 25px; right: 25px; }
.se { bottom: 25px; right: 25px; }
.sw { bottom: 25px; left: 25px; }
.nw { top: 25px; left: 25px; }

#windArrow {
  width: 8px;
  height: 100px;
  border-radius: 4px;
}
.center {
  position: absolute;
  width: 14px;
  height: 14px;
  background: white;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.windinfo {
  margin-top: 8px;
  font-size: 20px;
  font-weight: bold;
}

/* =====================
   PANNELLO PIOGGIA
===================== */
.rainpanel {
  text-align: center;
  font-size: 20px;
  padding: 20px;
}

/* =====================
   CHARTS
===================== */
.charts-grid {
  width: 100%;
  padding: 20px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.chart {
  background: #132433;
  padding: 10px;
  border-radius: 10px;
  width: 100%;
  height: 320px;
  box-shadow: 0 0 15px rgba(0,0,0,0.5);
}

.chart canvas {
  width: 100% !important;
  height: 100% !important;
}

/* TAB BUTTONS */
.chart-tabs, .tab-btn {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tab-btn {
  background: #132433;
  border: 1px solid rgba(255,255,255,0.08);
  color: #cfe8ff;
  padding: 10px 18px;
  border-radius: 30px;
  font-size: 14px;
  cursor: pointer;
  transition: 0.25s;
}

.tab-btn:hover { background: #1d364a; color: white; }
.tab-btn.active { background: #3ba4ff; color: white; box-shadow: 0 0 10px rgba(59,164,255,0.6); }

.project-text {
  font-size: 16px;
  line-height: 1.6;
  text-align: center;
  max-width: 900px;
  margin: auto;
}

/* =====================
   WEBCAM
===================== */
.webcam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px,1fr));
  gap: 15px;
}

.webcam {
  width: 100%;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.3s;
}

.webcam:hover { transform: scale(1.02); }

/* MODAL */
.cam-modal {
  display: none;
  position: fixed;
  top:0; left:0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.cam-modal img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
}

/* =====================
   PM / AIR QUALITY
===================== */
.gauges-air {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
  gap: 20px;
  margin-top: 30px;
}

.gauge-card, .air-right {
  background: #1e293b;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
}

.air-panel {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  background: #1e293b;
  padding: 20px;
  border-radius: 12px;
  margin-top: 30px;
}

.air-icon { font-size: 40px; margin-bottom: 5px; }
.aqi-value { font-size: 60px; font-weight: bold; }
.aqi-label { font-size: 18px; opacity: 0.8; }

.air-stats { display: grid; gap: 5px; font-size: 16px; }

/* =====================
   MENU METEO
===================== */
.meteo-menu {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  box-sizing: border-box; /* 👈 FIX */
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 30px;
  background: rgba(10,20,30,0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  z-index: 9999;
  color: white;
}

.menu-logo {
  height: 40px;
  width: auto;
  filter: drop-shadow(0 0 6px rgba(0,0,0,0.5));
}

.menu-center {
  display: flex;
  gap: 30px;
  flex: 1;                 /* 👈 occupa spazio centrale */
  justify-content: center;
}

.menu-center a {
  color: #e5f3ff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: 0.2s;
}

.menu-center a:hover { color: white; }

.menu-right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;          /* 👈 evita che sparisca */
}

.live-temp {
  font-size: 16px;
  font-weight: 600;
  background: rgba(255,255,255,0.1);
  padding: 6px 12px;
  border-radius: 20px;
}

.hamburger { display: none; font-size: 22px; cursor: pointer; }

@keyframes sunRotate { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* dropdown container */
.dropdown {
  position: relative;
}

/* menu nascosto */
.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: rgba(10,20,30,0.95);
  backdrop-filter: blur(10px);
  border-radius: 8px;
  padding: 10px 0;
  min-width: 180px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.3);
  z-index: 10000;
}

/* link dropdown */
.dropdown-content a {
  display: block;
  padding: 8px 15px;
  color: #e5f3ff;
  text-decoration: none;
  font-size: 14px;
}

.dropdown-content a:hover {
  background: rgba(255,255,255,0.1);
}

/* mostra al hover */
.dropdown:hover .dropdown-content {
  display: block;
}
/* =====================
   PREVISIONI
===================== */
.forecast-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 5px;
  scroll-behavior: smooth;
}

.forecast-grid1 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px,1fr));
  gap: 20px;
  margin-top: 20px;
}

.forecast-card {
  flex: 0 0 auto;
  min-width: 70px;
  background: linear-gradient(180deg, #1c1f26, #121417);
  border-radius: 14px;
  padding: 8px 5px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  transition: 0.25s;
}

.forecast-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.6);
}

.forecast-day { font-size: 18px; color: #aaa; margin-bottom: 10px; }
.forecast-extra { margin-top: 10px; font-size: 14px; color: #ccc; }
.forecast-hour { font-size: 12px; color: #aaa; margin-bottom: 4px; }
.forecast-icon { width: 32px; height: 32px; margin: 3px auto; display: block; }
.forecast-temp { font-size: 16px; font-weight: bold; }

/* Scrollbar Webkit */
.forecast-grid::-webkit-scrollbar { height: 6px; }
.forecast-grid::-webkit-scrollbar-thumb { background: #2b3f52; border-radius: 10px; }

/* =====================
   MAPPA
===================== */
#map {
  width: 100%;
  height: 700px;
  border-radius: 12px;
}

#map-container {
  width: 100%;
  height: 600px;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

#map-container.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  border-radius: 0;
}

#mapFrame {
  width: 100%;
  height: 100%;
  border: none;
}

.map-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  width: 100%;
}

.map-controls button {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: #1e88e5;
  color: white;
  cursor: pointer;
  font-size: 14px;
  transition: 0.2s;
}

.map-controls button:hover {
  background: #1565c0;
}

.map-container iframe {
  width: 100%;
  height: 800px;
  border: 0;
}

.section {
  margin-bottom: 40px;
}

.section h2 {
  margin-bottom: 10px;
  font-size: 20px;
  border-left: 4px solid #2196f3;
  padding-left: 10px;
}

.iframe-box {
  background: rgba(10,20,30,0.5);
  border-radius: 12px;
  overflow: hidden;
}

.iframe-box iframe {
  width: 100%;
  height: 600px;
  border: none;
}

#windArrow {
  transition: transform 0.8s ease;
}
/* =====================
   ALLERTA
===================== */

.alert {
  margin: 15px auto;
  padding: 14px 20px;
  border-radius: 12px;
  font-weight: 600;
  text-align: center;
  max-width: 900px;
  animation: fadeIn 0.4s ease;
}
.alert.verde {
  background: #43a047;
  color: white;
}
.alert.gialla {
  background: #ffd54f;
  color: #000;
}

.alert.arancione {
  background: #fb8c00;
  color: #fff;
}

.alert.rossa {
  background: #e53935;
  color: #fff;
  animation: pulse 1.5s infinite;
}

.hidden {
  display: none;
}

@keyframes fadeIn {
  from {opacity:0; transform: translateY(-10px);}
  to {opacity:1;}
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,0,0,0.5); }
  70% { box-shadow: 0 0 0 15px rgba(255,0,0,0); }
}
#alertMap {
  width: 100%;
  height: 500px;   /* 🔥 fondamentale */
  border-radius: 12px;
  margin-top: 15px;
}

/* popup */
.leaflet-popup-content{
  font-size:14px;
}
/* =====================
   FOOTER
===================== */

.meteo-footer {
  width: 100%;
  padding: 15px 20px;
  margin-top: 40px;
  background: rgba(10,20,30,0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255,255,255,0.1);
  color: #e5f3ff;
  text-align: center;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.footer-logo {
  height: 40px;
  width: auto;
}

/* =====================
   MOBILE
===================== */
@media(max-width: 768px){

  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: 34px;
  }

  .value {
    font-size: 32px;
  }

}


