/* =========================================================
   style.css – Design System "Salite d'Italia"
   =========================================================
   Palette: Dark navy + Accenti montagna (verde, arancione, bordeaux)
   Font: Inter (Google Fonts)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Bebas+Neue&display=swap');

/* ─── RESET & BASE ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-deep:    #020a14;
  --bg-card:    #0d1f2d;
  --bg-card2:   #0f2236;
  --bg-glass:   rgba(13,31,45,0.85);
  --border:     rgba(148,163,184,0.12);
  --border-h:   rgba(148,163,184,0.25);

  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #475569;

  --accent:    #3b82f6;
  --accent-h:  #60a5fa;
  --green:     #22c55e;
  --yellow:    #eab308;
  --orange:    #f97316;
  --red:       #ef4444;
  --bordeaux:  #800020;

  --radius:    12px;
  --radius-lg: 20px;
  --shadow:    0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.6);

  --font:      'Inter', system-ui, sans-serif;
  --font-hero: 'Bebas Neue', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-h); }

img { max-width: 100%; }

.hidden { display: none !important; }

/* ─── SCROLLBAR ─────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: #1e3a5f; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ─── NAVBAR ─────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(2,10,20,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}

.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.3rem; font-weight: 800;
  letter-spacing: -0.3px;
}
.nav-brand .brand-icon {
  display: block;
  width: 72px;
  height: 48px;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 4px;
}
.nav-brand .brand-accent { color: var(--accent); }

.nav-links {
  display: flex; align-items: center; gap: 0.25rem;
  list-style: none;
}
.nav-links a {
  color: var(--text-secondary);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text-primary); background: rgba(59,130,246,0.1); }

/* Language Selector */
.lang-selector-wrap {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.2rem 0.4rem;
  margin-left: 0.5rem;
}
.lang-selector {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  padding-right: 0.2rem;
  text-transform: uppercase;
}
.lang-selector option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.nav-admin-btn {
  background: var(--accent);
  color: #fff !important;
  padding: 0.4rem 1rem !important;
  border-radius: 8px;
  font-weight: 600 !important;
  transition: background 0.2s !important;
}
.nav-admin-btn:hover { background: var(--accent-h) !important; }

/* ─── HERO ──────────────────────────────────────── */
.hero {
  position: relative;
  padding: 5rem 2rem 4rem;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(59,130,246,0.15) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(128,0,32,0.1) 0%, transparent 60%);
}

.hero-content { position: relative; z-index: 1; max-width: 800px; margin: 0 auto; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(59,130,246,0.15);
  border: 1px solid rgba(59,130,246,0.3);
  color: var(--accent-h);
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-family: var(--font-hero);
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 0.95;
  letter-spacing: 1px;
  margin-bottom: 1rem;
}
.hero-title .accent-line { color: var(--accent); display: block; }

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 550px;
  margin: 0 auto 2.5rem;
}

/* ─── SEARCH BAR ────────────────────────────────── */
.search-bar {
  display: flex; gap: 0.5rem;
  max-width: 580px; margin: 0 auto;
  align-items: center;
}
.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  width: 100%;
}
.search-input-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  pointer-events: none;
  z-index: 2;
}
.search-input {
  flex: 1;
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.75rem 2.4rem 0.75rem 2.6rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: var(--font);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(59,130,246,0.08);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.search-clear-btn {
  position: absolute;
  right: 0.75rem;
  background: rgba(255,255,255,0.1);
  border: none;
  color: var(--text-secondary);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 2;
  transition: all 0.2s;
}
.search-clear-btn:hover {
  background: rgba(255,255,255,0.22);
  color: #fff;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.2s, transform 0.15s;
}
.btn-primary:hover { background: var(--accent-h); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

/* ─── STATS BAR ─────────────────────────────────── */
.stats-bar {
  display: flex; justify-content: center; gap: 6rem; flex-wrap: wrap;
  padding: 2.5rem 2rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to right, transparent, rgba(13,31,45,0.8), transparent);
}
.stat-item { text-align: center; }
.stat-item .sv { 
  display: block;
  font-size: 3rem; font-weight: 800; 
  color: var(--accent); 
  line-height: 1;
  margin-bottom: 0.5rem;
}
.stat-item .sl { 
  display: block;
  font-size: 0.85rem; color: var(--text-muted); 
  text-transform: uppercase; letter-spacing: 0.1em; 
}

/* ─── MAP SECTION ───────────────────────────────── */
.map-section { padding: 3rem 2rem 2rem; }
.section-title {
  font-size: 1.5rem; font-weight: 700;
  margin-bottom: 1rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.section-title .icon { font-size: 1.2rem; }

#map-catalogo {
  height: 450px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* ─── CATALOG SECTION ───────────────────────────── */
.catalog-section {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  scroll-margin-top: 80px;
}

.catalog-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ─── CATALOG TOOLBAR (Search & Filters toggle) ─── */
.catalog-toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.catalog-search-wrap {
  flex: 1;
}

.catalog-search-input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.65rem 2.4rem 0.65rem 2.6rem;
  font-size: 0.92rem;
}

.catalog-search-input:focus {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.08);
}

.btn-filter-toggle {
  display: none; /* Visibile su mobile/tablet */
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.65rem 1rem;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  min-height: 44px;
}

.btn-filter-toggle:hover,
.btn-filter-toggle.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(59, 130, 246, 0.1);
}

.btn-filter-toggle.has-active {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent);
}

.filter-badge {
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  line-height: 1;
}

/* ─── ACTIVE FILTER CHIPS ───────────────────────── */
.active-chips-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.25rem;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--accent);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
}

.filter-chip button {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  margin-left: 2px;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.filter-chip button:hover {
  color: #fff;
}

.chip-clear-all {
  background: none;
  border: none;
  color: var(--text-muted);
  text-decoration: underline;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  margin-left: 0.25rem;
}

.chip-clear-all:hover {
  color: var(--text-primary);
}

/* ─── FILTRI ────────────────────────────────────── */
.filters-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  height: fit-content;
  position: sticky;
  top: 80px;
}

.filters-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.filters-panel-header .filters-title {
  margin-bottom: 0;
}

.btn-filters-close {
  display: none;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-filters-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.filters-title {
  font-size: 0.85rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted);
}

.filter-group { margin-bottom: 1.25rem; }
.filter-label {
  display: block;
  font-size: 0.82rem; font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}
.filter-select,
.filter-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.88rem;
  transition: border-color 0.2s;
}
.filter-select:focus,
.filter-input:focus { outline: none; border-color: var(--accent); }
.filter-select option { background: var(--bg-card); }

.filter-range-row { display: flex; gap: 0.5rem; align-items: center; }
.filter-range-row .filter-input { flex: 1; }
.filter-range-sep { color: var(--text-muted); font-size: 0.85rem; }

.btn-reset {
  width: 100%; margin-top: 0.5rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.5rem;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-reset:hover { border-color: var(--border-h); color: var(--text-primary); }

/* ─── CATALOG GRID ──────────────────────────────── */
.catalog-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.25rem;
}
.catalog-count { color: var(--text-secondary); font-size: 0.9rem; }

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

/* ─── SALITA CARD ───────────────────────────────── */
.salita-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.salita-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-h);
  box-shadow: var(--shadow-lg);
}

.card-gradient {
  height: 130px;
  position: relative;
  overflow: hidden;
}
.card-gradient.gradient-easy     { background: linear-gradient(135deg,#0f4c2a 0%,#166534 50%,#15803d 100%); }
.card-gradient.gradient-medium   { background: linear-gradient(135deg,#422006 0%,#78350f 50%,#92400e 100%); }
.card-gradient.gradient-hard     { background: linear-gradient(135deg,#431407 0%,#7c2d12 50%,#9a3412 100%); }
.card-gradient.gradient-very-hard{ background: linear-gradient(135deg,#450a0a 0%,#7f1d1d 50%,#991b1b 100%); }
.card-gradient.gradient-extreme  { background: linear-gradient(135deg,#2a0010 0%,#600018 50%,#800020 100%); }

.card-gradient-overlay {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent 0px 10px,
    rgba(255,255,255,0.03) 10px 12px
  );
  z-index: 1;
}

.salita-card.has-image .card-gradient-overlay {
  background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.6) 100%);
}

.salita-card.has-image .card-gradient-label {
  color: rgba(255,255,255,0.6);
  z-index: 2;
}

.salita-card.has-image .card-difficulty {
  z-index: 2;
}

.card-gradient-label {
  position: absolute; bottom: 0.75rem; right: 0.75rem;
  font-family: var(--font-hero);
  font-size: 1.8rem;
  color: rgba(255,255,255,0.15);
  letter-spacing: 1px;
  line-height: 1;
}

.card-difficulty {
  position: absolute; top: 0.75rem; left: 0.75rem;
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  backdrop-filter: blur(8px);
}
.diff-easy      { background: rgba(34,197,94,0.25);  color: #86efac; }
.diff-medium    { background: rgba(234,179,8,0.25);  color: #fde047; }
.diff-hard      { background: rgba(249,115,22,0.25); color: #fdba74; }
.diff-very-hard { background: rgba(239,68,68,0.25);  color: #fca5a5; }
.diff-extreme   { background: rgba(128,0,32,0.35);   color: #fda4af; }

.card-body { padding: 1.1rem; }
.card-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-subtitle { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.card-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
}
.card-stat { text-align: center; }
.cs-val { display: block; font-size: 0.92rem; font-weight: 700; color: var(--text-primary); }
.cs-lbl { display: block; font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }

.card-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.6rem 1.1rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem; color: var(--text-muted);
}
.card-tags { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.tag {
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.2);
  color: var(--accent-h);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 500;
}

/* ─── LEAFLET CUSTOM POPUP ──────────────────────── */
.custom-popup .leaflet-popup-content-wrapper {
  background: var(--bg-card2) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-lg) !important;
  padding: 0 !important;
}
.custom-popup .leaflet-popup-tip-container { display: none; }
.custom-popup .leaflet-popup-content { margin: 0 !important; width: auto !important; }

.popup-card { padding: 1rem; min-width: 220px; }
.popup-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.4rem; }
.popup-header strong { font-size: 0.95rem; color: var(--text-primary); }
.popup-badge { font-size: 0.65rem; font-weight: 700; padding: 0.2rem 0.5rem; border-radius: 4px; white-space: nowrap; }
.popup-meta { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.8rem; }
.popup-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 0.4rem; margin-bottom: 0.8rem; }
.popup-stats .stat { text-align: center; }
.popup-stats .stat-val { display: block; font-size: 0.88rem; font-weight: 700; color: var(--text-primary); }
.popup-stats .stat-lbl { display: block; font-size: 0.6rem; color: var(--text-muted); text-transform: uppercase; }
.popup-btn {
  display: block; text-align: center;
  background: var(--accent); color: #fff;
  padding: 0.5rem; border-radius: 8px;
  font-size: 0.82rem; font-weight: 600;
  transition: background 0.2s;
}
.popup-btn:hover { background: var(--accent-h); color: #fff; }
.difficulty-estrema { background: rgba(128,0,32,0.3); color: #fda4af; }
.difficulty-molto { background: rgba(239,68,68,0.25); color: #fca5a5; }
.difficulty-difficile { background: rgba(249,115,22,0.25); color: #fdba74; }
.difficulty-medio { background: rgba(234,179,8,0.25); color: #fde047; }
.difficulty-facile { background: rgba(34,197,94,0.25); color: #86efac; }

/* ─── DETAIL PAGE ───────────────────────────────── */
.detail-hero {
  padding: 3rem 2rem 2rem;
  max-width: 1200px; margin: 0 auto;
}
.breadcrumb { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 1rem; }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { margin: 0 0.4rem; }

.detail-title { font-family: var(--font-hero); font-size: clamp(2.5rem,6vw,5rem); line-height: 0.9; letter-spacing: 0.5px; margin-bottom: 0.5rem; }
.detail-subtitle { font-size: 1rem; color: var(--text-secondary); margin-bottom: 1.5rem; }

/* ─── BOTTONI CONDIVISIONE & AZIONI ─────────────── */
.btn-share {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: var(--accent);
  padding: 0.45rem 1.05rem;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  min-height: 38px;
}
.btn-share:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
.btn-share:active {
  transform: translateY(0);
}
.btn-share .share-icon {
  font-size: 0.95rem;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-secondary:hover {
  border-color: var(--border-h);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

/* ─── MODALE CONDIVISIONE ───────────────────────── */
.share-modal {
  position: fixed;
  inset: 0;
  z-index: 3100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.share-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 10, 20, 0.82);
  backdrop-filter: blur(5px);
}
.share-modal-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-h);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem 1.5rem;
  box-shadow: var(--shadow-lg);
  animation: coffeeIn 0.25s ease-out;
}
.share-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}
.share-modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}
.share-modal-header {
  text-align: center;
  margin-bottom: 1.25rem;
}
.share-modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}
.share-modal-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
}
.share-buttons-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}
.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}
.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.share-btn-wa:hover {
  background: #25d366;
  border-color: #25d366;
  color: #fff;
}
.share-btn-tg:hover {
  background: #0088cc;
  border-color: #0088cc;
  color: #fff;
}
.share-btn-fb:hover {
  background: #1877f2;
  border-color: #1877f2;
  color: #fff;
}
.share-btn-tw:hover {
  background: #000;
  border-color: #475569;
  color: #fff;
}
.share-copy-box {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
}
.share-copy-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8rem;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  outline: none;
}
.share-copy-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.share-copy-btn:hover {
  background: var(--accent-h);
}
.share-copy-btn.copied {
  background: #10b981;
}

.scheda-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.scheda-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  transition: border-color 0.2s;
}
.scheda-item:hover { border-color: var(--border-h); }
.scheda-icon  { font-size: 1.4rem; margin-bottom: 0.3rem; }
.scheda-val   { font-size: 1.4rem; font-weight: 800; color: var(--text-primary); display: block; }
.scheda-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.detail-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto 3rem;
  padding: 0 2rem;
}
@media (max-width: 800px) { .detail-content { grid-template-columns: 1fr; } }

.detail-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.panel-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: 0.9rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.panel-body { padding: 1.25rem; }

#map-dettaglio { height: 350px; }

.chart-container { position: relative; height: 280px; }

/* Legenda colori pendenza */
.slope-legend {
  display: flex; flex-wrap: wrap; gap: 0.6rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
}
.legenda-item {
  display: flex; align-items: center; gap: 0.35rem;
  font-size: 0.72rem; color: var(--text-secondary);
}
.legenda-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Descrizione */
.descrizione-panel {
  max-width: 1200px; margin: 0 auto 3rem;
  padding: 0 2rem;
}
.gpx-download-section {
  max-width: 1200px;
  margin: 0 auto 2.75rem;
  padding: 0 2rem;
}
.gpx-download-card {
  position: relative;
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  gap: 1.2rem;
  padding: clamp(1.2rem, 3vw, 1.8rem);
  overflow: hidden;
  border: 1px solid rgba(96,165,250,0.22);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(ellipse at 100% 0%, rgba(59,130,246,0.12), transparent 48%),
    linear-gradient(135deg, var(--bg-card), #0a1926);
  box-shadow: var(--shadow);
}
.gpx-download-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent-h), rgba(96,165,250,0.12));
}
.gpx-download-symbol {
  width: 3.5rem;
  height: 3.5rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(96,165,250,0.25);
  border-radius: 16px;
  background: rgba(59,130,246,0.12);
  color: #bfdbfe;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.gpx-download-content { min-width: 0; }
.gpx-download-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.gpx-download-eyebrow {
  color: var(--accent-h);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.13em;
}
.gpx-download-price {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
}
.gpx-download-price strong {
  color: var(--text-primary);
  font-size: 1rem;
}
.gpx-download-title {
  margin: 0.25rem 0 0.35rem;
  color: var(--text-primary);
  font-size: 1.18rem;
  line-height: 1.35;
  letter-spacing: -0.02em;
}
.gpx-download-message {
  max-width: 720px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.6;
}
.gpx-download-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1rem;
}
.gpx-pay-link,
.gpx-confirm-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.68rem 1rem;
  border-radius: 11px;
  font: 700 0.84rem/1.2 var(--font);
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}
.gpx-pay-link {
  border: 1px solid rgba(96,165,250,0.32);
  background: #1268a9;
  color: #fff;
  text-decoration: none;
}
.gpx-pay-link:hover {
  background: #1680c8;
  color: #fff;
  transform: translateY(-1px);
}
.gpx-confirm-button {
  border: 1px solid rgba(34,197,94,0.3);
  background: rgba(34,197,94,0.12);
  color: #bbf7d0;
  cursor: pointer;
}
.gpx-confirm-button:hover {
  background: rgba(34,197,94,0.2);
  border-color: rgba(34,197,94,0.5);
  transform: translateY(-1px);
}
.gpx-download-note {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  max-width: 680px;
  margin-top: 0.85rem;
  color: var(--text-secondary);
  font-size: 0.73rem;
  line-height: 1.5;
}
.gpx-download-note > span:first-child { color: var(--accent-h); }
.descrizione-panel .detail-panel { padding: 1.5rem; position: relative; }
.desc-text {
  color: var(--text-secondary);
  line-height: 1.75;
  position: relative;
  max-height: 180px; /* Circa 6-7 righe */
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: pre-line;
}
.desc-text.expanded {
  max-height: 5000px;
}
.desc-fade {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 80px;
  background: linear-gradient(to top, var(--bg-card), transparent);
  pointer-events: none;
  transition: opacity 0.3s;
}
.desc-text.expanded .desc-fade { opacity: 0; }

.btn-expand-desc {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.2);
  color: var(--accent-h);
  padding: 0.45rem 1.2rem;
  border-radius: 99px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-expand-desc:hover { background: rgba(59,130,246,0.2); border-color: var(--accent); }

.desc-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 1.5rem; border-top: 1px solid var(--border); padding-top: 1.25rem; }

/* ─── LOGIN PAGE ────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
  background:
    radial-gradient(ellipse 60% 50% at 30% 30%, rgba(59,130,246,0.1) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 70% 70%, rgba(128,0,32,0.08) 0%, transparent 60%),
    var(--bg-deep);
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo .logo-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.login-logo h1 { font-size: 1.4rem; font-weight: 800; }
.login-logo p  { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; }

.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.4rem; }
.form-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 0.95rem;
  transition: border-color 0.2s, background 0.2s;
}
.form-input:focus { outline: none; border-color: var(--accent); background: rgba(59,130,246,0.05); }

.btn-login {
  width: 100%;
  background: var(--accent);
  color: #fff; border: none;
  padding: 0.85rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  margin-top: 0.5rem;
}
.btn-login:hover { background: var(--accent-h); transform: translateY(-1px); }

.login-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-top: 1rem;
}

/* Avviso informativo (es. modalità locale senza Firebase) */
.login-notice {
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.3);
  color: #93c5fd;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

/* ─── ADMIN PANEL ───────────────────────────────── */
.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 64px);
}
@media (max-width: 900px) { .admin-layout { grid-template-columns: 1fr; } }

.admin-sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
}
.sidebar-user {
  padding: 0.75rem 0.75rem 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-user .user-role { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.sidebar-user .user-email { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); margin-top: 0.2rem; word-break: break-all; }

.sidebar-nav { list-style: none; }
.sidebar-nav li a,
.sidebar-nav li button {
  display: flex; align-items: center; gap: 0.6rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  background: none; border: none;
  cursor: pointer; font-family: var(--font);
  transition: all 0.2s; text-align: left;
}
.sidebar-nav li a:hover,
.sidebar-nav li button:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.sidebar-nav li a.active { background: rgba(59,130,246,0.12); color: var(--accent-h); }
.sidebar-nav .nav-icon { font-size: 1rem; }
.sidebar-nav .danger { color: var(--red) !important; }

.admin-main { padding: 2rem; overflow-y: auto; }

.admin-section { margin-bottom: 2.5rem; }
.admin-section-title {
  font-size: 1.2rem; font-weight: 700;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 0.5rem;
}

/* GPX Drop Zone */
.gpx-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  background: rgba(255,255,255,0.02);
}
.gpx-drop-zone:hover,
.gpx-drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(59,130,246,0.05);
}
.gpx-drop-icon { font-size: 3rem; margin-bottom: 0.75rem; }
.gpx-drop-text { font-size: 1rem; font-weight: 600; margin-bottom: 0.4rem; }
.gpx-drop-hint { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 1rem; }
.btn-file {
  display: inline-block;
  background: rgba(59,130,246,0.12);
  border: 1px solid rgba(59,130,246,0.3);
  color: var(--accent-h);
  padding: 0.5rem 1.2rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-file:hover { background: rgba(59,130,246,0.2); }
.gpx-filename { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.5rem; }

/* --- Admin Image Upload --- */
.image-upload-container {
  background: rgba(15, 23, 42, 0.3);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 0.5rem;
}
.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.image-preview-item {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.image-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: transform 0.2s;
}
.image-remove-btn:hover {
  transform: scale(1.1);
}
.image-upload-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}
.image-preview-grid:empty {
  display: none;
}
.image-preview-grid:not(:empty) + .image-upload-actions {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

/* Metriche preview */
.metriche-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.metric-box {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  text-align: center;
}
.metric-val { font-size: 1.2rem; font-weight: 800; color: var(--accent); display: block; }
.metric-lbl { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }

.preview-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 700px) { .preview-charts { grid-template-columns: 1fr; } }

.preview-panel {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.preview-panel-title {
  padding: 0.6rem 0.9rem;
  font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.preview-chart-wrap { height: 200px; padding: 0.5rem; position: relative; }
#map-preview { height: 200px; }

/* Sorgente percorso: selettore modalità GPX / manuale */
.mode-toggle {
  display: flex; flex-wrap: wrap; gap: 0.6rem;
  margin-bottom: 1rem;
}
.mode-option {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card2);
  font-size: 0.85rem; font-weight: 500; color: var(--text-secondary);
  cursor: pointer; user-select: none;
  transition: all 0.2s;
}
.mode-option:hover { border-color: var(--border-h); color: var(--text-primary); }
.mode-option input { accent-color: var(--accent); cursor: pointer; }
.mode-option:has(input:checked) {
  border-color: var(--accent);
  background: rgba(59,130,246,0.08);
  color: var(--text-primary);
}

.manual-hint {
  font-size: 0.85rem; line-height: 1.6;
  color: var(--text-secondary); margin-bottom: 0.9rem;
}
#map-manuale {
  height: 420px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.manual-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem;
  margin-top: 0.9rem;
}
.manual-actions button:disabled { opacity: 0.5; cursor: not-allowed; }
.manual-count {
  margin-left: auto;
  font-size: 0.8rem; color: var(--text-muted);
}

/* Form salita */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }

.form-full { grid-column: 1 / -1; }

.admin-input, .admin-select, .admin-textarea {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.9rem;
  transition: border-color 0.2s, background 0.2s;
}
.admin-input:focus,
.admin-select:focus,
.admin-textarea:focus { outline: none; border-color: var(--accent); background: rgba(59,130,246,0.04); }
.admin-textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.admin-textarea-lg { min-height: 260px; font-size: 1rem; line-height: 1.7; }
.admin-select option { background: var(--bg-card); }
.admin-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.35rem; }

.form-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.25rem; }
.btn-save {
  background: var(--green);
  color: #fff; border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  font-weight: 700; font-size: 0.9rem;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.btn-save:hover { background: #16a34a; transform: translateY(-1px); }
.btn-cancel {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-cancel:hover { border-color: var(--border-h); color: var(--text-primary); }

/* Tabella salite */
.table-wrapper { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.admin-table th {
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.admin-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(148,163,184,0.06);
  vertical-align: middle;
}
.admin-table tr:hover td { background: rgba(255,255,255,0.02); }
.table-loading, .table-empty, .table-error { text-align: center; color: var(--text-muted); padding: 2rem !important; }
.table-error { color: #fca5a5; }

.table-actions { display: flex; gap: 0.4rem; }
.btn-edit, .btn-delete, .btn-share {
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  border: 1px solid transparent;
  transition: all 0.2s;
}
.btn-share  { background: rgba(59,130,246,0.1);  border-color: rgba(59,130,246,0.2);  color: var(--accent-h); }
.btn-share:hover { background: rgba(59,130,246,0.2); }
.btn-edit   { background: rgba(59,130,246,0.1);  border-color: rgba(59,130,246,0.2);  color: var(--accent-h); }
.btn-edit:hover { background: rgba(59,130,246,0.2); }
.btn-delete { background: rgba(239,68,68,0.1);   border-color: rgba(239,68,68,0.2);   color: #fca5a5; }
.btn-delete:hover { background: rgba(239,68,68,0.2); }

/* Badge difficoltà tabella */
.badge-difficolta { font-size: 0.7rem; font-weight: 700; padding: 0.2rem 0.55rem; border-radius: 5px; }
.badge-difficolta.easy      { background:rgba(34,197,94,0.15); color:#86efac; }
.badge-difficolta.medium    { background:rgba(234,179,8,0.15); color:#fde047; }
.badge-difficolta.hard      { background:rgba(249,115,22,0.15);color:#fdba74; }
.badge-difficolta.very-hard { background:rgba(239,68,68,0.15); color:#fca5a5; }
.badge-difficolta.extreme   { background:rgba(128,0,32,0.25);  color:#fda4af; }

/* Alert box */
.alert-box {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 1rem;
  transition: opacity 0.3s;
}
.alert-success { background:rgba(34,197,94,0.12); border:1px solid rgba(34,197,94,0.3); color:#86efac; }
.alert-error   { background:rgba(239,68,68,0.12); border:1px solid rgba(239,68,68,0.3); color:#fca5a5; }
.alert-info    { background:rgba(59,130,246,0.12);border:1px solid rgba(59,130,246,0.3);color:#93c5fd; }

/* Loading overlay */
.loading-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(2,10,20,0.85);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.loading-spinner {
  width: 48px; height: 48px;
  border: 3px solid rgba(59,130,246,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1rem;
}
.loading-msg { color: var(--text-secondary); font-size: 0.9rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── INDICE SALITE (SEO / accessibilità) ───────── */
.salite-index {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 0.5rem;
}
.salite-index-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.salite-index-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.3rem 1.75rem;
}
.salite-index-list a {
  display: inline-block;
  padding: 0.15rem 0;
  font-size: 0.83rem;
  color: var(--text-muted);
}
.salite-index-list a:hover { color: var(--accent-h); }

/* ─── FOOTER ────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: auto;
}
.footer a { color: var(--text-secondary); }

/* ─── EMPTY STATE ───────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}
.empty-icon { font-size: 4rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-title { font-size: 1.1rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.5rem; }
.empty-hint  { font-size: 0.85rem; }

/* ─── ANIMAZIONI ────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeInUp 0.4s ease both; }

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}

/* ─── ANIMAZIONE APERTURA FILTRI ────────────────── */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── RESPONSIVE ────────────────────────────────── */
@media (max-width: 900px) {
  .catalog-section {
    grid-template-columns: 1fr;
    padding: 1.5rem 1.25rem;
    gap: 1rem;
  }
  .catalog-toolbar {
    position: sticky;
    top: 64px;
    z-index: 900;
    background: rgba(2, 10, 20, 0.95);
    backdrop-filter: blur(14px);
    padding: 0.75rem 0;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .btn-filter-toggle {
    display: inline-flex;
  }
  .filters-panel {
    display: none;
    position: static;
    top: auto;
    margin-bottom: 1.25rem;
    border-color: rgba(59, 130, 246, 0.3);
  }
  .filters-panel.open {
    display: block;
    animation: fadeInDown 0.22s ease-out;
  }
  .btn-filters-close {
    display: inline-flex;
  }
}

@media (max-width: 768px) {
  #map-catalogo {
    height: 290px;
    border-radius: var(--radius-md);
  }
  .map-section {
    padding: 2rem 1.25rem 0.75rem;
  }
  .section-title {
    font-size: 1.3rem;
  }
  .stats-bar {
    gap: 2.5rem;
    padding: 1.25rem 1rem;
  }
  .stat-item .sv {
    font-size: 2.2rem;
  }
}

@media (max-width: 600px) {
  .navbar { padding: 0 0.85rem; }
  .hero { padding: 2.75rem 1rem 2rem; }
  .hero-badge { font-size: 0.78rem; padding: 0.25rem 0.75rem; margin-bottom: 0.75rem; }
  .hero-title { font-size: clamp(2.3rem, 11vw, 3.8rem); line-height: 0.95; margin-bottom: 0.75rem; }
  .hero-subtitle { font-size: 0.92rem; line-height: 1.5; margin-bottom: 1.25rem; }
  .hero-search-bar { gap: 0.5rem; }
  .map-section, .catalog-section { padding: 1.25rem 0.85rem; }
  #map-catalogo { height: 260px; }
  .stats-bar {
    gap: 1.75rem;
    padding: 1rem 0.75rem;
  }
  .stat-item .sv {
    font-size: 1.85rem;
    margin-bottom: 0.2rem;
  }
  .stat-item .sl {
    font-size: 0.72rem;
  }
  .catalog-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .catalog-header {
    margin-bottom: 0.85rem;
  }
  .detail-hero { padding: 2rem 1rem 1.5rem; }
  .detail-content, .descrizione-panel { padding: 0 0.85rem; }
  .admin-main { padding: 1.25rem; }
  .scheda-grid { grid-template-columns: repeat(3, 1fr); gap: 0.65rem; }
  .scheda-item { padding: 0.75rem 0.5rem; }
  .scheda-val { font-size: 1.05rem; }
  /* iOS font-size >= 16px to prevent automatic zooming on input focus */
  .search-input,
  .filter-input,
  .filter-select {
    font-size: 16px !important;
  }
}

@media (max-width: 480px) {
  .nav-brand { font-size: 1.15rem; gap: 6px; }
  .nav-brand .brand-icon { width: 54px; height: 36px; }
  .nav-links { gap: 0.15rem; }
  .nav-links a { padding: 0.3rem 0.5rem; font-size: 0.8rem; }
  .lang-selector-wrap { padding: 0.15rem 0.3rem; margin-left: 0.15rem; }
  .lang-selector { font-size: 0.7rem; }
  .nav-admin-btn { padding: 0.3rem 0.65rem !important; font-size: 0.8rem !important; }
  .btn-filter-toggle { padding: 0.6rem 0.85rem; font-size: 0.82rem; }
  .scheda-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .card-stats { gap: 0.5rem; font-size: 0.75rem; }
}

/* ─── PAGAMI UN CAFFÈ ───────────────────────────── */
.coffee-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-h);
  border-radius: 999px;
  padding: 0.6rem 1.1rem;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}
.coffee-fab:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--bg-card2);
}
.coffee-fab-icon { font-size: 1.05rem; }

.coffee-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.coffee-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2,10,20,0.75);
  backdrop-filter: blur(3px);
}
.coffee-modal-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-h);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem 1.5rem;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: coffeeIn 0.25s ease-out;
}
@keyframes coffeeIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.coffee-modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.coffee-modal-close:hover { background: rgba(255,255,255,0.12); color: var(--text-primary); }

.coffee-modal-icon   { font-size: 2.5rem; line-height: 1; }
.coffee-modal-title  { font-size: 1.2rem; font-weight: 700; margin: 0.5rem 0 0.5rem; }
.coffee-modal-message {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.coffee-presets-label,
.coffee-free-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 1.1rem 0 0.5rem;
}
.coffee-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}
.coffee-preset-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.coffee-preset-btn:hover { border-color: var(--accent); color: var(--accent-h); }
.coffee-preset-btn.selected {
  background: rgba(59,130,246,0.18);
  border-color: var(--accent);
  color: var(--accent-h);
}

.coffee-free-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.15rem 0.9rem;
  transition: border-color 0.2s;
}
.coffee-free-row:focus-within { border-color: var(--accent); }
.coffee-free-symbol { font-weight: 700; color: var(--text-secondary); }
.coffee-free-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.55rem 0;
  text-align: center;
}
.coffee-free-input::-webkit-outer-spin-button,
.coffee-free-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.coffee-free-input { -moz-appearance: textfield; }

.coffee-error { color: var(--red); font-size: 0.78rem; margin-top: 0.6rem; }

.coffee-pay-btn {
  width: 100%;
  margin-top: 1.1rem;
  background: #0070ba;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1.25rem;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.coffee-pay-btn:hover { background: #005c99; transform: translateY(-1px); }
.coffee-secure {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  line-height: 1.5;
}

@media (max-width: 480px) {
  .coffee-fab-text { display: none; }
  .coffee-fab { padding: 0.75rem; border-radius: 50%; }
  .coffee-fab-icon { font-size: 1.25rem; }
  .gpx-download-section { padding: 0 0.85rem; }
  .gpx-download-card { grid-template-columns: 2.7rem minmax(0, 1fr); gap: 0.85rem; }
  .gpx-download-symbol { width: 2.7rem; height: 2.7rem; border-radius: 13px; font-size: 0.68rem; }
  .gpx-download-topline { align-items: flex-start; }
  .gpx-download-eyebrow { font-size: 0.6rem; }
  .gpx-download-price { gap: 0.2rem; font-size: 0.65rem; }
  .gpx-download-price strong { font-size: 0.9rem; }
  .gpx-download-title { font-size: 1.05rem; }
  .gpx-download-actions { align-items: stretch; flex-direction: column; }
  .gpx-pay-link, .gpx-confirm-button { width: 100%; }
}

/* ─── MAPPA FULLSCREEN ──────────────────────────── */
.map-fullscreen-container {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  width: 100vw !important;
  height: 100vh !important;
  border-radius: 0 !important;
  margin: 0 !important;
}

.leaflet-control-fullscreen-btn {
  background: var(--bg-card) !important;
  border: 2px solid rgba(255,255,255,0.2) !important;
  border-radius: 4px !important;
  width: 34px !important;
  height: 34px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  font-size: 1.1rem !important;
  color: var(--text-primary) !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3) !important;
  transition: all 0.2s;
}
.leaflet-control-fullscreen-btn:hover {
  background: var(--bg-card2) !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}
.leaflet-control-fullscreen-btn.active {
  color: var(--accent);
  border-color: var(--accent);
}

/* ─── MANUTENZIONE ──────────────────────────────── */
.maintenance-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.maintenance-icon {
  font-size: 5rem;
  margin-bottom: 1.5rem;
  animation: pulse 2s infinite;
}

.maintenance-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.maintenance-message {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 500px;
  line-height: 1.6;
}

.maintenance-admin-hint {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--red);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  z-index: 10000;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 0.8; }
}
