/* ========== GLOBAL LAYOUT & BASE COLORS ========== */
:root { --app-dvh: 100svh; }

:root {
  /* Scala coerente con .wind-box.lvl-*  (teal/green → viola → magenta/rosso) */
  --wind-lvl-00:  #b2f5ea; /* 0–4   */
  --wind-lvl-04:  #96e6dc; /* 5–10  */
  --wind-lvl-11:  #78d7cd; /* 11–17 */
  --wind-lvl-18:  #5ac8b4; /* 18–24 */
  --wind-lvl-25:  #48bb96; /* 25–31 */
  --wind-lvl-32:  #38a169; /* 32–39  → inizio verde pieno */
  --wind-lvl-40:  #9e71ff; /* 40–46  → inizio viola */
  --wind-lvl-47:  #8c58ff; /* 47–53 */
  --wind-lvl-54:  #7846ff; /* 54–60 */
  --wind-lvl-61:  #693aff; /* 61–68 */
  --wind-lvl-68:  #5a32dc; /* 69–75 */
  --wind-lvl-76:  #aa32b4; /* 76–85 */
  --wind-lvl-86:  #c82d82; /* 86–96 */
  --wind-lvl-97:  #e61e5a; /* 97–103 */
  --wind-lvl-104: #f5193c; /* 104–129 */
  --wind-lvl-130: #ff1428; /* 130+  */

  /* Alias di compatibilità (se altrove usi ancora --wind-c1..5) */
  --wind-c1: var(--wind-lvl-11);  /* brezza */
  --wind-c2: var(--wind-lvl-25);  /* moderato */
  --wind-c3: var(--wind-lvl-32);  /* teso (verde pieno) */
  --wind-c4: var(--wind-lvl-54);  /* forte (viola) */
  --wind-c5: var(--wind-lvl-97);  /* molto forte (magenta/rosso) */

  /* APPLE WEATHER STYLE - Fase 1: Palette colori desaturati */
  /* Cieli sereni - Desaturati e naturali */
  --apple-sky-blue: #87ceeb;
  --apple-sky-light: #b0d4f1;
  --apple-sky-soft: #d5e9fb;

  /* Nuvoloso - Grigio soft */
  --apple-cloud-gray: #dfe6e9;
  --apple-cloud-light: #e8ebed;
  --apple-cloud-soft: #f1f2f5;

  /* Notte - Blu profondo */
  --apple-night-deep: #1a1a2e;
  --apple-night-blue: #16213e;
  --apple-night-soft: #0f3460;

  /* Sole - Giallo naturale */
  --apple-sun-yellow: #ffd93d;
  --apple-sun-light: #ffed4e;
  --apple-sun-soft: #fff3a0;

  /* Tramonto - Rosa pesca */
  --apple-sunset-pink: #ff9a9e;
  --apple-sunset-peach: #fad0c4;
  --apple-sunset-soft: #fbc2eb;

  /* Inverno - Blu ghiaccio */
  --apple-winter-blue: #a2d2ff;
  --apple-winter-light: #b8d4ff;
  --apple-winter-soft: #cfe2ff;

  /* Estate - Blu cristallino */
  --apple-summer-blue: #5dade2;
  --apple-summer-light: #85c1e9;
  --apple-summer-soft: #aed6f1;

  /* Effetti glass (Fase 2) */
  --apple-glass-bg: var(--white-08);
  --apple-glass-border: rgba(255, 255, 255, 0.12);
  --apple-glass-hover: rgba(255, 255, 255, 0.12);

  /* ===== COLORI BASE CON OPACITÀ ===== */
  /* Bianco con opacità */
  --white-100: #fff;
  --white-95: rgba(255, 255, 255, 0.95);
  --white-85: rgba(255, 255, 255, 0.85);
  --white-75: rgba(255, 255, 255, 0.75);
  --white-70: rgba(255, 255, 255, 0.70);
  --white-65: rgba(255, 255, 255, 0.65);
  --white-50: rgba(255, 255, 255, 0.50);
  --white-30: rgba(255, 255, 255, 0.30);
  --white-20: rgba(255, 255, 255, 0.20);
  --white-15: rgba(255, 255, 255, 0.15);
  --white-10: rgba(255, 255, 255, 0.10);
  --white-08: rgba(255, 255, 255, 0.08);
  --white-05: rgba(255, 255, 255, 0.05);

  /* Nero con opacità */
  --black-90: rgba(0, 0, 0, 0.90);
  --black-20: rgba(0, 0, 0, 0.20);
  --black-15: rgba(0, 0, 0, 0.15);
  --black-10: rgba(0, 0, 0, 0.10);
  --black-05: rgba(0, 0, 0, 0.05);

  /* ===== COLORI SEMANTICI ===== */
  --color-success: #10b981;
  --color-success-dark: #059669;
  --color-warning: #f59e0b;
  --color-warning-dark: #d97706;
  --color-danger: #ef4444;
  --color-danger-dark: #dc2626;
  --color-info: #3b82f6;
  --color-info-dark: #2563eb;
  --color-muted: #6b7280;
  --color-muted-light: #9ca3af;

  /* ===== BREAKPOINTS (documentazione - usare valori in @media) ===== */
  /* Mobile small:  360px  - iPhone SE, piccoli Android */
  /* Mobile:        375px  - iPhone standard */
  /* Mobile large:  430px  - iPhone Pro Max */
  /* Tablet:        768px  - iPad portrait */
  /* Desktop:      1024px  - iPad landscape, laptop */
  /* Desktop lg:   1280px  - Desktop standard */
  /* Desktop xl:   1536px  - Desktop large */

  /* APPLE WEATHER STYLE - Fase 3: Animazioni e transizioni */
  /* Timing functions Apple - Curva di Bezier naturale e fluida */
  --apple-easing: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --apple-easing-in: cubic-bezier(0.42, 0, 1, 1);
  --apple-easing-out: cubic-bezier(0, 0, 0.58, 1);
  --apple-easing-in-out: cubic-bezier(0.42, 0, 0.58, 1);

  /* Durate transizioni Apple */
  --apple-duration-fast: 150ms;
  --apple-duration-normal: 300ms;
  --apple-duration-slow: 500ms;
  --apple-duration-slower: 800ms;
}

/* ========== APPLE TRANSITIONS - Fase 3 ========== */

/* Classi di transizione Apple-style */
.apple-transition {
  transition: all var(--apple-duration-normal) var(--apple-easing);
}

.apple-transition-fast {
  transition: all var(--apple-duration-fast) var(--apple-easing);
}

.apple-transition-slow {
  transition: all var(--apple-duration-slow) var(--apple-easing);
}

.apple-transition-slower {
  transition: all var(--apple-duration-slower) var(--apple-easing);
}

/* Transizioni specifiche per proprietà */
.apple-transition-transform {
  transition: transform var(--apple-duration-normal) var(--apple-easing);
}

.apple-transition-opacity {
  transition: opacity var(--apple-duration-normal) var(--apple-easing);
}

.apple-transition-background {
  transition: background var(--apple-duration-normal) var(--apple-easing);
}

/* Staggering animations - Delay sequenziali per effetti cascade */
.apple-stagger-1 {
  animation-delay: 0.1s;
  transition-delay: 0.1s;
}

.apple-stagger-2 {
  animation-delay: 0.2s;
  transition-delay: 0.2s;
}

.apple-stagger-3 {
  animation-delay: 0.3s;
  transition-delay: 0.3s;
}

.apple-stagger-4 {
  animation-delay: 0.4s;
  transition-delay: 0.4s;
}

.apple-stagger-5 {
  animation-delay: 0.5s;
  transition-delay: 0.5s;
}

/* ========== APPLE ANIMATIONS - Fase 3 ========== */

/* Fade in Apple-style - Fade + subtle slide up */
@keyframes appleFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.apple-fade-in {
  animation: appleFadeIn var(--apple-duration-normal) var(--apple-easing);
}

.apple-fade-in-fast {
  animation: appleFadeIn var(--apple-duration-fast) var(--apple-easing);
}

.apple-fade-in-slow {
  animation: appleFadeIn var(--apple-duration-slow) var(--apple-easing);
}

/* Fade out Apple-style */
@keyframes appleFadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

.apple-fade-out {
  animation: appleFadeOut var(--apple-duration-normal) var(--apple-easing);
}

/* Scale in Apple-style - Subtle zoom in */
@keyframes appleScaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.apple-scale-in {
  animation: appleScaleIn var(--apple-duration-normal) var(--apple-easing);
}

/* Slide in from sides */
@keyframes appleSlideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes appleSlideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.apple-slide-in-left {
  animation: appleSlideInLeft var(--apple-duration-normal) var(--apple-easing);
}

.apple-slide-in-right {
  animation: appleSlideInRight var(--apple-duration-normal) var(--apple-easing);
}

/* Weather background gradient transition */
.weather-background {
  transition: background var(--apple-duration-slower) var(--apple-easing);
  position: relative;
}

/* ========== APPLE DAWN/DUSK OVERLAYS - Universal System ========== */
/* Sistema overlay universale per alba/tramonto che si applica a qualsiasi condizione meteo */
/* Usa mix-blend-mode per integrazione naturale con gradiente sottostante */

.weather-time-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--apple-duration-slower) var(--apple-easing);
  /* Sopra gradient + depth + clouds, sotto canvas (particelle) */
  z-index: 6;
}

.weather-time-overlay.active {
  opacity: 1;
}

/* Dawn Overlay (Alba) - Rosa pesca caldo, arancio soft */
.weather-time-overlay.dawn {
  background: linear-gradient(
    180deg,
    rgba(255, 190, 155, 0.24) 0%,      /* Albicocca soft */
    rgba(255, 178, 150, 0.20) 28%,     /* Rosa pesca tenue */
    rgba(255, 170, 145, 0.16) 52%,     /* Calore basso, meno saturo */
    rgba(250, 208, 196, 0.13) 78%,     /* Rosa pesca chiaro */
    rgba(235, 215, 245, 0.07) 100%     /* Lavanda molto soft */
  );
  mix-blend-mode: soft-light;
}

/* Dawn Overlay - Variante estiva (più calda) */
.weather-time-overlay.dawn.summer {
  background: linear-gradient(
    180deg,
    rgba(255, 205, 175, 0.28) 0%,
    rgba(255, 190, 165, 0.23) 32%,
    rgba(255, 180, 155, 0.18) 62%,
    rgba(250, 214, 206, 0.13) 86%,
    rgba(238, 220, 246, 0.06) 100%
  );
}

/* Dawn Overlay - Variante invernale (più fredda, meno satura) */
.weather-time-overlay.dawn.winter {
  background: linear-gradient(
    180deg,
    rgba(235, 185, 175, 0.20) 0%,
    rgba(228, 176, 170, 0.17) 32%,
    rgba(222, 168, 164, 0.14) 62%,
    rgba(225, 196, 192, 0.11) 86%,
    rgba(220, 210, 220, 0.06) 100%
  );
}

/* Dusk Overlay (Tramonto) - Rosa/viola drammatico, arancio intenso */
.weather-time-overlay.dusk {
  background: linear-gradient(
    180deg,
    rgba(255, 170, 165, 0.24) 0%,      /* Rosa corallo soft */
    rgba(250, 212, 200, 0.20) 22%,     /* Pesca tenue */
    rgba(244, 206, 232, 0.17) 44%,     /* Lavanda rosata */
    rgba(170, 160, 206, 0.14) 66%,     /* Viola desaturato */
    rgba(150, 140, 190, 0.10) 84%,     /* Viola profondo soft */
    rgba(132, 122, 176, 0.07) 100%     /* Viola scuro, quasi impercettibile */
  );
  mix-blend-mode: soft-light;
}

/* Dusk Overlay - Variante estiva (più vibrante) */
.weather-time-overlay.dusk.summer {
  background: linear-gradient(
    180deg,
    rgba(255, 176, 170, 0.28) 0%,
    rgba(250, 214, 206, 0.23) 26%,
    rgba(244, 206, 232, 0.20) 46%,
    rgba(170, 160, 206, 0.15) 68%,
    rgba(150, 140, 190, 0.11) 86%,
    rgba(122, 112, 170, 0.07) 100%
  );
}

/* Dusk Overlay - Variante invernale (più tenue) */
.weather-time-overlay.dusk.winter {
  background: linear-gradient(
    180deg,
    rgba(232, 168, 165, 0.21) 0%,
    rgba(235, 206, 200, 0.18) 26%,
    rgba(232, 198, 224, 0.15) 46%,
    rgba(170, 166, 202, 0.12) 68%,
    rgba(160, 154, 192, 0.09) 86%,
    rgba(148, 142, 178, 0.05) 100%
  );
}

/* Overlay per condizioni meteo intense (temporale, pioggia forte) */
/* Usa overlay mode per maggiore drammaticità */
.weather-time-overlay.intense {
  mix-blend-mode: overlay;
  opacity: 0.7;
}

/* Overlay per condizioni meteo soft (nebbia, nuvoloso) */
/* Usa screen mode per effetto più tenue */
.weather-time-overlay.soft {
  /* Su nuvoloso/pioggia lo screen tende a "sparire": soft-light è più naturale e visibile */
  mix-blend-mode: soft-light;
  opacity: 0.55;
}

/* Accessibility: Rispetta preferenze utente per reduced motion */
@media (prefers-reduced-motion: reduce) {
  .apple-transition,
  .apple-transition-fast,
  .apple-transition-slow,
  .apple-transition-slower,
  .apple-transition-transform,
  .apple-transition-opacity,
  .apple-transition-background,
  .apple-fade-in,
  .apple-fade-in-fast,
  .apple-fade-in-slow,
  .apple-fade-out,
  .apple-scale-in,
  .apple-slide-in-left,
  .apple-slide-in-right,
  .weather-background,
  .weather-time-overlay,
  .widget {
    animation: none !important;
    transition: none !important;
    animation-delay: 0s !important;
    transition-delay: 0s !important;
  }
}

html {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overscroll-behavior-y: none;
  /* Disable text selection to prevent accidental selection during touch gestures */
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-touch-callout: none; /* Disable iOS callout menu on long-press */
 }

*,
*::before,
*::after {
  box-sizing: inherit;
}

body > main {
  min-height: var(--app-dvh, 100dvh);
}

/* ========== MAIN CONTENT - View Transition Animations ========== */
#main-content {
  opacity: 1;
  overflow-x: hidden;
  /* Transition will be set dynamically by JS during view changes */
}

/* Support for prefers-reduced-motion (accessibility) */
@media (prefers-reduced-motion: reduce) {
  #main-content {
    opacity: 1 !important;
    transition: none !important;
  }
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
   Roboto, Helvetica, Arial, sans-serif;
  font-size: 12px;
  color: #fff;
  min-height: 100vh;
  background-color: #1b425c;
  overflow-anchor: none;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  scrollbar-width: none;      /* Firefox - hide scrollbar */
  -ms-overflow-style: none;   /* IE/Edge - hide scrollbar */
}

/* Chrome, Safari, Edge - hide scrollbar */
body::-webkit-scrollbar {
  display: none;
}

/* FIX TASK NT-20: Variabili globali per le safe areas (iOS notch/dynamic island) */
:root {
  /* Safe area insets - iOS notch, dynamic island, home indicator */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);

  /* Padding effettivo che vogliamo garantire (minimo 5px anche senza safe-area) */
  --ui-bottom-pad: max(5px, var(--safe-bottom));
  --ui-top-pad: max(0px, var(--safe-top));

  /* Padding laterale per landscape mode con notch laterale */
  --ui-left-pad: max(0px, var(--safe-left));
  --ui-right-pad: max(0px, var(--safe-right));
}

/* ================= LOW POWER OVERRIDES ================= */
:root {
  --ui-blur: 5px; /* default */
}

/* FIX TASK NT-34: Box-Shadow CSS Custom Properties for Consolidation */
:root {
  /* Common shadow patterns (reduces CSS by ~2-3KB) */
  --shadow-none: none;
  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.12);
  --shadow-sm: 0 2px 4px var(--black-20);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 3px 8px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 2px 8px var(--black-10);
  --shadow-elevated: 0 6px 18px rgba(16, 28, 48, 0.12);
  --shadow-popup: 0 4px 12px var(--black-15);
  --shadow-inset: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.offcanvas:not(.show),
.search-panel:not(.show) {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

html[data-power="low"] {
  --ui-blur: 0px;
  --card-blur: 0px;
}

/* Battery saver / low-power class fallback */
body.battery-saver {
  --ui-blur: 2px;
  --card-blur: 2px;
}

/* Reindirizza i componenti che usano blur al token */
.search-panel,
.navbar-blur,
.offcanvas,
.widget,
.topbar,
.glass,
.backdrop-blur,
.navbar-bottom-nav {
  -webkit-backdrop-filter: blur(var(--ui-blur)) !important;
  backdrop-filter: blur(var(--ui-blur)) !important;
}

/* Riduci motion quando richiesto dal sistema o in low-power */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* Riduci blur in reduced-motion (evita costo backdrop-filter) */
@media (prefers-reduced-motion: reduce) {
  :root { --ui-blur: 0px; }
}
html[data-power="low"] *,
body.battery-saver * {
  animation: none !important;
  transition: none !important;
}

/* Low-power: riduci ombre/filtri superflui */
html[data-power="low"] .widget {
  box-shadow: var(--shadow-none) !important;
}
html[data-power="low"] .weather-svg-icon,
html[data-power="low"] .widget .weather-svg-icon,
html[data-power="low"] .widget-weather-icon-small {
  filter: none !important;
}

/* Debug: forza no-blur quando attivo il toggle dal pannello */
body.debug-no-blur {
  --ui-blur: 0px !important;
  --card-blur: 0px !important;
}




#meteocast-loader {
  position: fixed;
  z-index: 2000;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--white-65);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.loader-spinner {
  width: 54px;
  height: 54px;
  border: 7px solid #2196f3;
  border-top-color: #1976d2;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  /* box-shadow: 0 0 10px #1976d2; */
  box-shadow: none;
  border-width:6px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========== WEATHER BACKGROUND ========== */
.bg-paused .weather-overlay { animation-play-state: paused !important; }

html[data-power="low"] .weather-overlay,
@media (prefers-reduced-motion: reduce) {
  .weather-overlay {
    animation: none !important;
    opacity: 0.45; /* leggera riduzione per coerenza visiva */
  }
}

.weather-background {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  isolation: isolate;
  background: #0c2a41;
  contain: size layout style;
}

.weather-background::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5; /* sopra clouds/overlay, sotto canvas */
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, var(--meteo-contrast-top, 0)) 0%,
    rgba(0, 0, 0, var(--meteo-contrast-mid, 0)) 42%,
    rgba(0, 0, 0, 0) 100%
  );
  transition: background 1.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.weather-gradient {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: var(--meteo-gradient, linear-gradient(180deg, #1565C0 0%, #0D47A1 45%, #0A3A7C 100%));
  /*animation: skyBreath 19s ease-in-out infinite;*/
  transition: background 1.3s cubic-bezier(0.4, 0, 0.2, 1), opacity .6s ease;
  pointer-events: none;
  /* Evita filter fullscreen di default (costoso su GPU): il look è gestito dal motore gradienti */
  filter: none;
  contain: paint;
}

/* FIX: Hide gradient until weather data is loaded to prevent flash of default blue gradient */
.weather-gradient.loading {
  opacity: 0;
}

.weather-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 7;  /* Sopra time-overlay e clouds */
  display: block;
  pointer-events: none;
  contain: paint;
}

.weather-depth {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
  background: var(--meteo-overlay, none);
  mix-blend-mode: normal;
  opacity: 1;
  transition: opacity 0.8s ease, background 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, background;
  backface-visibility: hidden;
  contain: strict;
}

.weather-overlay {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0.6;
  contain: paint;
}

.weather-overlay.night {
  opacity: 0.3;
}

/* ========== CLOUDS PARALLAX (multi-layer) ========== */
/* Attivato solo quando BackgroundManager applica più immagini cloud */
.weather-overlay.clouds-anim {
  animation: clouds-drift var(--cloud-drift-duration, 30s) ease-in-out infinite alternate;
}

@keyframes clouds-drift {
  from { background-position: var(--cloud-pos-start); }
  to { background-position: var(--cloud-pos-end); }
}

/* Disabilita drift clouds quando low-power / reduced-motion */
html[data-power="low"] .weather-overlay.clouds-anim {
  animation: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .weather-overlay.clouds-anim {
    animation: none !important;
  }
}

/* GPU optimization: applica compositing solo quando serve (animazioni attive) */
.weather-background.is-animating .weather-gradient,
.weather-background.is-animating .weather-canvas,
.weather-background.is-animating .weather-depth,
.weather-background.is-animating .weather-overlay {
  will-change: opacity, transform;
  backface-visibility: hidden;
  transform: translateZ(0);
}
.weather-background:not(.is-animating) .weather-gradient,
.weather-background:not(.is-animating) .weather-canvas,
.weather-background:not(.is-animating) .weather-depth,
.weather-background:not(.is-animating) .weather-overlay {
  will-change: auto;
  transform: none;
}

/* Content sopra weather-bg */
body > .container-custom,
body > .container-fluid,
body > main,
body > section,
body > .navbar,
body > header {
  position: relative;
  z-index: 20;
}

/* Gradienti meteo gestiti via custom property (Task NT-4). */

/* ======= REMOVED: Legacy .weather-overlay.meteo-XX classes (~530 lines) =======
 * These classes were part of the old gradient system and are never applied by the
 * parametric gradient system. All background styles are now applied inline via
 * JavaScript in weather-background.js _applyCloudImages() method.
 * Removed: meteo-1, 2, 3, 45, 48, 51, 53, 55, 61, 63, 65, 66, 67, 71, 73, 75,
 *          77, 80, 81, 82, 85, 86, 95, 96, 99 and all related @keyframes animations
 */

/* ======= TRAMONTO (Sunset) - Overlay tonale universale ======= */
/* Tramonto applica un overlay delicato ispirato ad Apple Weather */
/* Palette: arancio/pesca desaturato con opacità ridotta per leggibilità */

.weather-gradient.sunset::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse at 15% 15%,
    rgba(255, 150, 80, 0.22) 0%,
    rgba(255, 170, 120, 0.18) 25%,
    rgba(255, 190, 150, 0.14) 50%,
    rgba(255, 210, 180, 0.08) 70%,
    transparent 100%
  );
  z-index: 2;
  mix-blend-mode: soft-light;
}

/* ======= ALBA (Sunrise) - Overlay tonale universale ======= */
/* Alba applica un overlay rosa/lavanda delicato ispirato ad Apple Weather */
/* Palette: rosa pastello, pesca tenue e lavanda con opacità ridotta */

.weather-gradient.sunrise::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse at 85% 12%,
    rgba(255, 200, 190, 0.20) 0%,
    rgba(250, 210, 200, 0.16) 25%,
    rgba(240, 200, 220, 0.12) 50%,
    rgba(220, 180, 230, 0.08) 70%,
    transparent 100%
  );
  z-index: 2;
  mix-blend-mode: soft-light;
}

/* ========== MAIN VIEW ========== */
.container-custom {
  padding: 0 10px;
  max-width: 980px;
  margin: auto;
  position: relative;
  z-index: 10;
  padding-bottom: calc(60px + var(--safe-bottom)); /* 70 = approx altezza navbar */
}

body.view-stazioni #weatherBg,
body.view-stazioni #weatherOverlay,
body.view-stazioni .location-bar {
  display: none !important;
}

body.view-stazioni .container-custom {
  padding: 0;
}

/* Vars di default (verranno sovrascritte via JS) */
#stazioni-map {
  --top: 0px; /* altezza location-bar */
  --bottom: var(--nav-h, 0px); /* altezza navbar */
  --app-dvh: 100dvh; /* fallback moderno */
}

/* FIX TASK NT-20: Map container con safe-area completo (verticale + laterale) */
#stazioni-map .leaflet-map-widget,
#map-container {
  /* Safe-area verticale: top + bottom */
  block-size: calc(
    var(--app-dvh, 100dvh) - var(--top) - var(--bottom) - var(--safe-top) - var(--safe-bottom)
  );
  min-block-size: 320px; /* sicurezza su schermi piccolissimi */
  /* Safe-area laterale per landscape mode */
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

/* Previeni FOUC durante inizializzazione mappa */
/* TEMPORANEAMENTE DISABILITATO - DEBUG MAPPA INVISIBILE */
/* #stazioni-map {
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
}

#stazioni-map.map-ready {
  opacity: 1;
} */

/* Nascondi layer control durante init per evitare flash */
#stazioni-map:not(.map-ready) .leaflet-control-layers {
  opacity: 0 !important;
  pointer-events: none;
}

/* Nascondi layer control quando c'è il loader mappa locale */
/* #stazioni-map.map-busy .leaflet-control-layers {
  opacity: 0 !important;
  pointer-events: none !important;
} */

/* Nascondi sempre il control layers quando loader globale è attivo */
.app-busy #stazioni-map .leaflet-control-layers {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* FIX TASK NT-20: Body padding per navbar fixed-bottom con safe-area */
body {
  /* Usa variabile CSS per consistenza (già include fallback in :root) */
  padding-bottom: var(--safe-bottom);
  /* Padding laterale per landscape mode (notch laterale su iPhone) */
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

/* ========== LOCATION BAR ========== */
/* FIX TASK NT-20: Location bar con safe-area completo (top + laterale) */
.location-bar {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  color: rgb(255 255 255 / 100%);
  padding-bottom: 20px;
  /* Safe-area: minimo 12px o safe-top se maggiore */
  padding-top: max(12px, var(--safe-top)) !important;
  /* Safe-area laterale per landscape mode */
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
  gap: 10px;
}

/* In PWA (standalone) usa solo la safe-area reale senza minimo */
@media (display-mode: standalone) {
  .location-bar {
    padding-top: var(--ui-top-pad) !important;
  }
}

.location-bar .loc-labels {
  text-align: right;
  line-height: 125%;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  max-width: 230px;
}

.location-bar .loc-labels .loc-name-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: 100%;
  gap: 2px;
}

.location-bar .loc-labels .loc-name {
  font-size: 11px;
  display: inline-flex;
  align-items: baseline;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
}

.location-bar .loc-labels .loc-name::before {
  content: attr(data-location);
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
  margin-right: 5px;
}

.location-bar .loc-labels .loc-elev {
  color: rgb(255 255 255 / 75%);
  font-size: 11px;
  flex-shrink: 0;
  white-space: nowrap;
}

.location-bar .loc-labels .loc-update-time {
  color: rgb(255 255 255 / 75%);
  font-size: 10px;
  display: block;
}

.location-bar .loc-labels .update-time {
  font-size: 10px;
}

.location-bar .loc-labels .update-time.ok {
  /* color: #198754; /* verde bootstrap */ */
}
.location-bar .loc-labels .update-time.offline {
  color: rgb(144 0 14 / 39%); /* rosso */
}
.location-bar .loc-labels .update-time.stale {
  color: #ffe598; /* giallo */
}

.location-bar .loc-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 5px;
}

.location-bar .loc-actions a,
.location-bar .loc-actions button {
  color: rgb(255 255 255 / 85%);
  text-decoration: none;
  padding: 7px;
  border-radius: 5px;
  background-color: rgb(255 255 255 / 15%);
  line-height: 100%;
  font-size: 13px;
  flex-shrink: 0;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.location-bar .loc-actions a:hover,
.location-bar .loc-actions button:hover {
  background-color: rgb(255 255 255 / 30%);
}

/* Ottimizzazioni per schermi molto piccoli (iPhone 5/SE) */
@media (max-width: 360px) {
  .location-bar {
    gap: 8px;
  }

  .location-bar .loc-labels .loc-name {
    font-size: 10px;
  }

  .location-bar .loc-labels .update-time,
  .location-bar .loc-labels .loc-update-time {
    font-size: 9px;
  }

  .location-bar .loc-actions a,
  .location-bar .loc-actions button {
    padding: 6px;
    font-size: 12px;
  }
}

/* FIX TASK NT-20: Search panel offcanvas con safe-area completo */
.search-panel {
  height: calc(100dvh - var(--safe-top)) !important;
  padding-top: calc(35px + var(--safe-top)) !important;
  /* Safe-area laterale per landscape mode */
  padding-left: max(10px, var(--safe-left)) !important;
  padding-right: max(10px, var(--safe-right)) !important;
  background-color: rgb(117 126 140 / 41%);
  backdrop-filter: blur(8px);
  color: #fff;
}

.search-panel,
.search-panel .offcanvas-header,
.search-panel .offcanvas-body {
  padding: 0 10px;
}

.search-panel .offcanvas-header {
  margin-bottom: 15px;
  justify-content: space-between;
}

.search-panel .offcanvas-header h5 {
}

.search-panel .offcanvas-header .btn {
  color: #fff;
  padding: 0;
}

.search-panel .offcanvas-body .form-control {
  border-radius: 5px;
}

.search-panel .offcanvas-body .list-group {
  border-radius: 5px;
}

.search-panel .offcanvas-body .list-group .list-group-item {
  background-color: rgb(255 255 255 / 10%);
  border: none;
  color: #fff;
  font-size: 12px;
  border-bottom: 1px solid rgb(255 255 255 / 10%);
}

.search-panel .offcanvas-body .list-group .list-group-item .text-muted {
  color: rgb(255 255 255 / 35%) !important;
}

/* Search Panel - Favorites Section */
#loc-favorites-section h6 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.search-panel .list-group-item .favorite-star {
  transition: all 0.2s ease;
  opacity: 0.7;
}

.search-panel .list-group-item:hover .favorite-star {
  opacity: 1;
  transform: scale(1.1);
}

.search-panel .list-group-item .favorite-remove {
  opacity: 0;
  transition: opacity 0.2s ease;
  padding: 0.25rem 0.5rem;
}

.search-panel .list-group-item:hover .favorite-remove {
  opacity: 1;
}

.search-panel .list-group-item .favorite-remove:hover {
  background-color: rgba(220, 53, 69, 0.1);
}

/* Favorite star animation */
.favorite-star.bi-star-fill {
  animation: starPop 0.3s ease;
}

@keyframes starPop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1);
  }
}

/* ========== APP MENU PANEL ========== */
.app-menu-panel {
  width: min(320px, 85vw) !important;
  height: 100dvh !important;
  background-color: rgb(117 126 140 / 41%);
  backdrop-filter: blur(8px);
  color: #fff;
}

.app-menu-panel .offcanvas-header,
.app-menu-panel .offcanvas-body {
  padding: 20px;
}

.app-menu-panel .offcanvas-header {
  border-bottom: 1px solid rgb(255 255 255 / 10%);
}

.app-menu-panel .offcanvas-header h5 {
  font-size: 1.25rem;
  font-weight: 600;
}

.app-menu-panel .offcanvas-header .btn {
  color: #fff;
  padding: 0;
}

.app-menu-panel .offcanvas-body {
  display: flex;
  flex-direction: column;
}

.app-menu-panel .list-group {
  border-radius: 8px;
  overflow: hidden;
}

.app-menu-panel .list-group-item {
  background-color: rgb(255 255 255 / 10%);
  border: none;
  border-bottom: 1px solid rgb(255 255 255 / 5%);
  padding: 0;
  transition: background-color 0.2s ease;
}

.app-menu-panel .list-group-item:last-child {
  border-bottom: none;
}

.app-menu-panel .list-group-item:hover {
  background-color: rgb(255 255 255 / 15%);
}

.app-menu-panel .menu-link {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s ease;
}

.app-menu-panel .menu-link i {
  font-size: 18px;
  color: rgb(255 255 255 / 75%);
  transition: color 0.2s ease;
}

.app-menu-panel .list-group-item:hover .menu-link i {
  color: #fff;
}

.app-menu-panel .app-info {
  margin-top: auto;
  color: rgb(255 255 255 / 50%);
  border-color: rgb(255 255 255 / 10%) !important;
}

.app-menu-panel .app-info p {
  line-height: 1.5;
}

/* ========== INFO PAGES (GUIDA, PRIVACY, ETC.) ========== */
.info-page {
  padding: 20px 16px 40px;
  max-width: 800px;
  margin: 0 auto;
  color: #fff;
}

.info-header {
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgb(255 255 255 / 15%);
}

.info-header h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
}

.info-header h1 i {
  font-size: 1.1rem;
  opacity: 0.9;
}

.info-header .lead {
  font-size: 0.875rem;
  opacity: 0.75;
  margin-bottom: 5px;
}

.info-content {
  line-height: 1.6;
}

.info-section {
  margin-bottom: 25px;
}

.info-section h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 10px;
  margin-top: 15px;
  color: rgb(255 255 255 / 95%);
}

.info-section h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  margin-top: 12px;
  color: rgb(255 255 255 / 90%);
}

.info-section p {
  margin-bottom: 10px;
  color: rgb(255 255 255 / 85%);
  font-size: 0.875rem;
}

.info-section ul,
.info-section ol {
  margin-bottom: 12px;
  padding-left: 22px;
}

.info-section li {
  margin-bottom: 6px;
  color: rgb(255 255 255 / 85%);
  font-size: 0.85rem;
}

.info-section li strong {
  color: rgb(255 255 255 / 95%);
}

.info-section a {
  color: #90caf9;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.info-section a:hover {
  color: #bbdefb;
}

.info-section .text-muted {
  color: rgb(255 255 255 / 70%) !important;
  font-size: 0.8rem;
}

.info-section .small {
  font-size: 0.8rem;
}

.info-section .alert {
  background-color: rgb(255 193 7 / 20%);
  border: 1px solid rgb(255 193 7 / 30%);
  border-radius: 6px;
  padding: 10px 12px;
  color: #fff;
  font-size: 0.85rem;
}

.info-section .badge {
  font-size: 0.7rem;
  padding: 3px 8px;
  font-weight: 500;
}

.info-section .table {
  color: #fff;
  font-size: 0.85rem;
  margin-top: 12px;
  background-color: rgb(0 0 0 / 20%) !important;
  border-color: rgb(255 255 255 / 15%) !important;
}

.info-section .table th {
  background-color: rgb(255 255 255 / 15%) !important;
  border-color: rgb(255 255 255 / 20%) !important;
  padding: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  color: #fff !important;
}

.info-section .table td {
  border-color: rgb(255 255 255 / 15%) !important;
  padding: 8px;
  color: rgb(255 255 255 / 90%) !important;
  font-size: 0.8rem;
  background-color: transparent !important;
}

.info-section .credit-item {
  padding-left: 12px;
  border-left: 2px solid rgb(255 255 255 / 20%);
}

.info-section .credit-item h3 {
  font-size: 0.9rem;
  margin-bottom: 5px;
}

.info-section .border-top {
  border-top: 1px solid rgb(255 255 255 / 15%) !important;
  margin-top: 30px;
  padding-top: 20px;
}

.info-section .text-center {
  text-align: center;
}

/* Info Pages - Responsive */
@media (max-width: 768px) {
  .info-page {
    padding: 15px 12px 30px;
  }

  .info-header h1 {
    font-size: 1.15rem;
  }

  .info-section h2 {
    font-size: 0.95rem;
  }

  .info-section h3 {
    font-size: 0.875rem;
  }

  .info-section p,
  .info-section li {
    font-size: 0.825rem;
  }
}

/* ========== GENERIC ICONS & UTILS ========== */
.weather-svg-icon {
  width: 48px;
  height: 48px;
  display: block;
}

/* ========== TOOLTIPS ========== */
.tooltip-inner {
  text-align: left;
  line-height: 130%;
  font-size: 12px;
}
.tooltip-inner .tooltip-block {
  margin-bottom: 5px;
}
[data-bs-toggle="tooltip"] {
  cursor: pointer;
  touch-action: manipulation;
  display: block;
}

/* ========== WIDGET CONTAINER BASE ========== */
.widget {
  background-color: rgb(44 60 83 / 22%);
  border: 1px solid rgb(187 187 187 / 7%);
  border-radius: 10px;
  padding: 12px;
  color: #ffffff;
  margin-bottom: 15px;
  overflow: hidden;
  width: 100%;
  transition: transform var(--apple-duration-fast) var(--apple-easing),
              box-shadow var(--apple-duration-fast) var(--apple-easing),
              opacity var(--apple-duration-normal) var(--apple-easing);
}

.widget .widget-header .weather-svg-icon,
.widget.widget-riga .weather-svg-icon {
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 1px 2px var(--black-20));
}

.widget .widget-header,
.widget .widget-footer .data-row,
.widget .widget-cont {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.widget .widget-header {
  margin-bottom: 10px;
  color: #ffffff;
}

.widget .widget-header .widget-action {
  font-size: 11px;
  vertical-align: middle;
  opacity: 0.7;
  display: block;
  padding-left: 10px;
  color: rgb(255 255 255 / 80%);
}

.widget.widget-riga .widget-header {
  margin-bottom: 0;
}

.widget.widget-riga .widget-header .wi {
  line-height: 145%;
}

.widget .widget-header .widget-title,
.widget .btn-accordion .widget-cont .widget-title {
  letter-spacing: 0.03em;
  font-size: 10px;
  text-transform: uppercase;
  text-align: left;
  font-weight: normal;
}

.widget .widget-header .widget-title strong {
  color: #fff;
}

.widget .widget-footer {
  border-top: 1px solid var(--white-15);
  padding-top: 5px;
  margin-top: 10px;
}

.widget .widget-footer .data-row {
  margin-top: 8px;
  color: rgb(255 255 255 / 75%);
  font-size: 11px;
  flex-wrap: nowrap;
  gap: 8px;
}

.widget .widget-footer .data-row.fishing-period-row {
  margin-top: 15px;
}

.widget .widget-footer .data-row .widget-value {
  color: #ffffff;
  text-align: right;
}

/* Gruppo icone allineate a destra nei periodi pesca */
.widget-icons-group {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Widget text nei periodi pesca - consente troncamento se necessario */
.widget .widget-footer .data-row .widget-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.widget.day-forecast .widget-footer .data-row .widget-text small {
  display: block;
  
}

.widget.day-forecast .widget-footer .data-row .widget-text .score {
  display: inline-block;
  color: #ffffff;
  padding: 3px 5px;
  border-radius: 4px;
}

/* Icona meteo piccola nei periodi pesca */
.widget-weather-icon-small {
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 1px 2px var(--black-20));
  flex-shrink: 0;
}

/* Layout righe periodi pesca con box score verticale */
.fishing-period-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 0;
}

/* Box score colorato verticale */
.fishing-score-box {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px 6px;
  border-radius: 3px;
  font-weight: 700;
  font-size: 11px;
  color: #ffffff;
  box-shadow: var(--shadow-sm); /* FIX TASK NT-34 */
  text-shadow: 0 1px 3px var(--black-20);
  flex-shrink: 0;
}

/* Info periodo con tipo e orari */
.fishing-period-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

/* Tipo periodo (MAJOR/MINOR) */
.fishing-period-type {
  font-weight: 700;
  font-size: 12px;
  color: var(--white-95);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

/* Orari periodo */
.fishing-period-time {
  font-size: 10px;
  color: var(--white-70);
  line-height: 1.2;
}

.widget .widget-cont {
  color: #ffffff;
  text-align: right;
}

.day-forecast-scroll {
  display: flex;
  overflow-x: auto;
  gap: 15px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

/* ========== WIDGET-RIGA GRID (Apple Weather style) ========== */
/* Mobile: stack verticale */
.widget-riga-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 15px;
}

.widget-riga-grid > .widget-riga {
  margin-bottom: 0; /* Rimosso, gestito da gap */
}

.day-forecast-scroll .widget-riga {
    min-width: 100%;
flex: 0 0 100%;
scroll-snap-align: start;
}

.day-forecast-scroll .widget-riga .widget-header.btn-accordion .widget-cont.accordion-toggle{
  width: 100%;
}

.day-forecast-scroll::-webkit-scrollbar {
  display: none; /* Chrome, Safari */
}

.day-forecast-scroll .widget.day-forecast {
  min-width: 64%;
  flex: 0 0 64%;
  scroll-snap-align: start;
}

.day-forecast-scroll.pesca .widget.day-forecast {
  min-width: 64%;
  flex: 0 0 64%;
}

.day-forecast-scroll .widget.day-forecast.full {
  min-width: 100%;
  flex: 0 0 100%;
}

.day-forecast-scroll.pesca .widget.day-forecast .widget-cont {
  align-items: center;
}

.day-forecast-scroll.pesca .widget.day-forecast .widget-cont .widget-value strong,
.day-forecast-scroll.pesca .widget.day-forecast .widget-cont .widget-delta strong {
  font-size: 17px;
}

.day-forecast-scroll.pesca .widget.day-forecast .widget-cont .widget-delta.fishing {
  padding: 4px 7px;
  border-radius: 3px;
  text-shadow: 0 1px 3px var(--black-20);
}


/* Fishing forecast specific improvements */
.day-forecast-scroll .widget.day-forecast.full.fishing-card-full {
  margin-bottom: 1rem;
}

.day-forecast-scroll .widget.day-forecast.full.fishing-card-full:last-child {
  margin-bottom: 0;
}

/* Fishing forecast - Adaptive weights badge */
.badge-adaptive-weights {
  font-size: 0.65rem;
  margin-left: 4px;
  background: #ff9800;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* Fishing forecast - Confidence bar */
.fishing-confidence-bar {
  margin: 8px 0;
  padding: 0 8px;
}

.fishing-confidence-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}

.fishing-confidence-label {
  font-size: 0.7rem;
  opacity: 0.8;
}

.fishing-confidence-value {
  font-size: 0.7rem;
  font-weight: 600;
}

.fishing-confidence-track {
  background: var(--black-10);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
}

.fishing-confidence-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Confidence level colors based on data attribute */
.fishing-confidence-fill[data-level="high"] {
  background: #28a745;
}

.fishing-confidence-fill[data-level="good"] {
  background: #8bc34a;
}

.fishing-confidence-fill[data-level="moderate"] {
  background: #ffc107;
}

.fishing-confidence-fill[data-level="low"] {
  background: #ff9800;
}

/* Fishing rating colors - Dynamic background colors based on score */
.widget-delta.fishing[data-level="excellent"] {
  background: #28a745 !important;
}

.widget-delta.fishing[data-level="good"] {
  background: #8bc34a !important;
}

.widget-delta.fishing[data-level="fair"] {
  background: #ffc107 !important;
}

.widget-delta.fishing[data-level="poor"] {
  background: #ff9800 !important;
}

.widget-delta.fishing[data-level="bad"] {
  background: #9e9e9e !important;
}

/* Fishing period score box colors */
.fishing-score-box[data-level="excellent"] {
  background-color: #28a745;
}

.fishing-score-box[data-level="good"] {
  background-color: #8bc34a;
}

.fishing-score-box[data-level="fair"] {
  background-color: #ffc107;
}

.fishing-score-box[data-level="poor"] {
  background-color: #ff9800;
}

.fishing-score-box[data-level="bad"] {
  background-color: #9e9e9e;
}

.widget.day-forecast .widget-cont {
  color: #fff;
  font-weight: bold;
  display: flex;
  align-items: center;
}

.widget.day-forecast .weather-svg-icon {
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 1px 2px var(--black-20));
}

.widget.day-forecast .widget-cont span small.text-muted {
  color: #fff !important;
  font-weight: 300;
}

.widget .widget-cont .widget-data-preview {
  text-align: right;
  font-size: 11px;
}

.widget .widget-cont .widget-value {
  text-align: left;
}

.widget .widget-cont .widget-delta {
  text-align: right;
}

.widget .widget-cont .widget-value strong,
.widget .widget-cont .widget-delta strong {
  color: #fff;
  font-weight: bold;
  font-size: 18px;
}

.widget .btn-accordion {
  width: 100%;
  background-color: transparent;
  border: none;
  padding: 0;
}

.widget .btn-accordion[aria-expanded="true"] .arrow-accordion {
  transform: rotate(180deg);
  display: block;
  transition: transform 0.25s ease;
}

.widget .btn-accordion .widget-cont {
  color: rgb(255 255 255 / 75%);
}

.widget .btn-accordion .widget-cont .widget-title {
  color: #ffffff;
}

.widget .btn-accordion .widget-cont strong {
  color: #ffffff;
  font-weight: bold;
}

ul.day-hourly-list {
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
  margin-top: 15px;
  width: 100%;
  max-height: 192px;
  overflow-y: auto;
}

ul.day-hourly-list li.day-hourly-row {
  display: flex;
  align-items: center;
  padding-top: 8px;
  padding-bottom: 8px;
  border-bottom: 1px dotted rgb(255 255 255 / 25%);
  justify-content: space-between;
}

ul.day-hourly-list li.day-hourly-row:last-child {
  border-bottom: none;
}

/* ========== STAZIONI (LISTA DATI) ========== */
.station-data .data-row {
  margin-top: 0;
  padding-top: 8px;
  padding-bottom: 8px;
  border-bottom: 1px dotted rgb(255 255 255 / 25%);
}
.station-data .data-row:last-child {
  border-bottom: none;
}

.station-filters .station-filters-body {
  padding-top: 8px;
}
.station-filters .station-filters-search {
  width: 100%;
}
.station-filters .station-filters-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.station-filters .station-filters-row + .station-filters-row {
  margin-top: 8px;
}
.station-filters .station-filters-reset {
  flex: 0 0 auto;
  padding-left: 10px;
  padding-right: 10px;
}
.station-filters .station-filters-selects {
  flex-wrap: wrap;
}
.station-filters .station-filters-selects .form-select {
  flex: 1 1 160px;
  /* FIX iOS: Ensure selects are interactive */
  -webkit-appearance: menulist;
  appearance: menulist;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-touch-callout: none;
}

/* FIX iOS: Ensure filter inputs are focusable and responsive */
@supports (-webkit-touch-callout: none) {
  .station-filters .form-select,
  .station-filters .form-control {
    font-size: 16px !important; /* Prevent iOS zoom on focus */
  }
}
.station-filter-chip {
  border: 1px solid rgb(255 255 255 / 18%);
  cursor: pointer;
  -webkit-tap-highlight-color: var(--white-10);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.station-filter-chip.active {
  filter: brightness(1.05);
  border-color: rgb(255 255 255 / 40%);
  box-shadow: 0 0 0 2px rgb(255 255 255 / 10%);
}

/* ========== STATION DATA BADGES - High contrast for dark theme ========== */
/* Livello Mare / Onde - bg-info-subtle text-info → darker blue + white text */
.station-data .badge.bg-info-subtle {
  background-color: rgba(13, 110, 170, 0.85) !important;
  color: #fff !important;
}

/* Umidità - same as info, consistent with "water" theme */
.station-data .badge.bg-info-subtle.text-info {
  background-color: rgba(13, 110, 170, 0.85) !important;
  color: #fff !important;
}

/* Pressione - bg-secondary-subtle text-secondary → darker gray + white text */
.station-data .badge.bg-secondary-subtle {
  background-color: rgba(90, 98, 104, 0.9) !important;
  color: #fff !important;
}

/* Pioggia - bg-primary-subtle text-primary → darker blue + white text */
.station-data .badge.bg-primary-subtle {
  background-color: rgba(13, 110, 253, 0.75) !important;
  color: #fff !important;
}

/* Temperatura - bg-danger-subtle text-danger → warmer red/orange + white text */
.station-data .badge.bg-danger-subtle {
  background-color: rgba(200, 60, 60, 0.85) !important;
  color: #fff !important;
}

/* Warning badge (marea alta) - ensure high contrast */
.station-data .badge.bg-warning {
  background-color: rgba(255, 193, 7, 0.95) !important;
  color: #000 !important;
}

/* Danger badge (marea critica) - ensure high contrast */
.station-data .badge.bg-danger {
  background-color: rgba(220, 53, 69, 0.95) !important;
  color: #fff !important;
}

/* Provider badges */
.station-data .badge.bg-primary {
  background-color: rgba(13, 110, 253, 0.9) !important;
  color: #fff !important;
}

.station-data .badge.bg-secondary {
  background-color: rgba(108, 117, 125, 0.9) !important;
  color: #fff !important;
}

ul.day-hourly-list li.day-hourly-row .list-container {
  display: flex;
  align-items: center;
}

ul.day-hourly-list li.day-hourly-row .list-container.bottom {
  align-items: end;
}

ul.day-hourly-list li.day-hourly-row .weather-svg-icon-xs {
  width: 26px;
  margin-right: 5px;
  filter: drop-shadow(0 1px 2px var(--black-20));
}

ul.day-hourly-list li.day-hourly-row .hour-label {
  font-weight: normal;
  margin-right: 5px;
}

ul.day-hourly-list li.day-hourly-row .hour-desc {
  font-weight: normal;
  color: rgb(255 255 255 / 75%);
  font-size: 10px;
}

ul.day-hourly-list li.day-hourly-row .hour-desc strong {
  font-weight: normal;
  display: block;
  color: rgb(255 255 255 / 85%);
  font-size: 10px;
}

.windbar-box {
  display: grid;
  gap: 4px;
  width: 65px;
  text-align: center;
}

.list-container .windbar-box {
 margin-right: 10px;
}

.windbar-box .windbar-bar {
  width: 100%;
  height: 5px;
  border-radius: 4px;
  display: block;
}

.windbar-label {
  font-size: 10px;
  color: rgb(255 255 255 / 85%);
}

.windbar-label .wi-direction-up {
  display: inline-block;
  transform-origin: center;
  font-size: 12px;
  margin: 0 3px;
}

.windbar-label .wind-dir-text {
  font-size: 10px;
  opacity: 0.9;
}

ul.day-hourly-list li.day-hourly-row .badge {
  width: 55px;
  border-radius: 4px;
  font-size: 9px;
  padding: 3px;
}

.widget.domani {
  background: rgba(223, 223, 223, 0.1);
  background: linear-gradient(0deg,rgba(223, 223, 223, 0.1) 0%, rgba(223, 223, 223, 0) 100%);
}

.widget.domani .widget-semafori {
  margin-bottom: 10px;
  border-radius: 5px;
}

/* widget domani – nascondi scrollbar */
.widget.domani .widget-footer {
  border-top: none;
  margin-top: 0;
  display: flex;
  /*   height: 238px; */
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;

  /* Firefox */
  scrollbar-width: none; /* nasconde la track */
  /* Edge/IE legacy */
  -ms-overflow-style: none; /* IE 10+ */
  
  box-shadow: none;
  -webkit-backdrop-filter:none;
  backdrop-filter:none;
}

/* Chrome, Safari, Edge (Chromium) */
.widget.domani .widget-footer::-webkit-scrollbar {
  width: 0;
  height: 0; /* per sicurezza in orizzontale */
}

.widget.domani ul.day-hourly-list {
  margin-top: 0;
}

.day-forecast-accordion-list .widget .weather-svg-icon {
  margin-right: 5px;
}

.day-forecast-accordion-list .widget-title {
  line-height: 135%;
}

/* 1. ogni col-* dentro la .row diventa un flex-container */
.row.gx-3 > [class^="col"] {
  display: flex; /* le colonne si allungano fino all'altezza maggiore */
}

/* ========== ATTUALE (CURRENT) ========== */
.current-weather {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
  width: 100%;
}
/* .current-weather.today {
  padding: 10px;
} */

.current-weather .main-data {
  display: flex;
  align-items: center;
  color: #fff;
  font-weight: bold;
  line-height: 100%;
}

.current-weather .main-data .weather-svg-icon {
  width: 85px;
  height: 85px;
  margin-right: 5px;
  filter: drop-shadow(0 1px 2px var(--black-20));
}

.current-weather .main-data .current-data {
  width: 60%;
  font-size: 12px;
}

.current-weather .main-data .now-temp,
.current-weather .main-data .now-day {
  font-size: 21px;
  display: block;
  line-height: 100%;
  margin-bottom: 7px;
}
.current-weather .main-data .now-day {
  font-size: 11px;
  line-height: 100%;
  color: rgb(255 255 255 / 75%);
  font-weight: normal;
  margin-bottom: 5px;
}
.current-weather .main-data .now-desc {
  font-size: 14px;
  margin-bottom: 7px;
  display: block;
  line-height: 120%;
}
.current-weather .main-data .now-feels {
  color: rgb(255 255 255 / 75%);
  font-weight: normal;
  display: block;
  margin-bottom: 3px;
  font-size: 10px;
}
.current-weather .main-data .now-update {
  font-size: 11px;
  color: rgb(255 255 255 / 55%);
  font-weight: normal;
  display: block;
  line-height: 110%;
}

.current-weather .now-maxmin {
  display: flex;
  justify-content: center;
  flex-direction: column;
  color: #ffffff;
  font-size: 16px;
  margin-left: 15px;
}

.current-weather .now-maxmin .temp-value {
  display: flex;
  align-items: center;
}

.current-weather .now-maxmin .temp-value:nth-child(1) {
  margin-bottom: 5px;
}

.current-weather .now-maxmin .temp-value .arrow-icon {
  margin-right: 5px;
}

.current-weather .now-maxmin .temp-value .temp {
  font-size: 11px;
}

/* ========== ARROW E ICON ========== */

.btn-accordion-alert,
.alert-accordion-btn {
  background: none;
  border: none;
  color: inherit;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  transition: background 0.2s;
}
.btn-accordion-alert:focus,
.alert-accordion-btn:focus {
  outline: none;
  box-shadow: none;
  background: none;
}

.alert-accordion-btn {
  padding: 10px 0 10px 0;
  width: 100%;
  text-align: left;
  border-radius: 8px 8px 0 0;
  transition: background 0.18s;
}

/* ========== ALERT WIDGETS (STATUS COLORS) ========== */
.alert-widget {
  font-size: 13px;
  color: #fff;
  padding: 0;
}
.alert-widget .short-alert {
  padding: 10px 15px 10px;
  padding-top: 0;
  /* border-bottom: 1px solid var(--white-15); */
  font-size: 12px;
}

.alert-widget .short-alert .alert-line {
  margin-bottom: 5px;
}

.alert-widget .alert-scroll {
  max-height: 175px;
  margin-top: 0;
  overflow-y: auto;
  position: relative;
  padding: 10px 15px;
  font-size: 12px;
  line-height: 150%;
  /* color: rgb(255 255 255 / 85%); */
    mask-image: none;
    -webkit-mask-image: none;
  scroll-behavior: smooth;
  padding-left: 35px;
  padding-top: 0px;
}

.alert-widget .alert-scroll .narrative-block {
  margin-bottom: 5px;
}

/* Stato OK */
.alert-widget.ok {
  background-color: rgba(0, 210, 106, 0.2);
  /* border: 1px solid rgba(0, 210, 106, 0.6); */
}
.alert-widget.ok .alert-icon {
  color: #00d26a;
}
/* Stato Warning */
.alert-widget.warning {
  background-color: rgba(255, 213, 79, 0.2);
  /* border: 1px solid rgba(255, 213, 79, 0.6); */
}
.alert-widget.warning .alert-icon {
  color: #ffd54f;
}
/* Stato Danger */
.alert-widget.danger {
  background-color: rgba(229, 57, 53, 0.2);
  /* border: 1px solid rgba(229, 57, 53, 0.6); */
}
.alert-widget.danger .alert-icon {
  color: #ef5350;
}

/* ========== FORECAST BAR ========== */
.forecast {
  display: flex;
  align-items: flex-end; /* Allinea tutti gli items al bottom */
  overflow-x: auto;
  gap: 0;
  scroll-behavior: smooth;
}
.forecast.forecast-with-rain {
  position: relative;
}
.forecast::-webkit-scrollbar {
  display: none;
}
.forecast-item {
  min-width: 76px;
  min-height: 155px; /* Altezza minima per contenere tutti gli elementi */
  text-align: center;
  font-size: 11px;
  color: rgb(255 255 255 / 70%);
  padding: 0;
  position: relative; /* Container per absolute positioning */
  /* border-top: 1px solid rgb(129 129 129 / 70%); */
  /* border-top: 1px solid rgb(129 129 129 / 0%); */
}

/* Elementi allineati al TOP */
.forecast-item .hour {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  font-size: 11px;
  color: rgb(255 255 255 / 75%);
  margin: 0;
}

.forecast-item .weather-svg-icon {
  position: absolute;
  top: 32px;
  left: 50%;
  transform: translateX(-50%);
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 1px 2px var(--black-20));
}

.forecast-item .temp {
  position: absolute;
  top: 67px;
  left: 0;
  right: 0;
  font-size: 11px;
  color: rgb(255 255 255 / 80%);
  margin: 0;
}

/* Elementi allineati al BOTTOM */
.forecast-item .rain-bar-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 24px;
  z-index: 1;
}

.forecast-item .wind-box {
  position: absolute;
  bottom: 0;
  left: 0;
  font-size: 10px;
  color: rgb(255 255 255 / 90%);
  margin: 0;
  min-height: 110px;
  min-width: 76px;
}

.forecast-item .wind-box .wind-wrapper {
  position: absolute;
  bottom: 24px;
  left: 0;
  min-width: 76px;
  min-height: 35px;
}

/* Rain fill - elemento scalato all'interno */
.forecast-item .rain-fill {
  width: 100%;
  height: var(--fill-pct); /* Scala da 0 a 100% di 40px */
  position: absolute;
  bottom: 0;
  left: 0;
  background: linear-gradient(to bottom, rgba(100, 180, 255, 0.1), rgba(100, 180, 255, 0.55));
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

/* Picco isolato - forma ellittica dolce */
.forecast-item .rain-fill.rain-isolated {
/*   border-radius: 50% 50% 0 0 / 100% 100% 0 0; */
  width: 75%;
  left: 12.5%;
}

.forecast-item .rain-value-text {
  font-size: 9px;
  color: rgb(245 251 255 / 85%);
  font-weight: 700;
  /* text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9); */
  position: absolute;
  bottom: 2px;
  z-index: 5;
}
.forecast-item.forecast-15min {
  border-top: 1px solid rgb(255 141 36 / 70%);
}

.forecast-item.current {
  /* border-top: 1px solid rgb(255 141 36 / 70%); */
}

/* Regola rimossa - ora usa absolute positioning sopra */

.forecast-item.tramonto,
.forecast-item.alba {
  min-width: 45px;
}
.forecast-item.tramonto {
  background: linear-gradient(
    to bottom,
    rgba(255, 179, 71, 0.55),
    rgba(255, 179, 71, 0)
  ) !important;
}
.forecast-item.alba {
  background: linear-gradient(
    to top,
    rgba(255, 111, 145, 0.55),
    rgba(255, 111, 145, 0)
  ) !important;
}

/* Regole rimosse - ora usano absolute positioning sopra */

.forecast-item.tramonto .hour,
.forecast-item.tramonto .temp {
  color: #ffd8a0;
}
.forecast-item.alba .hour,
.forecast-item.alba .temp {
  color: #ffc0cf;
}
/* FIX TASK NT-35: Icon colors with increased specificity */
.forecast-item i.alba-icon {
  color: #ff6f91;
}
.forecast-item i.tramonto-icon {
  color: #ffb347;
}
/* Etichetta giorno */
.forecast-day-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  font-size: 12px;
  opacity: 0.6;
  padding: 3px 0;
  background-color: rgb(28 51 58 / 86%);
  border-radius: 0;
  border-bottom: solid rgb(28 51 58 / 86%) 3px;
  box-sizing: border-box;
  flex-shrink: 0;
  min-height: 155px;
}
.forecast-day-label .giorno-label,
.forecast-day-label .giorno-num {
  text-transform: uppercase;
  font-size: 10px;
  line-height: 1.2;
  color: #ffffff;
}
.forecast-day-label .giorno-num {
  font-size: 11px;
}
.forecast-day-label .divider {
  width: 15px;
  height: 1px;
  background-color: #a0b8d4;
  opacity: 0.3;
  margin: 5px 0;
}

/* ========== WIND BOX COLOR GRADIENTS ========== */

.wind-line {
  line-height: 1.2;
  white-space: nowrap;
  margin-bottom: 3px;
}

.wind-line .wi-direction-up {
  display: inline-block;
  transform-origin: center;
  transition: transform 0.3s ease;
  font-size: 15px;
}

.wind-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px; /* Spazio tra freccia e testo */
}

.wind-line .wi-direction-up {
  display: inline-block;
  transform-origin: center;
  transition: transform 0.3s ease;
  font-size: 14px;
  flex-shrink: 0; /* Non rimpicciolire la freccia */
}

.wind-line .wind-dir-text {
  font-size: 10px;
  opacity: 0.9;
}

.wind-bar,
.gust-bar {
  background-color: var(--white-05);
  border-radius: 6px;
  height: 32px;
  padding: 2px 6px;
  font-size: 10px;
  color: #e0f0ff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.wind-indicator {
  margin-top: 3px;
  height: 3px;
  border-radius: 2px;
  width: 60%;
}

/* Wind gradient levels */
.wind-box.lvl-00 {
  background: linear-gradient(
    0deg,
    rgba(178, 245, 234, 0.5) 0%,
    rgba(178, 245, 234, 0) 100%
  );
}
.wind-box.lvl-04 {
  background: linear-gradient(
    0deg,
    rgba(150, 230, 220, 0.5) 0%,
    rgba(150, 230, 220, 0) 100%
  );
}
.wind-box.lvl-11 {
  background: linear-gradient(
    0deg,
    rgba(120, 215, 205, 0.5) 0%,
    rgba(120, 215, 205, 0) 100%
  );
}
.wind-box.lvl-18 {
  background: linear-gradient(
    0deg,
    rgba(90, 200, 180, 0.5) 0%,
    rgba(90, 200, 180, 0) 100%
  );
}
.wind-box.lvl-25 {
  background: linear-gradient(
    0deg,
    rgba(72, 187, 150, 0.5) 0%,
    rgba(72, 187, 150, 0) 100%
  );
}
.wind-box.lvl-32 {
  background: linear-gradient(
    0deg,
    rgba(56, 161, 105, 0.5) 0%,
    rgba(56, 161, 105, 0) 100%
  );
}
.wind-box.lvl-40 {
  background: linear-gradient(
    0deg,
    rgba(158, 113, 255, 0.5) 0%,
    rgba(158, 113, 255, 0) 100%
  );
}
.wind-box.lvl-47 {
  background: linear-gradient(
    0deg,
    rgba(140, 88, 255, 0.5) 0%,
    rgba(140, 88, 255, 0) 100%
  );
}
.wind-box.lvl-54 {
  background: linear-gradient(
    0deg,
    rgba(120, 70, 255, 0.5) 0%,
    rgba(120, 70, 255, 0) 100%
  );
}
.wind-box.lvl-61 {
  background: linear-gradient(
    0deg,
    rgba(105, 58, 255, 0.5) 0%,
    rgba(105, 58, 255, 0) 100%
  );
}
.wind-box.lvl-68 {
  background: linear-gradient(
    0deg,
    rgba(90, 50, 220, 0.5) 0%,
    rgba(90, 50, 220, 0) 100%
  );
}
.wind-box.lvl-76 {
  background: linear-gradient(
    0deg,
    rgba(170, 50, 180, 0.5) 0%,
    rgba(170, 50, 180, 0) 100%
  );
}
.wind-box.lvl-86 {
  background: linear-gradient(
    0deg,
    rgba(200, 45, 130, 0.5) 0%,
    rgba(200, 45, 130, 0) 100%
  );
}
.wind-box.lvl-97 {
  background: linear-gradient(
    0deg,
    rgba(230, 30, 90, 0.5) 0%,
    rgba(230, 30, 90, 0) 100%
  );
}
.wind-box.lvl-104 {
  background: linear-gradient(
    0deg,
    rgba(245, 25, 60, 0.5) 0%,
    rgba(245, 25, 60, 0) 100%
  );
}
.wind-box.lvl-130 {
  background: linear-gradient(
    0deg,
    rgba(255, 20, 40, 0.5) 0%,
    rgba(255, 20, 40, 0) 100%
  );
}
.wind-box.lvl-00::after {
  background-color: rgba(178, 245, 234, 0.4);
}
.wind-box.lvl-04::after {
  background-color: rgba(150, 230, 220, 0.2);
}
.wind-box.lvl-11::after {
  background-color: rgba(120, 215, 205, 0.3);
}
.wind-box.lvl-18::after {
  background-color: rgba(90, 200, 180, 0.45);
}
.wind-box.lvl-25::after {
  background-color: rgba(72, 187, 150, 0.85);
}
.wind-box.lvl-32::after {
  background-color: rgba(56, 161, 105, 0.85);
}
.wind-box.lvl-40::after {
  background-color: rgba(158, 113, 255, 0.85);
}
.wind-box.lvl-47::after {
  background-color: rgba(140, 88, 255, 0.9);
}
.wind-box.lvl-54::after {
  background-color: rgba(120, 70, 255, 0.95);
}
.wind-box.lvl-61::after {
  background-color: rgba(105, 58, 255, 1);
}
.wind-box.lvl-68::after {
  background-color: rgba(90, 50, 220, 1);
}
.wind-box.lvl-76::after {
  background-color: rgba(170, 50, 180, 1);
}
.wind-box.lvl-86::after {
  background-color: rgba(200, 45, 130, 1);
}
.wind-box.lvl-97::after {
  background-color: rgba(230, 30, 90, 1);
}
.wind-box.lvl-104::after {
  background-color: rgba(245, 25, 60, 1);
}
.wind-box.lvl-130::after {
  background-color: rgba(255, 20, 40, 1);
}

/* ========== METEO ROW GENERIC LAYOUT ========== */
.meteo-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
  gap: 6px 10px;
}
.meteo-icon {
  font-size: 16px;
  color: #72d9f5;
  margin-right: 8px;
}
.meteo-label {
  color: rgb(255 255 255 / 70%);
}
.meteo-value {
  color: #ffffff;
}
.divider,
.divider-sm {
  border-top: 1px solid var(--white-15);
}
.highlight {
  color: rgb(255 255 255 / 70%);
}

/* ========== SEMAFORI (DOTS & ICONS) ========== */
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 3px;
}

.dot-green   { background-color: #4caf50; }
.dot-yellow  { background-color: #ffeb3b; }
.dot-orange  { background-color: #ff9800; }
.dot-red     { background-color: #f44336; }

/* Icone coerenti */
.icon-green   { color: #4caf50; }
.icon-yellow  { color: #ffeb3b; }
.icon-orange  { color: #ff9800; }
.icon-red     { color: #f44336; }

/* Icone square colorate come semafori */
.icon-visi-0 {
  color: #ffffff;
} /* nero: pessima visibilità */
.icon-visi-1 {
  color: #f44336;
} /* rosso */
.icon-visi-2 {
  color: #ff8900;
} /* giallo scuro */
.icon-visi-3 {
  color: #4caf50;
} /* verde: ottima visibilità */

/* Indice UV colorato */
.uv-0 {
  color: #4caf50;
}
.uv-1 {
  color: #ffeb3b;
}
.uv-2 {
  color: #ff9800;
}
.uv-3 {
  color: #f44336;
}
.uv-4 {
  color: #b71c1c;
  font-weight: bold;
}

/* ========== SEMAFORI WIDGET SCROLL ========== */
.widget-semafori {
  display: flex;
  padding: 10px 15px 10px;
  gap: 12px;
  overflow-x: hidden;
  border-radius: 0;
  border: none;
}
.widget-semafori .widget-title {
  display: flex;
  align-items: center;
  font-size: 11px;
  font-weight: bold;
  color: #ffffff;
  margin: 0;
  line-height: 100%;
}
.widget-semafori .colonna-etichette {
  height: 39px;
  margin-top: 3px;
}
.semaforo-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
  max-width: 100%;
  flex-grow: 1;
  height: 46px;
  scroll-behavior: smooth;
}
.semaforo-scroll::-webkit-scrollbar {
  display: none;
}
.semaforo-scroll > .d-flex {
  flex-wrap: nowrap;
}
.semaforo-item {
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}
.semaforo-label {
  font-size: 11px;
  min-width: 80px;
}
.semaforo-hour {
  font-size: 11px;
  color: #ffffff;
}
.uv-label {
  font-size: 11px;
  margin-left: 4px;
}

/* ========== CHART WIDGETS ========== */

canvas {
  touch-action: none !important;
  user-select: none;
  -webkit-user-select: none;
}

.chart-actions {
  display: flex;
  align-items: flex-start;
  margin-top: 12px;
  margin-bottom: -28px;
  pointer-events: all;
  position: relative;
  z-index: 10;
}

.chart-actions .chart-btn-group {
}

.chart-actions .chart-btn {
  padding: 3px 6px;
  color: #fff;
  background-color: #0c416b;
  border-radius: 4px;
  border: none;
  font-size: 10px;
  font-weight: bold;
}

.chart-container {
  width: 100%;
  max-width: 100%;
  height: 240px;
  min-height: 240px;
  position: relative;
  overflow: hidden;
  /*transition: opacity .15s ease-out;*/
  transition: none;
}

.chartjs-tooltip {
  z-index: 9999 !important;
  pointer-events: none;
}

.widget.widget-riga .chart-container {
  margin-top: 10px;
}

/* durante l'animazione dell'accordion il canvas rimane invisibile */
.collapse.show .chart-container {
  opacity: 1;
}

/* ========== NAVBAR BOTTOM ========== */
/* FIX TASK NT-20: Navbar bottom con safe-area completo (bottom + laterale per landscape) */
.navbar-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--ui-nav-bg, rgb(73 73 73 / 0.25));
  border-top: 1px solid var(--ui-nav-border, var(--white-20));
  z-index: 999;
  display: flex;
  /* Safe-area: bottom per home indicator, laterale per landscape mode */
  padding-top: 10px;
  padding-bottom: var(--ui-bottom-pad);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
  backdrop-filter: blur(10px) !important;
}

.nav-link-nav {
  flex: 1;
  text-align: center;
  font-size: 11px;
  text-decoration: none;
  color: rgb(255 255 255 / 70%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: color 0.3s ease;
}
.nav-link-nav i {
  font-size: 20px;
  line-height: 1;
  margin-bottom: 5px;
}
.nav-link-nav.active {
  color: #ffffff;
}
.nav-link-nav.active::after {
  content: "";
  position: absolute;
  bottom: -8px;
  width: 18px;
  height: 2px;
  background-color: #ffffff;
  border-radius: 1px;
  transition: width 0.2s ease;
}


/* Visibilità */
.badge .bi-eye {
  vertical-align: -2px;
}

/* Lista sensori / righe widget */
.day-forecast-accordion-list .sensor-value-display {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.day-forecast-accordion-list .station-info {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.day-forecast-accordion-list .sensor-icon {
  display: inline-block;
  width: 24px;
  text-align: center;
}

.day-forecast-accordion-list .sensor-value-display .badge {
  font-size: 0.85em;
}

.day-forecast-accordion-list .windbar-label {
  font-size: 0.9em;
}

.day-forecast-accordion-list .windbar-bar {
  --w: 0%;
  display: block;
  height: 6px;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    var(--wind-lvl-04) 0%,
    var(--wind-lvl-25) 40%,
    var(--wind-lvl-54) 75%,
    var(--wind-lvl-97) 100%
  );
  position: relative;
  overflow: hidden;
}

.day-forecast-accordion-list .windbar-bar::after {
  content: "";
  position: absolute;
  top: 0; 
  left: 0; 
  bottom: 0;
  width: var(--w);
  background: inherit;
  border-radius: 4px;
}

/* ============================================================
   LEAFLET STYLES - TUTTO RAGGRUPPATO
============================================================ */
.leaflet-container .leaflet-control-attribution {
  display: none !important;
}
   
.leaflet-popup-pane {
          z-index: 2000 !important;
          position: relative !important;
        }
        .leaflet-tooltip-pane {
          z-index: 850 !important;
          position: relative !important;
        }
        .leaflet-norotate-pane {
          z-index: 550 !important;
        }
   
   .leaflet-pane.leaflet-user-pane {
	   z-index: 500 !important;
   }
   
   
/* FULL HEIGHT MAP IN VIEW STAZIONI */
body.view-stazioni > .container-custom,
body.view-stazioni > .container-fluid,
body.view-stazioni > main,
body.view-stazioni > section,
body.view-stazioni > header {
  z-index: 0 !important;
}

/* Il contenitore della mappa deve crescere a 100% */
body.view-stazioni #stazioni-map .leaflet-map-widget,
body.view-stazioni #map-container {
  height: 100% !important;
  min-height: 0 !important;
  width: 100%;
  border-radius: 0;
  overflow: hidden;
  block-size: 100vh;
}

/* Variante "widget-map" */
body.view-stazioni #map-container.widget-map {
  height: 100% !important;
}

/* Evita scroll fantasma */
body.view-stazioni .container-custom {
  padding: 0;
}

/* FULLSCREEN MAP – ancorata tra top e navbar */
body.view-stazioni #stazioni-map {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
}

/* Il contenitore interno della mappa riempie lo spazio */
body.view-stazioni #stazioni-map .leaflet-map-widget,
body.view-stazioni #map-container {
  position: absolute;
  inset: 0;
  height: auto !important;
  min-height: 0 !important;
  width: 100%;
  border-radius: 0;
  overflow: hidden;
}

/* Controlli Leaflet rispettano le safe areas */
body.view-stazioni #stazioni-map .leaflet-top { 
  top: var(--safe-top) !important; 
}
body.view-stazioni #stazioni-map .leaflet-bottom { 
  bottom: var(--ui-bottom-pad) !important; 
}

/* Mappa fullscreen: niente padding-top "vuoto" */
body.view-stazioni .location-bar { 
  padding-top: 0 !important; 
}






#stazioni-map .leaflet-left,
#stazioni-map .leaflet-right {
  background-color: transparent;
  display: block;
  margin-top: 15px;
}

#stazioni-map .leaflet-left {
  left: 15px;
}

#stazioni-map .leaflet-right {
  right: 15px;
}

.leaflet-top .leaflet-control {
  margin: 0;
  margin-right: 0 !important;
  border: none;
  background-color: transparent;
  float: none !important;
}

.leaflet-left .leaflet-control {
  margin-left: 0 !important;
}

.leaflet-touch .leaflet-control-layers, .leaflet-touch .leaflet-bar {
  border: none !important;
}

.leaflet-control-zoom-in,
.leaflet-control-zoom-out,
.leaflet-control.btn-gps,
.leaflet-control-layers-toggle {
	margin-bottom: 5px !important;
	display: block;
	width: 32px !important;
	height: 32px !important;
	transition: background .2s, transform .2s;
	background-color: #ffffff;
  box-shadow: none;
   cursor: pointer;
   border-radius: 8px !important;
   background-size: 18px !important;
   color: #222222 !important;
   box-shadow: 0px 0px 8px -4px rgb(0 0 0 / 60%);
   margin-top: 0 !important;
   margin-right: 0 !important;
}

@media (hover: hover) and (pointer: fine) {
  .leaflet-control-layers {
    width: auto !important;
    height: auto !important;
    overflow: visible;
  }

  .leaflet-control-layers-list {
    position: relative;
    right: auto;
    top: auto;
  }
}

.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
	line-height: 27px !important;
}

.leaflet-control-zoom-out {
	margin-bottom: 0;
}

.leaflet-control-zoom-in span,
.leaflet-control-zoom-out span {
	color: #222222 !important;
	font-size: 20px !important;
}


/* Base: pulsante GPS/Bussola */
.leaflet-control.btn-gps {
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.leaflet-control.btn-gps svg { 
  width: 18px; 
  height: 18px; 
  display: block; 
}

/* Stato 1: solo GPS (none) */
.leaflet-control.btn-gps.state-none {
  color: #999999 !important;
}

/* Stato 2: follow (cono bussola attivo) */
.leaflet-control.btn-gps.state-follow svg {
  color: #0b84ff;
}

/* Stato 3: rotate (mappa che ruota) */
.leaflet-control.btn-gps.state-rotate svg {
  color: #0b84ff;
  transform: rotate(316deg);
}

/* Hover/active comuni */
.leaflet-control.btn-gps:hover,
.leaflet-control-layers-toggle:hover { 
  background: #f7fbff; 
}

.leaflet-control.btn-gps:active,
.leaflet-control-layers-toggle:active { 
  transform: translateY(1px); 
}


.leaflet-control-layers-list {
  padding: 10px;
  background: #ffffff;
  position: absolute !important;
  top: -10px;
  right: -10px;
  z-index: 100;
  width: 200px;
  pointer-events: auto;
}
.leaflet-control-layers .leaflet-control-layers-list {
  display: none;
}
.leaflet-control-layers.leaflet-control-layers-expanded .leaflet-control-layers-list {
  display: block;
}
.leaflet-control-layers.mc-layers-open .leaflet-control-layers-list {
  display: block;
}
.leaflet-control-layers.leaflet-control-layers-expanded .leaflet-control-layers-toggle {
  display: block;
}
.leaflet-control-layers {
  pointer-events: auto;
  z-index: 1000;
  position: relative;
  width: 32px;
  height: 32px;
}
@media (hover: hover) and (pointer: fine) {
  .leaflet-control-layers:hover .leaflet-control-layers-list {
    display: block;
  }
  .leaflet-control-layers:hover .leaflet-control-layers-toggle {
    display: block;
  }
}

.leaflet-control-layers label {
	font-size: 12px;
	margin-bottom: 5px;
}

.leaflet-control-layers .lc-group {
	margin-top: 15px !important;
	color: #000000 !important;
	font-size: 11px !important;
	margin-bottom: 2px !important;
}


/* Popup stazioni coerente con i widget */
.station-popup {
  max-width: 300px;
}

.station-popup .station-name {
  font-weight: 600;
  border-bottom: 1px solid #dee2e6;
  padding-bottom: 0.4rem;
  margin-bottom: 5px;
  font-size: 13px;
}

.station-popup .station-name .badge {
  font-size: 9px;
  text-transform: uppercase;
}

.sensor-popup-item {
  padding: 4px 0px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 11px;
  line-height: 110%;
}

.sensor-popup-item:last-child {
  border-bottom: none;
}

.sensor-popup-item .sensor-name {
  font-weight: 500;
  color: #495057;
}

#stazioni-map .leaflet-popup-content-wrapper,
#stazioni-map .leaflet-popup-tip {
  background: #fff;
  color: #2b2f36;
  border-radius: 10px;
  box-shadow: var(--shadow-elevated); /* FIX TASK NT-34 */
}

.leaflet-popup-content {
  margin: 10px;
}

/* MarkerCluster */
#stazioni-map .marker-cluster-small {
	background-color: rgb(255 193 7 / 35%);
}
#stazioni-map .marker-cluster-small div {
  background: #FF9800;
}

#stazioni-map .marker-cluster-medium {
  background: rgb(255 87 34 / 35%);
}
#stazioni-map .marker-cluster-medium div {
  background: #FF5722;
}

#stazioni-map .marker-cluster-large {
  background: rgb(255 87 34 / 35%);
}
#stazioni-map .marker-cluster-large div {
  background: #FF5722;
}

#stazioni-map .marker-cluster div {
  color: #fff;
  font-size: 11px;
}



.leaflet-bottom .leaflet-control.gps-ctl,
.leaflet-bottom .leaflet-control.wind-ctl,
.leaflet-bottom .leaflet-control.radar-ctl {
 width: 120px !important;
 height: 40px;
 margin: 0 !important;
 min-width: 120px !important;
 left: 0;
 bottom: calc(55px + var(--ui-bottom-pad));
 position: absolute;
 font-size: 11px !important;
 line-height: 130% !important;
 border-radius: 4px !important;
 color: #ffffff !important;
 background-color: rgb(73 73 73 / 45%) !important;
 padding: 5px !important;
}

.pwa-mode .leaflet-bottom .leaflet-control.gps-ctl,
.pwa-mode .leaflet-bottom .leaflet-control.wind-ctl,
.pwa-mode .leaflet-bottom .leaflet-control.radar-ctl {
 bottom: calc(25px + var(--ui-bottom-pad));
}

.leaflet-bottom .leaflet-control.wind-ctl {
  bottom: calc(100px + var(--ui-bottom-pad));
}

.pwa-mode .leaflet-bottom .leaflet-control.wind-ctl {
  bottom: calc(70px + var(--ui-bottom-pad));
}

.leaflet-bottom .leaflet-control.radar-ctl {
	left: 125px !important;
	width: 200px !important;
	min-width: 200px !important;
}


/* Dark mode: darker background for better contrast */
@media (prefers-color-scheme: dark) {
  .leaflet-bottom .leaflet-control.gps-ctl,
  .leaflet-bottom .leaflet-control.wind-ctl,
  .leaflet-bottom .leaflet-control.radar-ctl {
   background-color: rgb(78 78 78 / 85%) !important;
   }
}

/*
 * NOTE: @media (display-mode: standalone) removed
 *
 * No longer needed - safe-area CSS variables automatically handle
 * the difference between Safari browser and PWA full-screen mode:
 * - Safari browser: --safe-bottom = 0px (navbar present)
 * - PWA mode: --safe-bottom = ~34px (home indicator area)
 *
 * calc() formulas above will automatically adjust positioning
 */


.leaflet-bottom .leaflet-control.gps-ctl div,
.leaflet-bottom .leaflet-control.wind-ctl div {
 margin-bottom: 1px;
}

.leaflet-bottom .leaflet-control.gps-ctl strong,
.leaflet-bottom .leaflet-control.wind-ctl strong {
 font-weight: normal !important;
}




.leaflet-bottom .leaflet-control.radar-ctl .rv-header {
  position: absolute;
  top: 9px;
}

.leaflet-bottom .leaflet-control.radar-ctl .rv-btn {
	border-radius: 4px;
	/* width: 22px;
	height: 22px; */
}

.leaflet-bottom .leaflet-control.radar-ctl .rv-timeline {
  position: absolute;
  top: 5px;
  margin-bottom: 0;
  left: 100px
}

.leaflet-bottom .leaflet-control.radar-ctl .rv-timeline input {
  width: 92px;
}

.leaflet-bottom .leaflet-control.radar-ctl .rv-info {
  position: absolute;
  top: 16px;
  left: 3px;
}


.leaflet-bottom .leaflet-control.radar-ctl .rv-ts {
  font-size: 11px;
  color: #ffffff;
  font-weight: normal;
}


/* === RADAR PLAYER - Icone SVG unificate === */
.radar-ctl .rv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 25px;
  height: 25px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: var(--white-08);
  color: #fff;
  padding: 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.radar-ctl .rv-btn:hover {
  background: var(--white-15);
  border-color: rgba(255, 255, 255, 0.35);
}

.radar-ctl .rv-btn:active {
  transform: scale(0.95);
  background: var(--white-20);
}

/* Icone SVG dentro i pulsanti */
.radar-ctl .rv-btn svg {
  display: block;
  pointer-events: none;
  width: 15px;
  height: 15px;
}

/* Pulsante play/pause leggermente più grande */
.radar-ctl .rv-play-btn {
  min-width: 32px;
}

.radar-ctl .rv-play-btn svg {
  width: 15px;
  height: 15px;
}

/* Stati aria-pressed per accessibilità */
.radar-ctl .rv-btn[aria-pressed="true"] {
  background: rgba(0, 188, 212, 0.25);
  border-color: rgba(0, 188, 212, 0.4);
}







.leaflet-pane.leaflet-windHover-pane {
	z-index: 451 !important;
}

.wind-crosshair {
	position: relative;
	width: 19px;
	height: 19px;
	pointer-events: none;
}

.wind-crosshair .v,
.wind-crosshair .h {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
	box-shadow: var(--shadow-inset); /* FIX TASK NT-34 */
}

.wind-crosshair .v {
	width: 2px;
	height: 19px;
}

.wind-crosshair .h {
	width: 19px;
	height: 2px;
}



/* ============================================================
   FINE SEZIONE LEAFLET
   ============================================================ */


/* MEDIA QUERY */
@media (min-width: 375px) {
  .current-weather .main-data .weather-svg-icon {
    width: 100px;
    height: 100px;
  }
  
  .current-weather .main-data .now-temp,
  .current-weather .main-data .now-day {
    font-size: 23px;
  }

  .current-weather .main-data .now-desc {
    font-size: 20px;
    margin-bottom: 10px;
  }
  
.current-weather.pesca .main-data .now-temp,
.current-weather.pesca .main-data .now-day {
    font-size: 14px;
    font-weight: normal;
    opacity: 0.8;
  }

  .forecast-item .hour {
    font-size: 12px;
  }
  .forecast-item .temp {
    font-size: 12px;
  }

  .current-weather .main-data .now-day {
    font-size: 13px;
  }

  .current-weather .main-data .now-feels {
    font-size: 12px;
    margin-bottom: 5px;
  }

  .widget-semafori .widget-title {
    font-size: 12px;
  }

  .widget .widget-header .widget-title,
  .widget .btn-accordion .widget-cont .widget-title {
    font-size: 11px;
  }

  ul.day-hourly-list li.day-hourly-row .badge {
    width: 60px;
    font-size: 10px;
  }

  ul.day-hourly-list li.day-hourly-row .hour-desc {
    font-size: 11px;
  }

  .widget .widget-cont .widget-data-preview {
    font-size: 12px;
  }

  .alert-widget .short-alert {
    font-size: 12px;
  }
  .alert-widget .alert-scroll {
    font-size: 12px;
  }

  ul.day-hourly-list li.day-hourly-row .weather-svg-icon-xs {
    width: 30px;
  }

  .widget .widget-footer .data-row {
    font-size: 12px;
  }

  ul.day-hourly-list li.day-hourly-row .hour-desc strong {
    font-size: 11px;
  }

.windbar-box {
    width: 75px;
  }
}

@media (min-width: 390px) {
  .current-weather .main-data .weather-svg-icon {
    width: 105px;
    height: 105px;
  }
  
  .widget .widget-cont .widget-value strong,
  .widget .widget-cont .widget-delta strong {
    font-size: 20px;
  }

.windbar-box {
    width: 99px;
  }
}

@media (min-width: 430px) {
.windbar-box {
    width: 115px;
  }
  
  .current-weather .main-data .weather-svg-icon {
    width: 115px;
    height: 115px;
  }

  .current-weather .main-data .now-temp,
  .current-weather .main-data .now-day {
    font-size: 22px;
  }
  
  .current-weather .main-data .now-desc {
    font-size: 22px;
  }
  
  .current-weather.today .main-data .now-temp,
  .current-weather.today .main-data .now-day {
    font-size: 17px;
  }
  
}

/* ========== CHART LOADING STATE ========== */
.chart-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(27, 66, 92, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 8px;
  transition: opacity 0.3s ease-out;
}

.chart-loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.chart-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--white-10);
  border-top-color: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: chart-spin 0.8s linear infinite;
}

@keyframes chart-spin {
  to { transform: rotate(360deg); }
}

.chart-loading-text {
  margin-top: 12px;
  font-size: 11px;
  color: var(--white-70);
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* Skeleton pulse animation (optional alternative) */
.chart-skeleton {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.03) 25%,
    var(--white-08) 50%,
    rgba(255, 255, 255, 0.03) 75%
  );
  background-size: 200% 100%;
  animation: chart-skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes chart-skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ========== PWA INSTALL BANNER ========== */
/* FIX TASK NT-20: PWA banner con safe-area completo (top + laterale per landscape) */
.pwa-install-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: rgba(40, 44, 52, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 4px 12px var(--black-15),
    0 0 0 1px var(--white-10);
  transform: translateY(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  /* Safe-area: top per notch, laterale per landscape mode */
  padding: var(--ui-top-pad) var(--safe-right) 0 var(--safe-left);
}

.pwa-install-banner.pwa-banner-visible {
  transform: translateY(0);
}

.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  position: relative;
}

.pwa-banner-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--white-20);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
  z-index: 2;
}

.pwa-banner-close:hover,
.pwa-banner-close:active {
  background: var(--white-30);
}

.pwa-banner-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--white-20);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
}

.pwa-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 30px; /* Spazio per close button */
}

.pwa-banner-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
}

.pwa-banner-subtitle {
  font-size: 12px;
  color: var(--white-85);
  line-height: 1.3;
}

.pwa-banner-install-btn {
  flex-shrink: 0;
  background: var(--white-20);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.pwa-banner-install-btn:hover {
  background: var(--white-30);
}

.pwa-banner-install-btn:active {
  background: var(--white-15);
}

.pwa-banner-install-btn i {
  font-size: 16px;
}

/* iOS Instructions Panel */
.pwa-ios-instructions {
  background: var(--white-10);
  border-top: 1px solid var(--white-20);
  padding: 16px;
  margin-top: 8px;
  animation: pwa-ios-slide-down 0.3s ease-out;
}

@keyframes pwa-ios-slide-down {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pwa-ios-steps {
  max-width: 400px;
  margin: 0 auto;
}

.pwa-ios-intro {
  font-size: 13px;
  color: #fff;
  margin: 0 0 12px 0;
  font-weight: 600;
}

.pwa-ios-list {
  margin: 0 0 16px 0;
  padding-left: 20px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  line-height: 1.6;
}

.pwa-ios-list li {
  margin-bottom: 8px;
}

.pwa-ios-list strong {
  color: #fff;
  font-weight: 600;
}

.pwa-ios-got-it {
  width: 100%;
  background: var(--white-20);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.pwa-ios-got-it:hover {
  background: var(--white-30);
}

.pwa-ios-got-it:active {
  background: var(--white-15);
}

/* Responsive adjustments */
@media (max-width: 360px) {
  .pwa-banner-content {
    gap: 8px;
    padding: 10px 12px;
  }

  .pwa-banner-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .pwa-banner-title {
    font-size: 13px;
  }

  .pwa-banner-subtitle {
    font-size: 11px;
  }

  .pwa-banner-install-btn {
    padding: 6px 12px;
    font-size: 12px;
  }
}

/* Low power mode: disabilita animazioni */
html[data-power="low"] .pwa-install-banner,
html[data-power="low"] .pwa-ios-instructions {
  transition: none !important;
  animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .pwa-install-banner,
  .pwa-ios-instructions {
    transition: none !important;
    animation: none !important;
  }
}

/* ========================================================
   RESPONSIVE LAYOUT - TABLET & DESKTOP
   Ispirato a Apple Weather su iPad
   ======================================================== */

/* --- TABLET PORTRAIT (768px+) --- */
@media (min-width: 768px) {

  /* Container più ampio e padding laterale aumentato */
  .container-custom {
    padding: 0 20px;
    max-width: 1200px;
    padding-bottom: calc(70px + var(--safe-bottom));
  }

  /* Current weather: layout orizzontale */
  .current-weather.today {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
  }

  .current-weather .main-data {
    flex-direction: row;
    gap: 24px;
  }

  .current-weather .weather-svg-icon {
    width: 120px;
    height: 120px;
  }

  .current-weather .current-data .now-temp {
    font-size: 64px;
  }

  .current-weather .now-maxmin {
    flex-direction: column;
    gap: 12px;
    margin-top: 0;
  }

  /* Widget griglia 2 colonne */
  .row.gx-3 {
    gap: 12px;
  }

  .row.gx-3 > .col-6 {
    flex: 0 0 calc(50% - 6px);
    max-width: calc(50% - 6px);
  }

  .row.gx-3 > .col-12 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  /* Widget più spaziosi */
  .widget {
    padding: 16px 18px;
  }

  .widget-header {
    margin-bottom: 12px;
  }

  /* Forecast scroll: più card visibili */
  .day-forecast-scroll {
    gap: 12px;
    padding: 0 2px;
  }

  .day-forecast-scroll .widget.day-forecast,
  .day-forecast-scroll .widget {
    min-width: 180px;
    max-width: 200px;
  }

  /* Hourly forecast: ottimizza larghezza */
  ul.day-hourly-list li.day-hourly-row {
    min-width: 90px;
  }

  /* Widget-riga-grid: 2 colonne anche su iPad portrait */
  .widget-riga-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .widget-riga-grid > .widget-riga {
    margin-bottom: 0;
  }

}

/* --- TABLET LANDSCAPE / iPad Pro (1024px+) --- */
@media (min-width: 1024px) {

  .container-custom {
    padding: 0 32px;
    max-width: 1400px;
  }

  /* Current weather: ancora più spazioso */
  .current-weather.today {
    padding: 28px 32px;
  }

  .current-weather .weather-svg-icon {
    width: 140px;
    height: 140px;
  }

  .current-weather .current-data .now-temp {
    font-size: 72px;
  }

  /* Layout 2 colonne per widget piccoli */
  .row.gx-3.widget-grid-2 > .col-6 {
    flex: 0 0 calc(50% - 8px);
    max-width: calc(50% - 8px);
  }

  /* Forecast scroll: card più grandi */
  .day-forecast-scroll .widget.day-forecast,
  .day-forecast-scroll .widget {
    min-width: 200px;
    max-width: 220px;
  }

  /* Charts: dimensioni ottimizzate */
  .chart-container {
    min-height: 280px;
  }

  /* Widget-riga accordion più leggibile */
  .widget-riga .widget-header {
    padding: 16px 20px;
  }

  /* ========== APPLE WEATHER STYLE - iPad Grid Layout ========== */

  /* Widget-riga-grid: 2 colonne su tablet */
  .widget-riga-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  /* Widget-riga: altezza uniforme nella griglia */
  .widget-riga-grid > .widget-riga {
    height: 100%;
    display: flex;
    flex-direction: column;
  }

  .widget-riga-grid > .widget-riga .widget-header {
    flex: 0 0 auto;
  }

  .widget-riga-grid > .widget-riga .collapse,
  .widget-riga-grid > .widget-riga .collapsing {
    flex: 1 1 auto;
  }

  /* Widget-riga espanso: chart con altezza minima */
  .widget-riga-grid > .widget-riga .collapse.show .chart-container,
  .widget-riga-grid > .widget-riga .collapsing .chart-container {
    min-height: 220px;
  }

  /* Container principale con gap aumentato */
  .view-content > .row.gx-3,
  #main-content > .row.gx-3 {
    margin-bottom: 16px;
  }

  /* Widget grid 2 colonne - gap consistente */
  .row.gx-3.widget-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .row.gx-3.widget-grid-2 > .col-6 {
	width: 100%;  
    max-width: 100%;
    flex: none;
  }

}

/* --- iPad Pro Landscape (1024px - 1400px) --- */
@media (min-width: 1024px) and (max-width: 1400px) {

  /* Container centrato per iPad Pro */
  .container-custom {
    max-width: 1100px;
    margin: 0 auto;
  }

  /* Widget-riga-grid: gap più ampio */
  .widget-riga-grid {
    gap: 20px;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Current weather centrato con max-width */
  .current-weather.today {
    max-width: 850px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 16px;
  }

  /* Forecast scroll centrato */
  .day-forecast-scroll,
  .day-hourly-scroll {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Widget grid-2: occupa tutta la larghezza disponibile su tablet */
  .row.gx-3.widget-grid-2 {
    max-width: 100%;
  }

}

/* --- DESKTOP (1280px+) --- */
@media (min-width: 1280px) {

  .container-custom {
    padding: 0 40px;
    max-width: 1600px;
  }

  /* Layout principale 3 colonne per widget piccoli */
  .row.gx-3.widget-grid-3 > .col-6,
  .row.gx-3.widget-grid-3 > .col-4 {
    flex: 0 0 calc(33.333% - 10px);
    max-width: calc(33.333% - 10px);
  }

  /* Current weather: massima espansione */
  .current-weather.today {
    padding: 32px 40px;
  }

  .current-weather .weather-svg-icon {
    width: 160px;
    height: 160px;
  }

  .current-weather .current-data .now-temp {
    font-size: 80px;
  }

  /* Forecast scroll: ancora più card visibili */
  .day-forecast-scroll {
    gap: 16px;
  }

  .day-forecast-scroll .widget.day-forecast,
  .day-forecast-scroll .widget {
    min-width: 220px;
    max-width: 240px;
  }

  /* Font size leggermente più grandi */
  body {
    font-size: 13px;
  }

  .widget-title {
    font-size: 14px;
  }

  .widget-value strong {
    font-size: 22px;
  }

}

/* --- LARGE DESKTOP (1536px+) --- */
@media (min-width: 1536px) {

  .container-custom {
    max-width: 1800px;
  }

  /* Layout 4 colonne per widget molto piccoli */
  .row.gx-3.widget-grid-4 > .col-6,
  .row.gx-3.widget-grid-4 > .col-3 {
    flex: 0 0 calc(25% - 12px);
    max-width: calc(25% - 12px);
  }

  /* Current weather: layout side-by-side ottimale */
  .current-weather.today {
    max-width: 1400px;
    margin: 0 auto;
  }

}

/* ========================================================
   OTTIMIZZAZIONI AGGIUNTIVE PER LAYOUT RESPONSIVE
   ======================================================== */

/* Tablet e Desktop: Layout intelligente widget griglia */
@media (min-width: 768px) {

  /* Row con gap responsive */
  .row.gx-3 {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 12px 0;
  }

  /* Reset margin per colonne dentro row con gap */
  .row.gx-3 > [class*="col-"] {
    margin: 0;
    padding: 0;
  }

}

@media (min-width: 1024px) {

  /* Gap più ampio su schermi grandi */
  .row.gx-3 {
    gap: 16px;
    margin: 0 0 16px 0;
  }

  /* Widget riga: mostra più info inline */
  .widget-riga .widget-data-preview {
    font-size: 15px;
  }

  .widget-riga .widget-data-preview strong {
    font-size: 18px;
  }

}

/* Desktop Large: ottimizza ulteriormente spacing */
@media (min-width: 1280px) {

  .row.gx-3 {
    gap: 20px;
    margin: 0 0 20px 0;
  }

  /* Location bar più compatta in alto */
  .location-bar {
    padding: 12px 20px;
  }

  /* Navbar bottom: considera se nascondere su desktop molto grandi */
  /* Per ora lasciamo visibile ma più compatta */
  .navbar-bottom-nav {
    padding: 8px 0;
  }

  .navbar-bottom-nav .navbar-nav {
    gap: 40px;
  }

}

/* Ottimizzazioni per scroll orizzontali su tablet/desktop */
@media (min-width: 768px) {

  /* Day forecast scroll: migliora UX touch/mouse */
  .day-forecast-scroll {
    scrollbar-width: thin;
    scrollbar-color: var(--white-30) transparent;
  }

  .day-forecast-scroll::-webkit-scrollbar {
    height: 8px;
  }

  .day-forecast-scroll::-webkit-scrollbar-track {
    background: transparent;
  }

  .day-forecast-scroll::-webkit-scrollbar-thumb {
    background: var(--white-30);
    border-radius: 4px;
  }

  .day-forecast-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--white-50);
  }

  /* Hourly list: stessa cosa */
  ul.day-hourly-list {
    scrollbar-width: thin;
    scrollbar-color: var(--white-30) transparent;
  }

  ul.day-hourly-list::-webkit-scrollbar {
    height: 8px;
  }

  ul.day-hourly-list::-webkit-scrollbar-track {
    background: transparent;
  }

  ul.day-hourly-list::-webkit-scrollbar-thumb {
    background: var(--white-30);
    border-radius: 4px;
  }

  ul.day-hourly-list::-webkit-scrollbar-thumb:hover {
    background: var(--white-50);
  }

}

/* Fix per iOS Safari su iPad: previeni bounce eccessivo */
@supports (-webkit-touch-callout: none) {
  @media (min-width: 768px) {
    .day-forecast-scroll,
    ul.day-hourly-list {
      -webkit-overflow-scrolling: touch;
    }
  }
}

/* ========================================================
   OTTIMIZZAZIONI SPECIFICHE PER iPAD
   ======================================================== */

/* iPad Portrait (768-834px) */
@media (min-width: 768px) and (max-width: 834px) {

  .container-custom {
    max-width: 100%;
    padding: 0 24px;
  }

  /* Current weather: dimensioni ottimali per iPad portrait */
  .current-weather.today {
    padding: 24px 20px;
  }

  .current-weather .weather-svg-icon {
    width: 110px;
    height: 110px;
  }

  .current-weather .current-data .now-temp {
    font-size: 56px;
  }

  .current-weather .current-data .now-desc {
    font-size: 18px;
  }

  .current-weather .current-data .now-feels {
    font-size: 14px;
  }

}

/* iPad Landscape & Tablet Landscape (1024-1194px) */
@media (min-width: 1024px) and (max-width: 1194px) and (orientation: landscape) {

  body {
    font-size: 13px;
  }

  .container-custom {
    max-width: 100%;
    padding: 0 40px;
  }

  /* Layout ottimizzato per landscape: 2 colonne per widget piccoli */
  .row.gx-3.widget-grid-2 > .col-6,
  .row.gx-3.widget-grid-2 > .col-12 {
    flex: 0 0 calc(50% - 8px);
    max-width: calc(50% - 8px);
  }

  /* Current weather: layout orizzontale compatto */
  .current-weather.today {
    padding: 20px 28px;
    max-width: 900px;
    margin: 0 auto 20px;
  }

  .current-weather .weather-svg-icon {
    width: 130px;
    height: 130px;
  }

  .current-weather .current-data .now-temp {
    font-size: 68px;
  }

  /* Widget riga: usa tutto lo spazio disponibile */
  .widget-riga {
    margin-bottom: 16px;
  }

}

/* iPad Pro 11" & 12.9" */
@media (min-width: 1024px) and (max-width: 1366px) {

  /* Ottimizza per schermi iPad Pro */
  .container-custom {
    max-width: 1200px;
  }

  /* Card forecast: dimensioni ottimali */
  .day-forecast-scroll .widget.day-forecast,
  .day-forecast-scroll .widget {
    min-width: 190px;
    max-width: 210px;
  }

}

/* ========================================================
   OTTIMIZZAZIONI PER NAVBAR SU SCHERMI GRANDI
   ======================================================== */

/* Su desktop molto grandi, considera layout navbar alternativo */
@media (min-width: 1440px) {

  /* Navbar bottom: può essere più compatta o trasformata in sidebar */
  .navbar-bottom-nav .nav-link {
    padding: 10px 20px;
  }

  .navbar-bottom-nav .nav-link i {
    font-size: 20px;
  }

  .navbar-bottom-nav .nav-link .nav-label {
    font-size: 12px;
  }

}

/* ========================================================
   MIGLIORAMENTI WIDGET SU SCHERMI GRANDI
   ======================================================== */

@media (min-width: 1024px) {

  /* Widget: padding e border radius aumentati */
  .widget {
    padding: 18px 20px;
    border-radius: 14px;
  }

  /* Widget title: più grande e leggibile */
  .widget-title {
    font-size: 15px;
    font-weight: 600;
  }

  /* Widget footer: spacing migliorato */
  .widget-footer {
    margin-top: 14px;
    padding-top: 14px;
  }

  .widget-footer .data-row {
    margin-bottom: 10px;
  }

  /* Day forecast widget: dimensioni card ottimali */
  .widget.day-forecast {
    padding: 20px;
    min-height: 240px;
  }

  .widget.day-forecast .weather-svg-icon {
    width: 80px;
    height: 80px;
    margin: 16px 0;
  }

}

@media (min-width: 1280px) {

  /* Widget ancora più spaziosi */
  .widget {
    padding: 20px 24px;
    border-radius: 16px;
  }

  .widget.day-forecast {
    padding: 24px;
    min-height: 260px;
  }

  .widget.day-forecast .weather-svg-icon {
    width: 90px;
    height: 90px;
    margin: 18px 0;
  }

}

/* ========================================================
   FIX PER CHARTS SU SCHERMI GRANDI
   ======================================================== */

@media (min-width: 1024px) {

  /* Chart container: altezza aumentata per migliore leggibilità */
  .chart-container {
    min-height: 300px;
  }

  .chart-container canvas {
    max-height: 400px;
  }

}

@media (min-width: 1280px) {

  .chart-container {
    min-height: 320px;
  }

  .chart-container canvas {
    max-height: 450px;
  }

}

/* ========================================================
   OTTIMIZZAZIONI LOCATION BAR SU TABLET/DESKTOP
   ======================================================== */

@media (min-width: 768px) {

  .location-bar {
    padding: 14px 24px;
  }

  .location-bar .location-main {
    font-size: 16px;
  }

  .location-bar .location-sub {
    font-size: 13px;
  }

}

@media (min-width: 1024px) {

  .location-bar {
    padding: 16px 32px;
    border-radius: 0 0 12px 12px;
  }

  .location-bar .location-main {
    font-size: 17px;
  }

  .location-bar .location-sub {
    font-size: 14px;
  }

}

/* ========================================================
   TRANSIZIONI SMOOTH PER RESIZE
   ======================================================== */

@media (prefers-reduced-motion: no-preference) {

  .container-custom,
  .current-weather,
  .widget,
  .row.gx-3 {
    transition: padding 0.3s ease, max-width 0.3s ease, gap 0.3s ease;
  }

  .current-weather .weather-svg-icon,
  .current-weather .current-data .now-temp {
    transition: width 0.3s ease, height 0.3s ease, font-size 0.3s ease;
  }

}

/* ========================================================
   FISHING PERIODS - COMPACT ACCORDION DESIGN
   ======================================================== */

.fishing-period {
  background: rgba(223, 223, 223, 0.12);
  border-left: 3px solid var(--period-color);
  padding: 0;
  margin-bottom: 8px;
  border-radius: 10px;
  backdrop-filter: blur(var(--ui-blur));
  -webkit-backdrop-filter: blur(var(--ui-blur));
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}

.fishing-period:hover {
  background: rgba(223, 223, 223, 0.15);
}

/* Periodo attualmente in corso - evidenziato */
.fishing-period.in-progress {
  background: rgba(223, 223, 223, 0.18);
  box-shadow: 0 0 0 1px var(--period-color),
              0 2px 8px var(--black-15);
}

.fishing-period.in-progress .fishing-period-type::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--period-color);
  border-radius: 50%;
  margin-right: 6px;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.3);
  }
}

.fishing-period-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
  transition: background 0.2s ease;
  position: relative;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  color: inherit;
  font-family: inherit;
}

.fishing-period-header:hover {
  background: var(--white-05);
}

.fishing-period-header:active {
  background: var(--white-08);
}

.fishing-period-header:focus {
  outline: none;
}

.fishing-period-header:focus-visible {
  outline: 2px solid var(--white-50);
  outline-offset: -2px;
}

/* Feedback visivo al tap su mobile */
@media (hover: none) and (pointer: coarse) {
  .fishing-period-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--white-10);
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
  }

  .fishing-period-header:active::before {
    opacity: 1;
  }
}

.fishing-period-info {
  display: flex;
  flex: 1;
  min-width: 0;
}

.fishing-period-info > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.fishing-period-type {
  font-weight: 700;
  font-size: 10px;
  color: var(--white-95);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.2;
}

.fishing-period-time {
  font-weight: 500;
  font-size: 10px;
  color: var(--white-65);
  line-height: 1.2;
}

.fishing-period-weather {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-right: 4px;
}

.fishing-period-weather img {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 1px 2px var(--black-15));
  flex-shrink: 0;
}

.fishing-period-weather-label {
  font-size: 9px;
  opacity: 0.7;
  white-space: nowrap;
  font-weight: 500;
  color: var(--white-75);
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fishing-period-badge {
  background: var(--period-color);
  color: white;
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 14px;
  min-width: 40px;
  text-align: center;
  box-shadow: var(--shadow-sm); /* FIX TASK NT-34 */
  flex-shrink: 0;
}

/* Arrow accordion icon (Bootstrap collapse) */
.fishing-period-header .arrow-accordion {
  font-size: 12px;
  transition: transform 0.2s ease;
  margin-left: 8px;
  flex-shrink: 0;
  color: var(--white-75);
}

.fishing-period-header[aria-expanded="true"] .arrow-accordion {
  transform: rotate(180deg);
}

.fishing-factors {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--white-15);
  margin-top: 0;
}

.fishing-factor-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 0;
  color: var(--white-85);
}

.fishing-factor-row i {
  opacity: 0.7;
  margin-right: 6px;
}

.fishing-factor-value {
  font-weight: 700;
  font-size: 11px;
  color: rgba(255, 255, 255, 1);
}

.fishing-factor-value.positive {
  color: #4ade80;
}

.fishing-factor-value.negative {
  color: #f87171;
}

.fishing-factor-detail {
  opacity: 0.65;
  font-size: 9px;
  margin-left: 4px;
  color: var(--white-65);
}

.fishing-factor-day-penalty {
  border-top: 1px solid var(--white-10);
  padding-top: 6px;
  margin-top: 4px;
}

.fishing-factor-day-penalty span:first-child {
  font-size: 10px;
  opacity: 0.75;
}

.fishing-factor-day-penalty .fishing-factor-value {
  font-size: 11px;
}

/* Fishing Forecast Card Styles - REDESIGNED */
.fishing-card-full {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  padding-left: 1rem;
  padding-right: 1rem;
}

.fishing-score-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
}

.fishing-score-badge-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 65px;
}

.fishing-score-badge {
  color: white;
  padding: 8px 12px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 22px;
  box-shadow: var(--shadow-md); /* FIX TASK NT-34 */
  line-height: 1;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.fishing-score-badge:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg); /* FIX TASK NT-34 */
}

.fishing-score-label {
  font-weight: 700;
  font-size: 10px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--white-85);
}

.fishing-weather-icon-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
  padding: 4px;
}

.fishing-weather-icon {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 1px 3px var(--black-20));
}

.fishing-weather-desc {
  font-size: 10px;
  text-align: center;
  color: var(--white-70);
  font-weight: 500;
}

.fishing-periods-container {
  border-top: 1px solid var(--white-15);
  padding-top: 8px;
  margin-top: 8px;
}

.fishing-periods-title {
  font-weight: 700;
  font-size: 10px;
  margin-bottom: 8px;
  color: var(--white-75);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.fishing-periods-title::before {
  content: '';
  width: 3px;
  height: 12px;
  background: linear-gradient(180deg, var(--white-50) 0%, var(--white-20) 100%);
  border-radius: 2px;
}

/* Solunar Widget Styles - REDESIGNED */
.solunar-badge {
  font-size: 9px;
  color: white;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 3px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm); /* FIX TASK NT-34 */
  text-shadow: 0 1px 3px var(--black-20);
}

/* ===== SISTEMA UNIFORME BADGE SCORE ===== */
/* Scala 1-10 gradazioni per widget solunar, previsioni e altri score */
/* Gradazione fluida: verde (ottimo) → verde-acqua → ciano → azzurro → blu (pessimo) */

/* Eccellente (9-10) - Verde smeraldo */
.badge-score-10 {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: white;
}
.text-score-10 { color: #059669; }

.badge-score-9 {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: white;
}
.text-score-9 { color: #10B981; }

/* Ottimo (7-8) - Verde */
.badge-score-8 {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
}
.text-score-8 { color: #22c55e; }

.badge-score-7 {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  color: white;
}
.text-score-7 { color: #10b981; }

/* Buono (5-6) - Verde-acqua / Turchese */
.badge-score-6 {
  background: linear-gradient(135deg, #2dd4bf 0%, #14b8a6 100%);
  color: white;
}
.text-score-6 { color: #14b8a6; }

.badge-score-5 {
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  color: white;
}
.text-score-5 { color: #0d9488; }

/* Discreto (3-4) - Ciano / Azzurro chiaro */
.badge-score-4 {
  background: linear-gradient(135deg, #22d3ee 0%, #06b6d4 100%);
  color: white;
}
.text-score-4 { color: #06b6d4; }

.badge-score-3 {
  background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
  color: white;
}
.text-score-3 { color: #0284c7; }

/* Scarso (1-2) - Azzurro / Blu */
.badge-score-2 {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}
.text-score-2 { color: #2563eb; }

.badge-score-1 {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white;
}
.text-score-1 { color: #1d4ed8; }

/* Fallback per score 0 o non valido */
.badge-score-0 {
  background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
  color: white;
}
.text-score-0 { color: #6b7280; }

/* Legacy classes (deprecated, manteniamo per retrocompatibilità) */
.solunar-badge-major {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

.solunar-badge-minor {
  background: linear-gradient(135deg, #65A30D 0%, #4d7c0f 100%);
}

/* .solunar-stars rimosso - non più utilizzato */

.solunar-status-in-progress {
  position: relative;
}

/* FIX TASK NT-35: Increased specificity, removed !important */
.data-row.solunar-status-in-progress {
  padding-left: 10px;
}

.solunar-status-in-progress::before {
  content: '';
  position: absolute;
  left: 0px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: #10B981;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.solunar-status-upcoming {
  opacity: 0.9;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }
  50% {
    opacity: 0.5;
    transform: translateY(-50%) scale(1.2);
  }
}

/* Fishing View Layout Improvements */
.fishing-view-container {
  padding-bottom: 1rem;
}

/* Widget header improvements for fishing */
.widget.day-forecast.full.fishing-card-full .widget-header {
  padding: 12px;
  border-bottom: none;
}

.widget.day-forecast.full.fishing-card-full .widget-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--white-95);
}

/* Better spacing for widget footer */
.widget.day-forecast.full.fishing-card-full .widget-footer {
  padding: 0;
}

/* Improve data rows in solunar widget - REDESIGNED */
.widget[aria-label="Widget Tabelle Solunari"] .data-row {
  padding: 8px 0;
  margin: 0;
  border-bottom: 1px solid var(--white-10);
  transition: background-color 0.15s ease;
}

.widget[aria-label="Widget Tabelle Solunari"] .data-row:last-child {
  border-bottom: none;
}

.widget[aria-label="Widget Tabelle Solunari"] .data-row:hover {
  background-color: var(--white-05);
}

/* Solunar widget chart container - REDESIGNED */
.widget[aria-label="Widget Tabelle Solunari"] .chart-container {
  margin: 10px 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
}

/* Additional fishing widget refinements */
.widget.day-forecast.full.fishing-card-full .widget-cont {
  padding: 0;
}

/* Ensure consistent star colors in fishing widgets */
.fishing-card-full .widget-value .bi-star-fill,
.fishing-card-full .widget-value .bi-star-half,
.fishing-card-full .widget-value .bi-star {
  color: #ffc107;
  text-shadow: 0 1px 2px var(--black-20);
}

/* Responsive adjustments for fishing periods */
@media (max-width: 374px) {
  .fishing-period-weather {
    gap: 4px;
  }

  .fishing-period-weather img {
    width: 20px;
    height: 20px;
  }

  .fishing-period-weather-label {
    display: none;
  }

  .fishing-period-badge {
    min-width: 36px;
    font-size: 13px;
    padding: 3px 8px;
  }

  .fishing-period-type {
    font-size: 10px;
  }
}

/* Low power mode: disable accordion animations */
html[data-power="low"] .fishing-factors,
html[data-power="low"] .fishing-period-header .arrow-accordion {
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .fishing-period-header .arrow-accordion {
    transition: none !important;
  }
}

/* Tablet/Desktop: migliora spaziatura e leggibilità */
@media (min-width: 768px) {
  .fishing-period {
    margin-bottom: 10px;
  }

  .fishing-period-header {
    padding: 12px 16px;
  }

  .fishing-period-type {
    font-size: 12px;
  }

  .fishing-period-time {
    font-size: 11px;
  }

  .fishing-period-weather img {
    width: 28px;
    height: 28px;
  }

  .fishing-period-weather-label {
    font-size: 10px;
    max-width: 80px;
  }

  .fishing-period-badge {
    font-size: 15px;
    padding: 5px 12px;
    min-width: 44px;
  }

  .fishing-factors {
    padding: 12px 16px;
    gap: 8px;
  }

  .fishing-factor-row {
    font-size: 11px;
  }

  .fishing-factor-value {
    font-size: 12px;
  }
}

@media (min-width: 1024px) {
  .fishing-period-header {
    padding: 14px 20px;
  }

  .fishing-factors {
    padding: 14px 20px;
  }
}

/* ============================================================================
   FIX TASK NT-6: Animazioni Non Ottimizzate Low-Power
   ============================================================================

   Disabilita animazioni non essenziali quando in battery-saver mode per
   ridurre consumo batteria su dispositivi mobili.

   Power-manager.js (Task NT-21) imposta automaticamente:
   - body.battery-saver class quando POWER.isLow() === true
   - html[data-power="low"] attribute

   Animazioni DISABILITATE in low-power:
   - clouds-move-* (tutte le varianti 1-80): movimento nuvole decorativo
   - starPop: animazione stelle decorativa
   - pulse, pulse-dot: pulsazioni decorative

   Animazioni MANTENUTE (essenziali per UX):
   - spin, chart-spin: loading indicators (feedback utente critico)
   - chart-skeleton-pulse: skeleton loading (feedback caricamento)
   - pwa-ios-slide-down: animazioni UI/UX critiche
   ============================================================================ */

/* Disabilita animazioni nuvole (clouds-move-*) */
body.battery-saver .weather-overlay,
html[data-power="low"] .weather-overlay,
body.battery-saver .weather-overlay-cloud,
html[data-power="low"] .weather-overlay-cloud,
body.battery-saver [class*="weather-overlay-cloud-"],
html[data-power="low"] [class*="weather-overlay-cloud-"] {
  animation: none !important;
  /* Fallback: mantieni posizione statica */
  transform: translateX(0) translateY(0) !important;
}

/* Disabilita animazione stelle */
body.battery-saver .star,
html[data-power="low"] .star {
  animation: none !important;
  opacity: 0.8 !important; /* opacità statica invece di animata */
}

/* Disabilita pulsazioni decorative */
body.battery-saver [class*="pulse"],
html[data-power="low"] [class*="pulse"] {
  animation: none !important;
}

/* Disabilita transizioni CSS pesanti in low-power */
body.battery-saver *,
html[data-power="low"] * {
  /* Riduce drasticamente duration transizioni per risparmiare GPU */
  transition-duration: 0.05s !important;
}

/* Eccezioni: mantieni transizioni normali per elementi UI critici */
body.battery-saver button,
body.battery-saver a,
body.battery-saver input,
body.battery-saver select,
body.battery-saver .btn,
body.battery-saver .nav-link,
html[data-power="low"] button,
html[data-power="low"] a,
html[data-power="low"] input,
html[data-power="low"] select,
html[data-power="low"] .btn,
html[data-power="low"] .nav-link {
  transition-duration: 0.15s !important; /* mantieni feedback UI minimo */
}

/* Mantieni esplicitamente animazioni loading (critiche per UX) */
body.battery-saver .spinner-border,
body.battery-saver [class*="spinner"],
body.battery-saver [class*="loading"],
html[data-power="low"] .spinner-border,
html[data-power="low"] [class*="spinner"],
html[data-power="low"] [class*="loading"] {
  animation: spin 1s linear infinite !important; /* ripristina spin */
}

/* Disabilita backdrop-filter (GPU-intensive) in low-power */
body.battery-saver *,
html[data-power="low"] * {
  backdrop-filter: blur(var(--ui-blur)) !important;
  -webkit-backdrop-filter: blur(var(--ui-blur)) !important;
}

/* Disabilita ombre complesse (GPU-intensive) in low-power */
body.battery-saver *,
html[data-power="low"] * {
  box-shadow: none !important;
  text-shadow: none !important;
}

/* Eccezioni: mantieni ombre minimali per UI critica (leggibilità) */
body.battery-saver .btn,
body.battery-saver .card,
body.battery-saver .modal,
html[data-power="low"] .btn,
html[data-power="low"] .card,
html[data-power="low"] .modal {
  box-shadow: var(--shadow-subtle) !important; /* FIX TASK NT-34 */
}

/* Riduce blur effects (GPU-intensive) */
body.battery-saver *,
html[data-power="low"] * {
  filter: none !important;
  -webkit-filter: none !important;
}

/* ============================================================================
   END FIX TASK NT-6
   ============================================================================ */

/* ============================================================================
   NOTIFICATION BANNER - Sistema Unificato
   ============================================================================ */

/**
 * Notification Banner
 *
 * Sistema centralizzato per tutte le notifiche:
 * - Pull-to-refresh
 * - Service worker updates
 * - Messaggi di stato
 *
 * Posizionato sopra location bar con z-index 9999
 * Colore neutro (grigio) per non distrarre
 */

.notification-banner,
.pull-to-refresh-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: rgba(60, 60, 67, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transform: translateY(-100%);
  transition: opacity 0.3s ease-out, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  box-shadow: 0 2px 12px var(--black-20);
  /* Safe-area per notch - padding simmetrico per centrare */
  padding: calc(12px + env(safe-area-inset-top)) env(safe-area-inset-right) 12px env(safe-area-inset-left);
  min-height: calc(50px + env(safe-area-inset-top));
}

/* Visible state */
.notification-banner.notification-visible,
.pull-to-refresh-indicator.ptr-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Content layout */
.notification-banner-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  /* Nessun padding aggiuntivo - gestito dal container */
}

/* Spinner Container */
.notification-spinner,
.ptr-spinner {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  position: relative;
  /* Allineamento verticale perfetto */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Circular SVG Spinner */
.notification-circular,
.ptr-circular {
  width: 100%;
  height: 100%;
  transform-origin: center;
}

.notification-path,
.ptr-path {
  stroke: white;
  stroke-linecap: round;
  stroke-dasharray: 90, 150;
  stroke-dashoffset: 0;
  transform-origin: center;
}

/* Spinner animation when active/refreshing */
.notification-spinner-active .notification-circular,
.ptr-refreshing .ptr-circular {
  animation: notification-rotate 2s linear infinite;
}

.notification-spinner-active .notification-path,
.ptr-refreshing .ptr-path {
  animation: notification-dash 1.5s ease-in-out infinite;
  stroke-dasharray: 90, 150;
}

@keyframes notification-rotate {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes notification-dash {
  0% {
    stroke-dasharray: 1, 150;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -35;
  }
  100% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -124;
  }
}

/* Backward compatibility alias */
@keyframes ptr-rotate {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes ptr-dash {
  0% {
    stroke-dasharray: 1, 150;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -35;
  }
  100% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -124;
  }
}

/* Text */
.notification-text,
.ptr-text {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  color: white;
  letter-spacing: -0.01em;
  text-align: left;
  user-select: none;
  flex: 1 1 auto;
  /* Allineamento verticale perfetto */
  align-items: center;
  justify-content: flex-start;
  margin: 0;
  padding: 0 8px;
  word-wrap: break-word;
  max-width: 100%;
}

/* Action Button */
.notification-action {
  padding: 7px 14px;
  border: none;
  border-radius: 6px;
  background: var(--white-20);
  color: white;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.2s ease;
  flex-shrink: 0;
  margin-right: 12px;
  /* Allineamento verticale */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.notification-action:hover {
  background: var(--white-30);
}

.notification-action:active {
  background: var(--white-15);
}

/* ============================================================================
   NOTIFICATION VARIANTS
   ============================================================================ */

/* Success (green) */
.notification-banner.notification-success {
  background: rgba(52, 199, 89, 0.95);
}

/* Warning (orange) */
.notification-banner.notification-warning {
  background: rgba(255, 149, 0, 0.95);
}

/* Error (red) */
.notification-banner.notification-error {
  background: rgba(255, 59, 48, 0.95);
}

/* Error view uses notification banner styling */
.error-view-container {

}

.error-view-banner {
  position: static;
  transform: none;
  opacity: 1;
  pointer-events: auto;
  border-radius: 12px;
  min-height: auto;
  padding: 12px 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.error-view-banner .notification-banner-content {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
}

.error-view-banner .notification-text {
  width: 100%;
  padding: 0;
  user-select: text;
}

.error-view-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Page container that moves with pull */
html.ptr-pulling,
html.ptr-pulling body {
  transition: transform 0.1s ease-out;
  will-change: transform;
}

/* Dark mode: stessa tonalità neutra, leggermente più scura */
@media (prefers-color-scheme: dark) {
  .notification-banner,
  .pull-to-refresh-indicator {
    background: rgba(44, 44, 46, 0.95);
  }

  .notification-banner.notification-success {
    background: rgba(48, 209, 88, 0.95);
  }

  .notification-banner.notification-warning {
    background: rgba(255, 159, 10, 0.95);
  }

  .notification-banner.notification-error {
    background: rgba(255, 69, 58, 0.95);
  }
}

/* Responsive: Ottimizzazione per schermi piccoli (iPhone) */
@media (max-width: 375px) {
  .notification-banner-content {
    flex-direction: column;
    gap: 10px;
    padding: 8px;
  }

  .notification-text,
  .ptr-text {
    font-size: 13px;
    padding: 0 4px;
  }

  .notification-action {
    padding: 6px 12px;
    font-size: 12px;
    width: 100%;
  }
}

/* Responsive: Schermi da 375px a 425px */
@media (min-width: 376px) and (max-width: 425px) {
  .notification-text,
  .ptr-text {
    font-size: 13px;
  }

  .notification-action {
    padding: 6px 12px;
    font-size: 12px;
  }
}

/* ============================================================================
   HIDE REFRESH BUTTON ON TOUCH DEVICES
   ============================================================================ */

/**
 * Hide physical refresh button when pull-to-refresh is available
 * - Only hides on touch-capable devices
 * - Keeps button visible for mouse-only devices (desktop)
 * - Uses :has-pull-to-refresh class added by JS
 */

/* Hide refresh button on devices with pull-to-refresh */
html.has-pull-to-refresh #loc-refresh-btn {
  display: none !important;
}

/* Optional: Add small hint icon showing pull gesture is available */
html.has-pull-to-refresh .location-bar::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 4px;
  background: linear-gradient(to right, transparent, rgba(66, 165, 245, 0.3), transparent);
  border-radius: 2px;
  opacity: 0.5;
  pointer-events: none;
}

/* Subtle pulse animation for the hint */
@keyframes ptr-hint-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

html.has-pull-to-refresh .location-bar::before {
  animation: ptr-hint-pulse 3s ease-in-out infinite;
}

/* Hide hint when user interacts */
html.has-pull-to-refresh .location-bar:active::before,
html.has-pull-to-refresh .location-bar:focus-within::before {
  opacity: 0;
}

/* Responsive: Ensure proper spacing without refresh button */
html.has-pull-to-refresh .location-bar .loc-actions {
  gap: 8px; /* Maintain spacing even with hidden button */
}

/* ============================================================================
   ACCESSIBILITY & REDUCED MOTION
   ============================================================================ */

/* Disable animations for reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .notification-banner,
  .pull-to-refresh-indicator,
  .notification-circular,
  .ptr-circular,
  .notification-path,
  .ptr-path {
    animation: none !important;
    transition: none !important;
  }

  html.has-pull-to-refresh .location-bar::before {
    animation: none !important;
  }
}

/* ============================================================================
   END PULL TO REFRESH
   ============================================================================ */

/* ============================================================================
   Z-INDEX HIERARCHY - Clear layering for all overlays
   ============================================================================ */

/* Critical system overlays (highest priority) */
.pull-to-refresh-indicator {
  z-index: 99999 !important; /* Highest priority - must be above all */
}

/* Chart tooltips - must be visible above everything except pull-to-refresh */
.chartjs-tooltip {
  z-index: 99995 !important;
  pointer-events: none;
}

/* Alert/Notification bars - high priority system messages */
.alert-bar,
.pwa-install-banner {
  z-index: 99990 !important;
}

.notification-banner {
  z-index: 99985 !important;
}

/* Map overlays and busy states */
.stazioni-map-overlay,
.map-busy-overlay {
  z-index: 99980 !important;
}

/* Standard UI elements - modals, dropdowns, tooltips */
.modal,
.dropdown,
.tooltip,
.popover {
  z-index: 99970 !important;
}

/* Background content layers */
.main-content,
.map-container {
  z-index: 1;
}

/* ============================================================================
   END Z-INDEX HIERARCHY
   ============================================================================ */

/* ============================================================================
   TOUCH & OVERSCROLL PROTECTION - Prevent gesture conflicts
   ============================================================================ */

/* Map area protection - prevent pull-to-refresh and scroll conflicts */
#stazioni-map {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: auto;
  touch-action: pan-x pan-y; /* Allow pan gestures on map */
}

/* Ensure all map children inherit protection */
#stazioni-map * {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: auto;
}

/* Canvas elements in charts - allow gestures but prevent conflicts */
canvas[data-chart] {
  touch-action: pan-x pan-y pinch-zoom; /* Allow all chart gestures */
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: auto;
}

/* Map and chart containers - prevent interference with page scroll */
.map-container,
.chart-container {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: auto;
}

/* Hardware acceleration for smooth rendering */
#stazioni-map,
canvas[data-chart] {
  will-change: transform;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* ============================================================================
   END TOUCH & OVERSCROLL PROTECTION
   ============================================================================ */

/* ============================================================================
   CSS TOUCH PROTECTION - Mobile UX Optimization
   ============================================================================ */

/* Global tap highlight removal for clean visual feedback */
html,
body {
  -webkit-tap-highlight-color: transparent !important;
}

/* Eliminate 300ms click delay on interactive elements */
button,
.btn,
[role="button"],
a {
  touch-action: manipulation !important;
  -ms-touch-action: manipulation !important;
}

/* Restore normal touch behavior for form elements */
input,
textarea,
select {
  touch-action: auto !important;
}

/* Intelligent user selection control */
/* Allow text selection on content elements */
p,
span:not([class*="btn"]),
div:not([role]):not([class*="btn"]),
li {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  user-select: text !important;
}

/* Ensure form inputs allow text selection and editing */
input,
textarea,
select,
[contenteditable="true"] {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  user-select: text !important;
}

/* Prevent selection on interactive elements */
button,
.btn,
[role="button"] {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  user-select: none !important;
}

/* ============================================================================
   END CSS TOUCH PROTECTION
   ============================================================================ */

/* ============================================================================
   PWA DETECTION & DISPLAY MODE - Environment-specific styles
   ============================================================================ */

/* PWA Standalone Mode - Optimizations for installed app */
@media (display-mode: standalone) {
  html,
  body {
    /* Use dynamic viewport height in PWA for better screen usage */
    height: 100dvh;
  }

  /* Ensure safe area insets are properly applied in PWA */
  .pwa-mode {
    /* PWA-specific adjustments can go here if needed */
  }
}

/* PWA Fullscreen Mode - Maximum screen usage */
@media (display-mode: fullscreen) {
  .pwa-fullscreen-mode {
    /* Fullscreen-specific styles */
  }
}

/* Utility Classes for PWA vs Browser Mode */

/* Hide elements only in PWA mode */
.web-only {
  display: block;
}

.pwa-mode .web-only {
  display: none !important;
}

/* Hide elements only in browser mode */
.pwa-only {
  display: none;
}

.pwa-mode .pwa-only {
  display: block !important;
}

/* Inline elements variants */
span.web-only,
span.pwa-only {
  display: inline;
}

.pwa-mode span.web-only {
  display: none !important;
}

.pwa-mode span.pwa-only {
  display: inline !important;
}

/* ============================================================================
   END PWA DETECTION & DISPLAY MODE
   ============================================================================ */

/* ============================================================================
   DAY FORECAST CAROUSEL - Bootstrap Carousel Integration
   ============================================================================ */

/* Carousel principale */
#dayForecastCarousel {
  position: relative;
  margin-bottom: 0.5rem;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y pinch-zoom;
}

#dayForecastCarousel:active {
  cursor: grabbing;
}

/* Carousel inner */
#dayForecastCarousel .carousel-inner {
  overflow: hidden;
  position: relative;
}

/* Carousel items - Bootstrap gestisce display/visibility */
#dayForecastCarousel .carousel-item {
  position: relative;
  display: none;
  float: left;
  width: 100%;
  margin-right: -100%;
  padding: 0;
  opacity: 1 !important;
  will-change: transform; /* Hardware acceleration */
  backface-visibility: hidden; /* Riduce flickering */
  -webkit-backface-visibility: hidden;
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#dayForecastCarousel .carousel-item.active,
#dayForecastCarousel .carousel-item-next,
#dayForecastCarousel .carousel-item-prev {
  display: block;
}

#dayForecastCarousel .carousel-item-next {
  transform: translateX(100%);
}

#dayForecastCarousel .carousel-item-prev {
  transform: translateX(-100%);
}

#dayForecastCarousel .carousel-item-next.carousel-item-start,
#dayForecastCarousel .carousel-item-prev.carousel-item-end,
#dayForecastCarousel .carousel-item.active.carousel-item-start,
#dayForecastCarousel .carousel-item.active.carousel-item-end {
  transform: translateX(0);
}

#dayForecastCarousel .carousel-item.active.carousel-item-start {
  transform: translateX(-100%);
}

#dayForecastCarousel .carousel-item.active.carousel-item-end {
  transform: translateX(100%);
}

#dayForecastCarousel .carousel-item .widget {
  margin-bottom: 5px;
}

#dayForecastCarousel .carousel-item .widget .btn-accordion .widget-cont {
  width: 100%;
}

/* Durante animazione slide - transizione più veloce e fluida */
#dayForecastCarousel .carousel-item-next,
#dayForecastCarousel .carousel-item-prev,
#dayForecastCarousel .carousel-item.active {
  opacity: 1 !important;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Easing più naturale */
}

@media (prefers-reduced-motion: reduce) {
  #dayForecastCarousel .carousel-item {
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }
}

/* Contenitore dentro carousel-item */
#dayForecastCarousel .carousel-item > .d-flex {
  width: 100%;
  gap: 15px;
}

/* Widget dentro il carousel */
#dayForecastCarousel .widget-riga {
  min-width: 100%;
  flex: 0 0 100%;
}

/* Indicatori di paginazione sotto il carousel */
#dayForecastCarousel .carousel-indicators {
  position: static !important;
  display: flex !important;
  margin: 12px 0 20px 0;
  padding: 0;
  justify-content: center;
  list-style: none;
  z-index: 2;
}

#dayForecastCarousel .carousel-indicators button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin: 0 5px;
  padding: 0;
  background-color: rgba(255, 255, 255, 0.4) !important;
  border: none !important;
  opacity: 1 !important;
  transition: all 0.25s ease;
  cursor: pointer;
  flex-shrink: 0;
}

#dayForecastCarousel .carousel-indicators button:hover {
  background-color: rgba(255, 255, 255, 0.6) !important;
  transform: scale(1.15);
}

#dayForecastCarousel .carousel-indicators button.active {
  background-color: rgba(255, 255, 255, 0.95) !important;
  transform: scale(1.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #dayForecastCarousel .carousel-indicators button {
    width: 5px;
    height: 5px;
    margin: 0 3px;
  }
}

/* ============================================================================
   END DAY FORECAST CAROUSEL
   ============================================================================ */

/* ============================================================================
   NOTIFICATIONS STYLES (merged from notifications.css)
   ============================================================================ */

/* ========== TOAST CONTAINER ========== */
.toast-container {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 420px;
  width: 100%;
  padding: 1rem;
}

.toast-container.toast-top-left {
  top: 0;
  left: 0;
}

.toast-container.toast-top-right {
  top: 0;
  right: 0;
}

.toast-container.toast-bottom-left {
  bottom: 0;
  left: 0;
}

.toast-container.toast-bottom-right {
  bottom: 0;
  right: 0;
}

/* Mobile: center bottom */
@media (max-width: 640px) {
  .toast-container {
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(var(--nav-h, 60px) + 1rem);
    max-width: calc(100vw - 2rem);
  }
}

/* ========== TOAST ========== */
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--white-95);
  backdrop-filter: blur(10px);
  border-radius: 0.75rem;
  box-shadow:
    0 4px 12px var(--black-15),
    0 0 0 1px var(--black-05);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 100%;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.hide {
  transform: translateY(20px);
  opacity: 0;
}

/* Toast Types */
.toast-info {
  border-left: 4px solid #3b82f6;
  color: #1e40af;
}

.toast-success {
  border-left: 4px solid #10b981;
  color: #065f46;
}

.toast-warning {
  border-left: 4px solid #f59e0b;
  color: #92400e;
}

.toast-error {
  border-left: 4px solid #ef4444;
  color: #991b1b;
}

.toast-offline {
  border-left: 4px solid #6b7280;
  color: #374151;
}

/* Toast Icon */
.toast-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-info .toast-icon {
  color: #3b82f6;
}
.toast-success .toast-icon {
  color: #10b981;
}
.toast-warning .toast-icon {
  color: #f59e0b;
}
.toast-error .toast-icon {
  color: #ef4444;
}
.toast-offline .toast-icon {
  color: #6b7280;
}

.toast-icon svg {
  width: 100%;
  height: 100%;
}

/* Toast Message */
.toast-message {
  flex: 1;
  font-size: 0.875rem;
  line-height: 1.5;
  font-weight: 500;
}

/* Toast Close Button */
.toast-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 0.375rem;
  font-size: 1.5rem;
  line-height: 1;
  color: currentColor;
  opacity: 0.5;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.toast-close:hover {
  opacity: 1;
  background: var(--black-05);
}

.toast-close:active {
  transform: scale(0.95);
}

/* Toast Action Button */
.toast-action {
  padding: 0.375rem 0.75rem;
  background: currentColor;
  color: white;
  border: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.toast-action:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.toast-action:active {
  transform: translateY(0);
}

/* ========== BANNER ========== */
.banners-container {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1rem;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px var(--black-10);
  transform: translateY(-100%);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.banner.top {
  border-bottom: 1px solid var(--black-05);
}

.banner.bottom {
  border-top: 1px solid var(--black-05);
  transform: translateY(100%);
}

.banner.show {
  transform: translateY(0);
  opacity: 1;
}

.banner.hide {
  transform: translateY(-20px);
  opacity: 0;
}

.banner.bottom.hide {
  transform: translateY(20px);
}

/* Banner Types */
.banner-info {
  border-left: 4px solid #3b82f6;
  color: #1e40af;
}

.banner-success {
  border-left: 4px solid #10b981;
  color: #065f46;
}

.banner-warning {
  border-left: 4px solid #f59e0b;
  color: #92400e;
}

.banner-error {
  border-left: 4px solid #ef4444;
  color: #991b1b;
}

.banner-offline {
  border-left: 4px solid #6b7280;
  color: #374151;
  background: rgba(243, 244, 246, 0.98);
}

.banner-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.banner-info .banner-icon {
  color: #3b82f6;
}
.banner-success .banner-icon {
  color: #10b981;
}
.banner-warning .banner-icon {
  color: #f59e0b;
}
.banner-error .banner-icon {
  color: #ef4444;
}
.banner-offline .banner-icon {
  color: #6b7280;
}

.banner-icon svg {
  width: 100%;
  height: 100%;
}

.banner-message {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
}

.banner-close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 0.25rem;
  font-size: 1.25rem;
  line-height: 1;
  color: currentColor;
  opacity: 0.5;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.banner-close:hover {
  opacity: 1;
  background: var(--black-05);
}

/* ========== RETRY DIALOG ========== */
.retry-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  opacity: 0;
  z-index: 10000;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-radius: 1rem;
  box-shadow:
    0 20px 25px -5px var(--black-10),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  padding: 2rem;
  max-width: 420px;
  width: calc(100vw - 2rem);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.retry-dialog.show {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.retry-dialog.hide {
  transform: translate(-50%, -50%) scale(0.9);
  opacity: 0;
}

.retry-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
}

.retry-icon svg {
  width: 100%;
  height: 100%;
}

.retry-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
  text-align: left;
  margin: 0 0 0.5rem;
}

.retry-message {
  font-size: 0.875rem;
  color: #6b7280;
  text-align: left;
  margin: 0 0 1rem;
  line-height: 1.5;
}

.retry-status {
  font-size: 0.75rem;
  color: #9ca3af;
  text-align: left;
  margin: 0 0 0.75rem;
  font-weight: 500;
}

.retry-progress {
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
  margin: 0 0 1.5rem;
}

.retry-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  width: 0;
  transition: width 0.1s linear;
}

.retry-actions {
  display: flex;
  gap: 0.75rem;
}

.retry-btn {
  flex: 1;
  padding: 0.625rem 1rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.retry-btn-primary {
  background: #3b82f6;
  color: white;
}

.retry-btn-primary:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.retry-btn-primary:active {
  transform: translateY(0);
}

.retry-btn-secondary {
  background: #f3f4f6;
  color: #374151;
}

.retry-btn-secondary:hover {
  background: #e5e7eb;
}

.retry-btn-secondary:active {
  transform: scale(0.98);
}

/* ========== ACCESSIBILITY ========== */
@media (prefers-reduced-motion: reduce) {
  .toast,
  .banner,
  .retry-dialog {
    transition: none;
  }
}

/* Dark mode support (future) */
@media (prefers-color-scheme: dark) {
  .toast,
  .banner,
  .retry-dialog {
    background: rgba(31, 41, 55, 0.95);
    color: #f9fafb;
  }

  .toast-info {
    color: #93c5fd;
  }
  .toast-success {
    color: #6ee7b7;
  }
  .toast-warning {
    color: #fcd34d;
  }
  .toast-error {
    color: #fca5a5;
  }
  .toast-offline {
    color: #d1d5db;
  }

  .banner-info {
    color: #93c5fd;
  }
  .banner-success {
    color: #6ee7b7;
  }
  .banner-warning {
    color: #fcd34d;
  }
  .banner-error {
    color: #fca5a5;
  }
  .banner-offline {
    color: #d1d5db;
    background: rgba(55, 65, 81, 0.95);
  }

  .retry-title {
    color: #f9fafb;
  }
  .retry-message {
    color: #d1d5db;
  }
  .retry-btn-secondary {
    background: #374151;
    color: #f9fafb;
  }
  .retry-btn-secondary:hover {
    background: #4b5563;
  }
}

/* ========== WEATHER GRADIENT ENGINE - PARAMETRIC OVERLAYS ========== */
/* New overlay styles for the parametric weather gradient system */

/* Water & Rain Overlays */
.weather-overlay.overlay-water_pattern {
  background-image: radial-gradient(circle at 30% 40%, rgba(200, 220, 240, 0.4) 0%, transparent 50%);
  mix-blend-mode: multiply;
}

.weather-overlay.overlay-light_drops {
  background-image: radial-gradient(circle, rgba(150, 180, 220, 0.3) 0%, transparent 60%);
  animation: rain-drift 4s ease-in-out infinite;
}

.weather-overlay.overlay-medium_drops {
  background: linear-gradient(180deg, rgba(100, 150, 200, 0.4) 0%, transparent 70%);
  animation: rain-medium 3s ease-in-out infinite;
}

.weather-overlay.overlay-heavy_sheets {
  background: linear-gradient(180deg, rgba(80, 120, 180, 0.6) 0%, rgba(60, 100, 160, 0.4) 50%, transparent 100%);
  mix-blend-mode: screen;
}

/* Snow Overlays */
.weather-overlay.overlay-snow_particles {
  background: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.4) 0%, transparent 50%),
              radial-gradient(circle at 70% 60%, var(--white-30) 0%, transparent 50%);
  animation: snow-fall 6s linear infinite;
}

/* Fog Overlays */
.weather-overlay.overlay-light_haze {
  background: radial-gradient(ellipse at 50% 0%, var(--white-20) 0%, transparent 80%);
}

.weather-overlay.overlay-thick_haze {
  background: radial-gradient(ellipse at 50% 50%, rgba(200, 200, 200, 0.3) 0%, transparent 70%);
  mix-blend-mode: soft-light;
}

.weather-overlay.overlay-dense_fog {
  background: linear-gradient(180deg, rgba(180, 180, 180, 0.5) 0%, rgba(150, 150, 150, 0.3) 50%, transparent 100%);
  mix-blend-mode: overlay;
}

.weather-overlay.overlay-fog_effect {
  background: radial-gradient(ellipse at 50% 40%, rgba(200, 200, 200, 0.25) 0%, transparent 100%);
}

/* Lightning Overlay */
.weather-overlay.overlay-lightning {
  background: transparent;
  mix-blend-mode: screen;
}

.weather-overlay.overlay-lightning.animate-lightning {
  animation: lightning-flash 0.1s ease-out;
}

/* Weather Condition Classes */
body.meteo-season-spring {
  --season-tint: rgba(138, 165, 189, 0.05);
}

body.meteo-season-summer {
  --season-tint: rgba(138, 160, 184, 0.05);
}

body.meteo-season-autumn {
  --season-tint: rgba(90, 112, 136, 0.05);
}

body.meteo-season-winter {
  --season-tint: rgba(44, 53, 61, 0.08);
}

body.meteo-weather-clear {
  --weather-filter: brightness(1.05) contrast(1.02);
}

body.meteo-weather-partly_cloudy {
  --weather-filter: brightness(0.95) contrast(1.0);
}

body.meteo-weather-cloudy {
  --weather-filter: brightness(0.90) contrast(0.98);
}

body.meteo-weather-overcast {
  --weather-filter: brightness(0.85) contrast(1.05);
}

body.meteo-weather-rain {
  --weather-filter: brightness(0.82) contrast(1.1);
}

body.meteo-weather-snow {
  --weather-filter: brightness(0.95) contrast(1.0);
}

body.meteo-weather-storm {
  --weather-filter: brightness(0.75) contrast(1.15);
}

body.meteo-weather-fog {
  --weather-filter: brightness(0.92) contrast(0.9);
}

/* Time of Day Classes */
body.meteo-time-dawn {
  --time-filter: brightness(1.0) contrast(1.05);
}

body.meteo-time-morning {
  --time-filter: brightness(1.1) contrast(1.03);
}

body.meteo-time-midday {
  --time-filter: brightness(1.15) contrast(1.05);
}

body.meteo-time-afternoon {
  --time-filter: brightness(1.05) contrast(1.02);
}

body.meteo-time-dusk {
  --time-filter: brightness(0.95) contrast(1.08);
}

body.meteo-time-night {
  --time-filter: brightness(0.70) contrast(1.1);
}

/* Environmental Factor Classes */
body.meteo-heavy-precip {
  --precip-opacity: 0.6;
}

body.meteo-foggy {
  --fog-intensity: 1;
}

body.meteo-stormy {
  --storm-intensity: 1;
  animation: storm-intensity 2s ease-in-out infinite;
}

/* Animations */
@keyframes rain-drift {
  0%, 100% {
    opacity: 0.2;
    transform: translateX(-5px);
  }
  50% {
    opacity: 0.4;
    transform: translateX(5px);
  }
}

@keyframes rain-medium {
  0%, 100% {
    opacity: 0.35;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes snow-fall {
  0% {
    transform: translateY(-100%) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

@keyframes lightning-flash {
  0% {
    opacity: 0;
    background: rgba(255, 255, 255, 0.8);
  }
  50% {
    opacity: 0.3;
  }
  100% {
    opacity: 0;
    background: transparent;
  }
}

@keyframes storm-intensity {
  0%, 100% {
    filter: brightness(1.0);
  }
  50% {
    filter: brightness(1.05);
  }
}

/* Responsive overlay sizes */
@media (max-width: 768px) {
  .weather-overlay {
    opacity: var(--precip-opacity, 0.5);
  }
}

@media (prefers-reduced-motion: reduce) {
  .weather-overlay.overlay-light_drops,
  .weather-overlay.overlay-medium_drops,
  .weather-overlay.overlay-snow_particles,
  body.meteo-stormy {
    animation: none;
  }
}

/* ============================================================================
   DYNAMIC WEATHER EFFECTS - Nuovi effetti per il sistema semplificato
   ============================================================================ */

/* Rain overlay effect - applicato su weather-gradient o weather-overlay */
body.rain-overlay .weather-overlay {
  background-image: radial-gradient(2px 2px at 20% 30%, rgba(100, 150, 200, 0.15), rgba(100, 150, 200, 0.05));
  animation: rain-drift 8s linear infinite;
}

body.rain-overlay .weather-gradient {
  filter: brightness(0.92) contrast(1.05) saturate(0.95);
}

/* Rain sound effect - può essere accompagnato da audio */
body.rain-sound {
  /* Gli audio sono gestiti via JavaScript */
}

/* Snow overlay effect */
body.snow-overlay .weather-overlay {
  background: radial-gradient(2px 2px at 20% 30%, var(--white-30), var(--white-10));
  animation: snow-fall 12s linear infinite;
}

body.snow-overlay .weather-gradient {
  filter: brightness(1.05) saturate(0.85);
}

/* Snow animation */
body.snow-animation {
  /* Animazione neve applicata */
}

/* Fog overlay effect */
body.fog-overlay {
  --fog-opacity: 0.4;
}

/* body.fog-overlay .weather-overlay {
  background: linear-gradient(180deg, rgba(200, 200, 200, 0.2), rgba(200, 200, 200, 0.15));
  backdrop-filter: blur(2px);
} */

body.fog-overlay .weather-gradient {
  filter: brightness(0.88) contrast(0.85) saturate(0.8);
}

/* Lightning flash effect - lampo istantaneo */
body.lightning-flash {
  animation: lightning-strike 0.2s ease-out 1;
}

@keyframes lightning-strike {
  0% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.8) contrast(1.3) hue-rotate(180deg);
  }
  100% {
    filter: brightness(1);
  }
}

/* Storm sound effect */
body.storm-sound {
  /* Audio gestito via JavaScript */
}

/* Special states - Alba e Tramonto */
body.meteo-special-dawn {
  --special-state-filter: contrast(1.1) saturate(1.1);
}

body.meteo-special-dusk {
  --special-state-filter: contrast(1.08) saturate(1.05);
}

/* Time of day classes */
body.meteo-time-evening {
  --time-filter: brightness(0.85) contrast(1.08);
}

/* ============================================================================
   Fine sezione DYNAMIC WEATHER EFFECTS
   ============================================================================ */
