/* Design System & Stili per FestaGo! / SagraExplorer */

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

:root {
  --font-main: 'Outfit', sans-serif;
  
  /* Color Palette - Modern Light Theme */
  --bg-color: #f8fafc;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-solid: #ffffff;
  --text-color: #0f172a;
  --text-muted: #64748b;
  --primary-color: #ff5722; /* Arancio caldo Sagra */
  --primary-gradient: linear-gradient(135deg, #ff5722 0%, #ff8a50 100%);
  --secondary-color: #7c4dff; /* Viola vibrante */
  --secondary-gradient: linear-gradient(135deg, #7c4dff 0%, #a470ff 100%);
  --border-color: rgba(15, 23, 42, 0.08);
  --accent-color: #2e7d32; /* Verde scuro per elementi positivi / aperti */
  
  /* Glassmorphism settings */
  --glass-bg: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(15, 23, 42, 0.08);
  --glass-blur: blur(16px);
  
  /* Shadows and borders */
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 8px;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-color);
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  position: relative;
}

/* App Container Layout */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100dvh;
  width: 100%;
  position: relative;
}

/* Map Screen */
#map {
  flex-grow: 1;
  height: 100%;
  width: 100%;
  z-index: 1;
  background-color: #e2e8f0;
}

/* Customize Leaflet elements to match theme */
.leaflet-bar {
  border: none !important;
  box-shadow: var(--shadow-lg) !important;
}

.leaflet-bar a {
  background-color: var(--bg-card-solid) !important;
  color: var(--text-color) !important;
  border-bottom: 1px solid var(--border-color) !important;
  transition: var(--transition-smooth);
}

.leaflet-bar a:hover {
  background-color: var(--secondary-color) !important;
  color: #fff !important;
}

.leaflet-bar a:first-child {
  border-top-left-radius: var(--radius-sm) !important;
  border-top-right-radius: var(--radius-sm) !important;
}

.leaflet-bar a:last-child {
  border-bottom-left-radius: var(--radius-sm) !important;
  border-bottom-right-radius: var(--radius-sm) !important;
}

.leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.8) !important;
  color: var(--text-muted) !important;
  font-size: 10px !important;
}

/* Overlay UI Panels */
.overlay-header {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.header-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 12px;
}

.header-info {
  flex: 1 1 auto;
  min-width: 140px;
}

.header-info h1 {
  font-size: 1.15rem;
  font-weight: 700;
  background: linear-gradient(90deg, #ff8a50, #b47cff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 2px;
  line-height: 1.2;
}

.header-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

#festa-selector-container {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

#festa-selector-container select {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border-color);
  padding: 7px 12px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-color);
  outline: none;
  box-shadow: var(--shadow-sm);
  max-width: 100%;
}

.header-action-btn {
  background: var(--primary-gradient);
  border: none;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 87, 34, 0.4);
  transition: var(--transition-smooth);
}

.header-action-btn:active {
  transform: scale(0.9);
}

@media (max-width: 600px) {
  .overlay-header {
    top: 10px;
    left: 10px;
    right: 10px;
    gap: 8px;
  }
  
  .header-card {
    padding: 10px 14px;
  }
  
  #festa-selector-container {
    width: 100%;
    order: 3;
    margin-top: 4px;
  }

  #festa-selector-container select {
    width: 100%;
  }

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

/* Floating Search Bar */
.search-container {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  padding: 6px 14px;
  pointer-events: auto;
}

.search-input {
  background: transparent;
  border: none;
  color: var(--text-color);
  font-family: var(--font-main);
  font-size: 0.95rem;
  padding: 8px 10px;
  width: 100%;
  outline: none;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-container i {
  color: var(--text-muted);
  font-size: 1rem;
}

.search-clear {
  cursor: pointer;
  padding: 4px;
  display: none;
}

/* Floating Quick Category Filters */
.quick-filters {
  z-index: 10;
  display: flex;
  gap: 8px;
  padding: 4px 0;
  overflow-x: auto;
  scrollbar-width: none;
  pointer-events: auto;
  width: 100%;
}

.quick-filters::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  color: var(--text-color);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-smooth);
  pointer-events: auto;
}

.filter-chip i {
  font-size: 0.85rem;
}

.filter-chip.active {
  background: var(--text-color);
  color: var(--bg-color);
  border-color: var(--text-color);
  font-weight: 600;
}

/* Floating Control Buttons */
.map-controls {
  position: absolute;
  right: 16px;
  bottom: 150px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.control-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  font-size: 1.1rem;
  transition: var(--transition-smooth);
}

.control-btn:active {
  transform: scale(0.9);
}

.control-btn.active {
  background: var(--secondary-gradient);
  border-color: #b47cff;
  color: white;
  animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(124, 77, 255, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(124, 77, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(124, 77, 255, 0); }
}

/* Bottom Tab Navigation Bar */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(65px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid var(--border-color);
  backdrop-filter: blur(20px);
  z-index: 20;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom);
  box-sizing: border-box;
}

.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
  height: 100%;
  width: 20%;
}

.nav-tab i {
  font-size: 1.25rem;
  transition: var(--transition-smooth);
}

.nav-tab.active {
  color: var(--primary-color);
}

.nav-tab.active i {
  transform: translateY(-2px);
  color: var(--primary-color);
}

/* Secondary Screens (Content containers shown over the map when clicking tabs) */
.screen-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: calc(65px + env(safe-area-inset-bottom));
  background: var(--bg-color);
  z-index: 15;
  display: none;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.screen-panel.active {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.screen-header {
  padding: 24px 20px 12px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.screen-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

.screen-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Card Design Styles */
.card-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--transition-smooth);
  cursor: pointer;
}

.card-item:active {
  transform: scale(0.98);
}

.card-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.card-title {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-color);
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.card-body {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.card-footer {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.card-btn {
  flex-grow: 1;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.card-btn:active {
  background: rgba(15, 23, 42, 0.08);
}

.card-btn.primary-btn {
  background: var(--primary-gradient);
  border: none;
  color: white;
}

.card-btn.primary-btn:active {
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
}

/* Event List Card-Specific Styles */
.event-time-badge {
  background: rgba(124, 77, 255, 0.15);
  color: #b47cff;
  border: 1px solid rgba(124, 77, 255, 0.2);
  display: inline-block;
  align-self: flex-start;
}

/* Bottom Sheet Sliding Panel */
.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  max-height: 550px;
  background: var(--bg-card-solid);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.15);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, visibility 0.35s;
}

.bottom-sheet.open,
.bottom-sheet.active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.bottom-sheet-handle {
  width: 40px;
  height: 5px;
  background: rgba(15, 23, 42, 0.2);
  border-radius: 3px;
  margin: 12px auto 6px auto;
  cursor: pointer;
}

.bottom-sheet-close {
  position: absolute;
  right: 18px;
  top: 18px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--border-color);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.bottom-sheet-header {
  padding: 16px 24px 8px 24px;
}

.bottom-sheet-category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.bottom-sheet-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-color);
}

.bottom-sheet-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 16px 24px calc(32px + env(safe-area-inset-bottom)) 24px;
}

.bottom-sheet-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

/* Menu List inside Bottom Sheet */
.menu-list-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.menu-list-title {
  font-size: 1rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(15, 23, 42, 0.08);
}

.menu-item-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.menu-item-name {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-color);
}

.menu-item-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.menu-tag {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.04);
  color: var(--text-muted);
}

.menu-tag.tag-specialita {
  background: rgba(255, 87, 34, 0.12);
  color: #e64a19;
}

.menu-tag.tag-vegetariano {
  background: rgba(76, 175, 80, 0.12);
  color: #2e7d32;
}

.menu-tag.tag-senza-glutine {
  background: rgba(33, 150, 243, 0.12);
  color: #1565c0;
}

.menu-item-price {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary-color);
  white-space: nowrap;
}

/* Custom Marker Pins on Leaflet Map */
.custom-pin {
  width: 36px;
  height: 36px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.35);
  border: 2px solid white;
}

.custom-pin i {
  transform: rotate(45deg);
  font-size: 0.95rem;
  color: white;
}

/* Live Geolocation Blue Dot styling */
.user-location-marker {
  position: relative;
  width: 20px;
  height: 20px;
}

.user-location-dot {
  width: 14px;
  height: 14px;
  background-color: #2196F3;
  border: 2.5px solid white;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  box-shadow: 0 0 10px rgba(33, 150, 243, 0.8);
  z-index: 2;
}

.user-location-pulse {
  width: 20px;
  height: 20px;
  background-color: rgba(33, 150, 243, 0.4);
  border-radius: 50%;
  position: absolute;
  top: 0;
  left: 0;
  animation: pulse-gps 1.8s infinite ease-out;
  z-index: 1;
}

@keyframes pulse-gps {
  0% {
    transform: scale(0.6);
    opacity: 1;
  }
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

/* Empty states */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  gap: 12px;
}

.empty-state i {
  font-size: 2.5rem;
  color: rgba(255, 255, 255, 0.1);
}

.empty-state p {
  font-size: 0.9rem;
}

/* Utility classes */
.badge-food { background: rgba(255, 87, 34, 0.15); color: #ff8a50; border: 1px solid rgba(255, 87, 34, 0.2); }
.badge-stage { background: rgba(156, 39, 176, 0.15); color: #e040fb; border: 1px solid rgba(156, 39, 176, 0.2); }
.badge-parking { background: rgba(33, 150, 243, 0.15); color: #64b5f6; border: 1px solid rgba(33, 150, 243, 0.2); }
.badge-service { background: rgba(76, 175, 80, 0.15); color: #81c784; border: 1px solid rgba(76, 175, 80, 0.2); }
.badge-info { background: rgba(255, 235, 59, 0.15); color: #fff59d; border: 1px solid rgba(255, 235, 59, 0.2); }
.badge-firstaid { background: rgba(244, 67, 54, 0.15); color: #ef5350; border: 1px solid rgba(244, 67, 54, 0.2); }

/* Status Pill Badge (Mancano N. Giorni / In corso) */
.badge-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.badge-status-pill-active {
  background: rgba(0, 200, 83, 0.15);
  color: #00c853;
  border: 1px solid rgba(0, 200, 83, 0.3);
}

.badge-status-pill-upcoming {
  background: rgba(33, 150, 243, 0.15);
  color: #2196f3;
  border: 1px solid rgba(33, 150, 243, 0.3);
}

.badge-status-pill-expired {
  background: rgba(100, 116, 139, 0.15);
  color: #64748b;
  border: 1px solid rgba(100, 116, 139, 0.3);
}

/* Multi-Festa Drawer & Menu Styling */
.badge-festa-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(33, 150, 243, 0.12);
  color: #2196f3;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.drawer-header-info {
  margin-bottom: 14px;
}

.drawer-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.drawer-description {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.drawer-section-title {
  font-size: 0.98rem;
  font-weight: 700;
  margin: 18px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-items-grid, .events-items-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-item-card, .event-item-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.event-item-card {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.menu-item-name, .event-item-title {
  font-weight: 600;
  font-size: 0.88rem;
}

.menu-item-price {
  font-weight: 700;
  color: var(--primary-color);
  font-size: 0.95rem;
}

.badge-tag {
  font-size: 0.68rem;
  background: rgba(33, 150, 243, 0.1);
  color: #2196f3;
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: 600;
  margin-left: 4px;
}

.user-pulse-dot {
  width: 14px;
  height: 14px;
  background-color: #2196F3;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(33, 150, 243, 0.8);
}

/* --- COOKIE CONSENT BANNER --- */
.cookie-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  width: 90%;
  max-width: 580px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 99999;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.cookie-banner.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(30px);
  pointer-events: none;
}
.cookie-banner-content {
  display: flex;
  align-items: center;
  gap: 16px;
}
@media (max-width: 500px) {
  .cookie-banner-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .cookie-banner-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
.cookie-banner-icon {
  font-size: 2rem;
  color: #ff5722;
  display: flex;
  align-items: center;
}
.cookie-banner-text {
  flex: 1;
}
.cookie-banner-text h4 {
  margin: 0 0 4px 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #f8fafc;
}
.cookie-banner-text p {
  margin: 0;
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.4;
}
.cookie-banner-text a {
  color: #ff5722;
  text-decoration: underline;
  cursor: pointer;
}
.cookie-banner-actions {
  display: flex;
  gap: 10px;
}
.btn-cookie-btn {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.btn-cookie-btn.accept-btn {
  background: #ff5722;
  color: white;
}
.btn-cookie-btn.accept-btn:hover {
  background: #f4511e;
  transform: translateY(-1px);
}

/* --- PRIVACY MODAL OVERLAY --- */
.privacy-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}
.privacy-modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.privacy-modal-dialog {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  animation: modalScaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalScaleUp {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.privacy-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.privacy-modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #f8fafc;
}
.btn-close-privacy-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.2s;
}
.btn-close-privacy-btn:hover {
  color: #f8fafc;
}
.privacy-modal-body {
  padding: 20px;
  overflow-y: auto;
  font-size: 0.85rem;
  color: #cbd5e1;
  line-height: 1.5;
}
.privacy-modal-body h4 {
  margin: 16px 0 6px 0;
  color: #f8fafc;
  font-weight: 600;
}
.privacy-modal-body h4:first-of-type {
  margin-top: 0;
}
.privacy-modal-body p {
  margin: 0 0 10px 0;
}
.privacy-modal-body ul {
  margin: 0 0 12px 0;
  padding-left: 20px;
}
.privacy-modal-body li {
  margin-bottom: 4px;
}
.privacy-modal-footer {
  padding: 12px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  justify-content: flex-end;
}

/* --- STILI CALENDARIO PROGRAMMA EVENTI --- */
.calendar-viewport {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  gap: 16px;
  padding: 10px 10%;
  flex-grow: 1;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Nasconde scrollbar Firefox */
}
.calendar-viewport::-webkit-scrollbar {
  display: none; /* Nasconde scrollbar Chrome/Safari */
}
.calendar-column {
  flex: 0 0 80%; /* 80% larghezza su mobile */
  scroll-snap-align: center;
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  height: 90%; /* Occupa la maggior parte dell'altezza disponibile */
  box-sizing: border-box;
}
.calendar-day-header {
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 10px;
  margin-bottom: 12px;
  text-align: center;
}
.calendar-day-header .day-name {
  font-size: 1.15rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-color);
}
.calendar-day-header .day-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 2px;
}
.calendar-day-header.today {
  border-bottom-color: #22c55e;
}
.calendar-day-header.today .day-name {
  color: #22c55e;
}
.calendar-events-list {
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 4px;
}
.calendar-event-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px;
  position: relative;
  transition: transform 0.2s;
}
.calendar-event-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 87, 34, 0.4);
}
.calendar-event-time {
  font-weight: 800;
  color: var(--primary-color);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 4px;
}
.calendar-event-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 4px 0;
  color: var(--text-color);
}
.calendar-event-location {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}
.calendar-event-town {
  display: inline-block;
  background: rgba(255, 87, 34, 0.1);
  color: var(--primary-color);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.calendar-empty-day {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 10px;
  font-size: 0.88rem;
  margin: auto 0;
}

@media (min-width: 768px) {
  #events-list {
    overflow-y: auto !important; /* Abilita lo scroll verticale dell'intera griglia su desktop */
  }
  .calendar-viewport {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    overflow-x: visible;
    scroll-snap-type: none;
    padding: 15px 20px;
    gap: 12px;
    height: auto;
  }
  .calendar-column {
    flex: none;
    width: auto;
    height: auto; /* La colonna si allunga in base al contenuto */
    min-height: 400px;
  }
  .calendar-events-list {
    overflow-y: visible; /* Rende visibili tutti gli eventi all'interno della colonna senza scrollbar interna */
  }
}

