/* ============================================================
   P.Map — Design System
   Palette: Bianco (#fff), Nero (#000), Accento (#48bbb6)
   Font: Inter (Google Fonts)
   ============================================================ */

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

/* ─── CSS VARIABLES ─────────────────────────────────────── */
:root {
  --accent:      #48bbb6;
  --accent-dark: #35a09b;
  --accent-glow: rgba(72, 187, 182, 0.25);
  --black:       #000000;
  --black-2:     #0d0d0d;
  --black-3:     #1a1a1a;
  --black-4:     #272727;
  --gray:        #666666;
  --gray-light:  #aaaaaa;
  --white:       #ffffff;
  --white-dim:   rgba(255,255,255,0.07);
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --radius-xl:   32px;
  --shadow:      0 8px 32px rgba(0,0,0,0.5);
  --shadow-accent: 0 0 24px var(--accent-glow);
  --transition:  0.2s cubic-bezier(0.4,0,0.2,1);
}

/* ─── RESET ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; height: 100dvh; overflow: hidden; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--black);
  color: var(--white);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font-family: inherit; }
img { display: block; max-width: 100%; }

/* ─── LAYOUT ROOT ───────────────────────────────────────── */
#app {
  display: flex;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  position: relative;
}

/* ─── MAP CONTAINER ─────────────────────────────────────── */
#map {
  flex: 1;
  height: 100%;
  position: relative;
}

/* ─── TOPBAR ────────────────────────────────────────────── */
#topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.85) 0%, transparent 100%);
  pointer-events: none;
}
#topbar > * { pointer-events: all; }

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.logo-img {
  height: 32px;
  width: auto;
  display: block;
}

.topbar-search {
  flex: 1;
  max-width: 440px;
  position: relative;
}
.topbar-search input {
  width: 100%;
  height: 44px;
  background: rgba(0,0,0,0.75);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-xl);
  color: var(--white);
  padding: 0 16px 0 42px;
  font-size: 14px;
  backdrop-filter: blur(12px);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.topbar-search input::placeholder { color: var(--gray); }
.topbar-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.topbar-search-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--gray);
  pointer-events: none;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── BUTTONS ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--radius-xl);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #000;
}
.btn-primary:hover {
  background: var(--accent-dark);
  box-shadow: var(--shadow-accent);
  transform: translateY(-1px);
}
.btn-ghost {
  background: rgba(255,255,255,0.08);
  color: var(--white);
  border: 1.5px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.25);
}
.btn-outline-accent {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.btn-outline-accent:hover {
  background: var(--accent);
  color: #000;
}
.btn-danger {
  background: rgba(220,38,38,0.15);
  color: #f87171;
  border: 1.5px solid rgba(220,38,38,0.3);
}
.btn-danger:hover { background: rgba(220,38,38,0.3); }
.btn-icon {
  width: 40px; height: 40px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
}
.btn svg { flex-shrink: 0; }

/* ─── SIDEBAR ───────────────────────────────────────────── */
#sidebar {
  width: 360px;
  height: 100%;
  background: var(--black-2);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  z-index: 50;
  flex-shrink: 0;
  transition: transform var(--transition);
}
#sidebar.collapsed {
  transform: translateX(-100%);
  position: absolute;
  left: 0;
}

.sidebar-header {
  padding: 80px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-header h2 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gray-light);
  margin-bottom: 12px;
}
.cinema-count {
  font-size: 28px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -1px;
}
.cinema-count span { color: var(--accent); }

.sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--black-4) transparent;
}
.sidebar-list::-webkit-scrollbar { width: 4px; }
.sidebar-list::-webkit-scrollbar-thumb { background: var(--black-4); border-radius: 4px; }

/* ─── SIDEBAR FOOTER ────────────────────────────────────── */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-about-link {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--gray);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 0;
  transition: color var(--transition);
  letter-spacing: 0.3px;
}
.sidebar-about-link:hover { color: var(--accent); }

/* Variante più visibile */
.sidebar-about-link--prominent {
  color: var(--gray-light);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  width: 100%;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  transition: all var(--transition);
}
.sidebar-about-link--prominent:hover {
  color: var(--accent);
  border-color: rgba(72,187,182,0.3);
  background: rgba(72,187,182,0.06);
}

/* ─── HAMBURGER MOBILE ───────────────────────────────────── */
.mobile-list-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: all var(--transition);
}
.mobile-list-btn:hover {
  background: rgba(255,255,255,0.11);
  border-color: rgba(255,255,255,0.2);
}
.mobile-list-btn span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--white);
  border-radius: 2px;
  transition: all var(--transition);
}
.mobile-list-btn span:first-child  { width: 18px; }
.mobile-list-btn span:nth-child(2) { width: 12px; }
.mobile-list-btn span:last-child   { width: 15px; }

/* ─── ABOUT PANEL ────────────────────────────────────────── */
.about-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.about-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}
.about-panel {
  position: relative;
  background: var(--black-2);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  width: min(680px, calc(100vw - 48px));
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  box-shadow: 0 32px 80px rgba(0,0,0,0.8);
  transform: translateY(16px);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  scrollbar-width: none;
}
.about-overlay.is-open .about-panel { transform: translateY(0); }
.about-panel::-webkit-scrollbar { display: none; }

.about-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.07);
  border: none;
  color: var(--gray-light);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.about-close:hover { background: rgba(255,255,255,0.12); color: var(--white); }

.about-inner {
  padding: 52px 52px 48px;
}

.about-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 16px;
}
.about-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.2;
  color: var(--white);
  margin-bottom: 24px;
}
.about-rule {
  width: 40px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  margin-bottom: 32px;
  opacity: 0.6;
}
.about-body p {
  font-size: 15px;
  font-weight: 300;
  line-height: 1.85;
  color: rgba(255,255,255,0.72);
  margin-bottom: 20px;
}
.about-body p:last-child { margin-bottom: 0; }

.about-signature {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.about-pazlab-logo {
  height: 44px;
  width: auto;
  display: block;
  opacity: 0.85;
  transition: opacity var(--transition);
}
.about-pazlab-logo:hover { opacity: 1; }

@media (max-width: 600px) {
  .about-inner { padding: 48px 28px 36px; }
  .about-title { font-size: 22px; }
  .about-body p { font-size: 14px; }
}



.cinema-card {
  background: var(--black-3);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  margin-bottom: 8px;
  transition: all var(--transition);
}
.cinema-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-accent);
  transform: translateY(-1px);
}
.cinema-card-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: var(--black-4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray);
  font-size: 36px;
}
.cinema-card-img img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}
.cinema-card-body {
  padding: 14px;
}
.cinema-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cinema-card-location {
  font-size: 12px;
  color: var(--gray-light);
  display: flex;
  align-items: center;
  gap: 4px;
}
.cinema-card-author {
  margin-top: 10px;
  font-size: 11px;
  color: var(--gray);
  display: flex;
  align-items: center;
  gap: 6px;
}
.author-dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ─── FAB (Aggiungi Cinema) ──────────────────────────────── */
#fab {
  position: absolute;
  bottom: 32px;
  right: 24px;
  z-index: 200;
  width: 56px;
  height: 56px;
  background: var(--accent);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(72,187,182,0.5);
  transition: all var(--transition);
  color: #000;
}
#fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(72,187,182,0.7);
}
#fab svg { width: 24px; height: 24px; }

/* ─── TOGGLE SIDEBAR ────────────────────────────────────── */
#sidebar-toggle {
  position: absolute;
  top: 50%;
  left: 360px;
  transform: translateY(-50%);
  z-index: 60;
  width: 28px; height: 52px;
  background: var(--black-3);
  border: 1px solid rgba(255,255,255,0.08);
  border-left: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-light);
  transition: all var(--transition);
}
#sidebar-toggle:hover { background: var(--black-4); color: var(--white); }
#sidebar.collapsed + #sidebar-toggle { left: 0; }

/* ─── MODAL ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal {
  position: relative;  /* fondamentale: .modal-close è position:absolute */
  background: var(--black-2);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
  scrollbar-width: thin;
  scrollbar-color: var(--black-4) transparent;
}
.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}
.modal-gallery {
  width: 100%;
  height: 280px;
  background: var(--black-3);
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.modal-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.modal-gallery-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  color: var(--black-4);
}
.gallery-nav {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}
.gallery-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  cursor: pointer;
  transition: all var(--transition);
}
.gallery-dot.active { background: var(--accent); width: 18px; border-radius: 3px; }
.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.6);
  border: none;
  color: #fff;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}
.gallery-arrow:hover { background: var(--accent); color: #000; }
.gallery-arrow.prev { left: 12px; }
.gallery-arrow.next { right: 12px; }

.modal-body {
  padding: 28px 32px;
}
.modal-tag {
  display: inline-block;
  background: var(--accent-glow);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}
.modal-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  color: var(--white);
  line-height: 1.2;
}
.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}
.modal-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--gray-light);
}
.modal-meta-item svg { color: var(--accent); flex-shrink: 0; }
.modal-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin: 20px 0;
}
.modal-description {
  font-size: 15px;
  color: rgba(255,255,255,0.75);
  line-height: 1.7;
  margin-bottom: 24px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: rgba(0,0,0,0.6);
  border: none;
  color: var(--white);
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: all var(--transition);
  z-index: 10;
}
.modal-close:hover { background: rgba(255,255,255,0.15); }

/* ─── AUTH MODAL ────────────────────────────────────────── */
.auth-modal {
  max-width: 440px;
  padding: 40px 36px;
}
.auth-modal h2 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 6px;
}
.auth-modal p.subtitle {
  color: var(--gray-light);
  font-size: 14px;
  margin-bottom: 28px;
}

/* ─── AUTH REQUIRED ─────────────────────────────────────── */
.auth-required-modal {
  text-align: center;
}
.auth-required-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(72,187,182,0.12);
  border: 1px solid rgba(72,187,182,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: var(--accent);
}
.auth-required-modal h2 { font-size: 20px; }
.auth-required-modal p.subtitle { margin-bottom: 20px; }
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-light);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  height: 46px;
  background: var(--black-3);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  color: var(--white);
  padding: 0 14px;
  font-size: 14px;
  outline: none;
  transition: all var(--transition);
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input::placeholder { color: var(--gray); }
textarea.form-input {
  height: 100px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.5;
}
.form-input.error { border-color: #f87171; }

.form-error {
  font-size: 12px;
  color: #f87171;
  margin-top: 6px;
  display: none;
}
.form-error.visible { display: block; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--gray);
  font-size: 13px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.08);
}

.btn-google {
  width: 100%;
  height: 46px;
  background: var(--white-dim);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all var(--transition);
}
.btn-google:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.2);
}

.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--gray-light);
}
.auth-switch a {
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}
.auth-switch a:hover { text-decoration: underline; }

/* ─── ADD CINEMA MODAL ──────────────────────────────────── */
.add-cinema-modal {
  max-width: 600px;
}
.add-cinema-modal .modal-body { padding: 32px; }
.add-cinema-modal h2 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
}
.add-cinema-modal > p {
  font-size: 14px;
  color: var(--gray-light);
  margin-bottom: 28px;
}

.map-picker {
  width: 100%;
  height: 200px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1.5px solid rgba(255,255,255,0.08);
  margin-bottom: 16px;
  cursor: crosshair;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-coords {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.toggle-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  background: var(--black-3);
  border-radius: var(--radius-md);
  border: 1.5px solid rgba(255,255,255,0.06);
  margin-bottom: 16px;
}
.toggle-group-label {
  display: flex;
  flex-direction: column;
}
.toggle-group-label span:first-child {
  font-size: 14px;
  font-weight: 600;
}
.toggle-group-label span:last-child {
  font-size: 12px;
  color: var(--gray-light);
}

/* Toggle switch */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle input { display: none; }
.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--black-4);
  border-radius: 12px;
  transition: background var(--transition);
  cursor: pointer;
  border: 1.5px solid rgba(255,255,255,0.1);
}
.toggle input:checked + .toggle-track { background: var(--accent); border-color: var(--accent); }
.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
  pointer-events: none;
}
.toggle input:checked ~ .toggle-thumb { transform: translateX(20px); }

/* Upload area */
.upload-area {
  border: 2px dashed rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--black-3);
  margin-bottom: 16px;
}
.upload-area:hover, .upload-area.drag-over {
  border-color: var(--accent);
  background: rgba(72,187,182,0.05);
}
.upload-area p { font-size: 14px; color: var(--gray-light); margin-top: 8px; }
.upload-area p strong { color: var(--accent); }
.upload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.preview-thumb {
  width: 72px; height: 72px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.08);
  position: relative;
}
.preview-thumb-wrap {
  position: relative;
  width: 72px; height: 72px;
}
.preview-thumb-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(255,255,255,0.08);
}
.remove-thumb {
  position: absolute;
  top: -6px; right: -6px;
  width: 20px; height: 20px;
  background: #000;
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  line-height: 1;
}

/* ─── ALERT / TOAST ──────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--black-3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
  pointer-events: all;
  animation: toastIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
  max-width: 360px;
}
.toast.success { border-left: 3px solid var(--accent); }
.toast.error   { border-left: 3px solid #f87171; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── MAPBOX CUSTOM MARKER (usato solo dalla mini-mappa picker) ──────────── */
.custom-marker {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 3px solid #000;
  box-shadow: 0 2px 12px rgba(72,187,182,0.5);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.custom-marker svg {
  transform: rotate(45deg);
  width: 16px;
  height: 16px;
  color: #000;
  flex-shrink: 0;
}
.custom-marker:hover {
  transform: rotate(-45deg) scale(1.15);
  box-shadow: 0 4px 20px rgba(72,187,182,0.7);
}

/* ─── USER AVATAR ────────────────────────────────────────── */
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #000;
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
  transition: all var(--transition);
}
.user-avatar:hover { border-color: var(--accent); }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Dropdown menu */
.dropdown {
  position: relative;
}
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--black-3);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  min-width: 180px;
  padding: 6px;
  box-shadow: var(--shadow);
  z-index: 200;
  display: none;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  transition: background var(--transition);
  color: var(--white);
}
.dropdown-item:hover { background: var(--black-4); }
.dropdown-item.danger { color: #f87171; }
.dropdown-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 4px 0;
}

/* ─── SPINNER ────────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    width: 100%;
    height: 75vh;
    border-right: none;
    border-top: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transform: translateY(100%);
    z-index: 300;
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
    will-change: transform;
  }
  #sidebar.open {
    transform: translateY(0);
  }
  #sidebar.open.peek {
    transform: translateY(calc(100% - 80px));
  }
  #sidebar-toggle {
    display: none;
  }
  .sidebar-header {
    padding-top: 16px;
    cursor: grab;
    user-select: none;
    touch-action: none;
  }
  .sidebar-handle {
    display: block;
    width: 40px; height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    margin: 0 auto 12px;
    flex-shrink: 0;
  }
  /* ── Topbar: logo + azioni in riga 1, ricerca in riga 2 ── */
  #topbar {
    padding: 10px 12px;
    flex-wrap: wrap;
    row-gap: 6px;
  }
  .logo          { order: 1; }
  .topbar-actions { order: 2; }
  .topbar-search {
    order: 3;
    flex: 0 0 100%;
    max-width: 100%;
  }
  .topbar-search input { height: 40px; font-size: 14px; }

  /* ── FAB e controlli mappa: rispetta l'inset bottom del browser ── */
  #fab {
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    right: 16px;
  }
  .mapboxgl-ctrl-bottom-left {
    margin-bottom: env(safe-area-inset-bottom, 0px);
  }
  .mapboxgl-ctrl-bottom-right {
    margin-bottom: env(safe-area-inset-bottom, 0px);
  }

  .modal { max-width: 100%; border-radius: var(--radius-md); }
  .modal-gallery { height: 200px; }
  .auth-modal { padding: 28px 20px; }
  .form-row, .form-coords { grid-template-columns: 1fr; }
}

/* Hamburger → X */
.mobile-list-btn.is-open span:first-child {
  transform: translateY(6.5px) rotate(45deg);
  width: 18px;
}
.mobile-list-btn.is-open span:nth-child(2) {
  opacity: 0;
  width: 0;
}
.mobile-list-btn.is-open span:last-child {
  transform: translateY(-6.5px) rotate(-45deg);
  width: 18px;
}
.mobile-list-btn span {
  transform-origin: center;
  transition: transform var(--transition), opacity var(--transition), width var(--transition);
}
