/* ===========================
   ROOT STYLES
   =========================== */

:root {
  /* Carousel and Card Dimensions */
  --card-height: 280px;
  --card-padding: 20px;
  --container-padding: 16px;
  --carousel-height: calc(var(--card-height) + var(--card-padding) * 2);

  /* Mobile Navigation */
  --mobile-nav-height: 56px;

  /* Wrapper Positioning */
  --wrapper-gap: 16px; /* Gap between buttons and carousel */
  --wrapper-bottom-desktop: 16px;
  --wrapper-bottom-mobile: 64px; /* 56px nav + 8px gap - no calc needed */

  /* Safe Area Fallbacks */
  --safe-bottom: env(safe-area-inset-bottom, 0);
  --safe-left: env(safe-area-inset-left, 0);
  --safe-right: env(safe-area-inset-right, 0);
  --safe-top: env(safe-area-inset-top, 0);
}

#root {
  background-color: rgb(23 25 28);
}

/* ===========================
   PERFORMANCE CRITICAL STYLES
   =========================== */

.marker-container,
.carousel-card > div {
  contain: layout style;
}

/* ===========================
   ANIMATIONS - OPTIMIZED
   =========================== */

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* @keyframes ping moved to mapMarkers.css */

@keyframes float {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  25% {
    transform: translate3d(5px, -8px, 0) rotate(-2deg);
  }
  50% {
    transform: translate3d(0, -10px, 0) rotate(0deg);
  }
  75% {
    transform: translate3d(-5px, -8px, 0) rotate(2deg);
  }
}

@keyframes orbit {
  0% {
    transform: rotate(0deg) translateX(30px) rotate(0deg);
  }
  100% {
    transform: rotate(360deg) translateX(30px) rotate(-360deg);
  }
}

@keyframes beaconPulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.4;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

@keyframes gridMove {
  0% {
    transform: translate3d(0, 0, 0);
  }

  100% {
    transform: translate3d(50px, 50px, 0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translate3d(0, -10px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes flowAnimation {
  to {
    stroke-dashoffset: -10;
  }
}

@keyframes virtualPulse {
  0% {
    transform: scale(0.8);
    opacity: 0.8;
  }

  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

@keyframes centroidPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.2);
    opacity: 1;
  }
}

@keyframes expandRing {
  0% {
    transform: scale(0.8);
    opacity: 1;
  }

  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

@keyframes peekAnimation {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-50px);
  }
}

/* @keyframes pingSmall moved to mapMarkers.css */

/* @keyframes premiumPulse moved to mapMarkers.css */

@keyframes locationPulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(3);
    opacity: 0;
  }
}

@keyframes gpsPulse {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes singlePulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.8;
  }
  100% {
    transform: translate(-50%, -50%) scale(3);
    opacity: 0;
  }
}

/* ===========================
   BASE STYLES
   =========================== */

* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===========================
   CUSTOM SCROLLBAR
   =========================== */

.new-home-ui::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.new-home-ui::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.new-home-ui::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.new-home-ui::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ===========================
   UTILITY CLASSES
   =========================== */

.brand-green {
  color: #b9ff66;
}

.brand-red {
  color: #f5484d;
}

.brand-purple {
  color: #9747ff;
}

.gradient-text {
  background: linear-gradient(to right, #f5484d, #9747ff, #b9ff66);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hover-scale {
  transition: transform 0.2s;
}

.hover-scale:hover {
  transform: scale(1.05);
}

.glass {
  background: rgba(38, 38, 38, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Animation utility classes */
.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-ping {
  animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-orbit {
  animation: orbit 20s linear infinite;
}

/* ===========================
   TOGGLE & UI COMPONENTS
   =========================== */

/* Container principale */
#mainToggleContainer {
  background: rgb(60 60 60 / 60%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(155,155,155, 0.2) !important;
  height: 48px;
  display: flex;
  align-items: center;
  padding: 4px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#mainToggleContainer.search-active {
  border: none !important;
}

/* View containers */
#normalToggleView,
#searchToggleView {
  height: 40px;
  display: flex;
  align-items: center;
  width: 100%;
}

#searchToggleView {
  gap: 0.5rem;
  padding: 0 8px;
}

/* Toggle buttons base */
.new-home-ui .toggle-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  border-radius: 9999px;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.6);
  background: transparent;
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 16px;
  min-height: 40px;
}

.new-home-ui .toggle-button:hover:not(.active) {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.1);
}

/* Toggle button active state */
.new-home-ui .toggle-button.active {
  color: white;
  width: auto;
  padding: 8px 16px;
  gap: 8px;
  font-size: 14px;
}

/* Toggle button text */
.new-home-ui .toggle-button .button-text {
  display: none;
}

.new-home-ui .toggle-button.active .button-text {
  display: inline;
}

/* Toggle button icons */
.new-home-ui .toggle-button i,
.new-home-ui .toggle-button .board-icon {
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.new-home-ui .toggle-button.active i,
.new-home-ui .toggle-button.active .board-icon {
  transform: scale(1.1);
}

/* Board icon */
.new-home-ui .board-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.new-home-ui .board-icon svg {
  width: 100%;
  height: 100%;
}

/* Search input */
#mainSearchInput {
  background: transparent;
  border: none;
  outline: none;
  color: white;
  flex: 1;
  height: 40px;
  padding: 0 16px;
  font-size: 14px;
}

/* Search view buttons */
#searchToggleView button {
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  transition: all 0.2s ease;
}

#searchToggleView button:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Filter badge */
.new-home-ui .filter-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5484d;
  color: white;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: bold;
  padding: 0 4px;
  pointer-events: none;
}

/* Mobile specific */
@media (max-width: 767px) {
  /* Container */
  #mainToggleContainer {
    border: 1px solid rgba(155,155,155, 0.2) !important;
    height: 48px !important;
    padding: 4px !important;
    width: calc(100% - 32px) !important;
    /* 16px per lato */
    margin: 0 auto !important;
    left: 16px !important;
    right: 16px !important;
  }

  /* Mantieni gli stessi margini in search mode */
  #mainToggleContainer.search-active {
    width: calc(100% - 32px) !important;
    margin: 0 auto !important;
    left: 16px !important;
    right: 16px !important;
  }

  /* Normal view con distribuzione uniforme */
  #normalToggleView {
    padding: 0;
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    /* Filter | Center | Search */
    gap: 8px;
    align-items: center;
  }

  /* Container centrale per i view buttons */
  #normalToggleView > div:nth-child(2) {
    display: flex;
    justify-content: space-evenly;
    /* Distribuzione uniforme */
    align-items: center;
    gap: 4px;
  }

  /* Bottoni su mobile */
  .new-home-ui.toggle-button {
    min-width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    flex-shrink: 0;
  }

  /* Pulsante attivo mostra il testo su mobile */
  .new-home-ui .toggle-button.active {
    width: auto !important;
    padding: 0 12px !important;
    min-width: fit-content !important;
  }

  .new-home-ui .toggle-button.active .button-text {
    display: inline !important;
    font-size: 12px;
  }

  /* Filter e search buttons sempre 40x40 */
  .new-home-ui .filter-button,
  .new-home-ui .search-button {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
  }

  /* Nascondi testo per filter e search anche se attivi */
  .new-home-ui .filter-button .button-text,
  .new-home-ui .search-button .button-text {
    display: none !important;
  }

  /* Search view */
  #searchToggleView {
    padding: 0 4px;
    gap: 4px;
  }

  #mainSearchInput {
    min-width: 0;
    padding: 0 12px;
    font-size: 14px;
  }
}

/* Desktop specific */
@media (min-width: 768px) {
  #mainToggleContainer {
    border: 0.5px solid rgba(155,155,155, 0.15) !important;
    width: auto;
    border-radius: 9999px;
    min-width: fit-content;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Mantieni la stessa larghezza in search mode */
  #mainToggleContainer.search-active {
    min-width: fit-content;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  #normalToggleView {
    gap: 1rem;
  }

  /* Show button text on desktop */
  .new-home-ui .toggle-button .button-text {
    display: inline !important;
  }

  .new-home-ui .toggle-button {
    width: auto;
    padding: 0 24px;
  }

  .new-home-ui .toggle-button.active {
    padding: 8px 24px;
  }
}

/* Tab styles */
.new-home-ui .tab-button {
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  position: relative;
  text-align: center;
  white-space: nowrap;
  min-width: 0;
}

.new-home-ui .tab-button.active {
  background: rgba(255, 255, 255, 0.1);
}

/* Filter styles */
.new-home-ui div#filterPanel {
  border: none !important;
  background: rgb(0 0 0 / 0.8);
  animation: slideDown 0.2s ease-out;
}

.new-home-ui .filter-button {
  position: relative;
}

.new-home-ui .filter-badge {
  position: absolute;
  pointer-events: none;
  z-index: 10;
}

.new-home-ui .filter-button:not(.active),
.new-home-ui .search-button:not(.active) {
  width: 40px !important;
  padding: 0 !important;
}

.new-home-ui .filter-button:not(.active) .button-text,
.new-home-ui .search-button:not(.active) .button-text {
  display: none !important;
}

/* Search styles */
.search-toggle-btn {
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  transition: all 0.2s;
  cursor: pointer;
}

.search-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

#normalToggleView {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

#searchToggleView {
  display: none !important;
  align-items: center;
  width: 100%;
}

#searchToggleView.active {
  display: flex !important;
}

#normalToggleView.hidden {
  display: none !important;
}

#mainToggleContainer.search-active {
  border: none !important;
}

#mobileToggle {
  display: none;
}

.new-home-ui input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ===========================
   MAPBOX STYLES
   =========================== */

.new-home-ui .mapboxgl-canvas {
  will-change: transform;
}

.new-home-ui .mapboxgl-popup-content {
  background: rgba(38, 38, 38, 0.95);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 12px;
}

.new-home-ui .mapboxgl-popup-tip {
  border-top-color: rgba(38, 38, 38, 0.95) !important;
}

.new-home-ui .mapboxgl-popup-close-button {
  color: white;
  font-size: 16px;
}

.new-home-ui .mapboxgl-popup-close-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Map movement optimizations */
/* Marker performance states moved to mapMarkers.css */
.mapboxgl-moving .network-layer {
  transition: none !important;
}

.mapboxgl-moving .connection-line {
  stroke-width: 0.3 !important;
  opacity: 0.2 !important;
}

.mapboxgl-moving .participant-dot {
  opacity: 0.3;
}

/* Marker animation states during movement moved to mapMarkers.css */
.mapboxgl-moving .virtual-marker-pulse {
  opacity: 0;
}

/* Pause all animations during map movement */
.mapboxgl-moving .animate-pulse,
.mapboxgl-moving .animate-ping,
.mapboxgl-moving .animate-float,
.mapboxgl-moving .animate-orbit,
.mapboxgl-moving .virtual-marker-pulse::before,
.mapboxgl-moving .virtual-marker-pulse::after,
.mapboxgl-moving .user-location-pulse {
  animation-play-state: paused !important;
}
/* Marker-specific animation pauses moved to mapMarkers.css */

/* Reduce connection line animations during movement */
.mapboxgl-moving .connection-line {
  animation: none !important;
}

/* Ottimizzazioni performance durante movimento mappa */
.mapboxgl-moving .virtual-marker-pulse::before,
.mapboxgl-moving .virtual-marker-pulse::after {
  animation: none !important;
}
/* Marker animations moved to mapMarkers.css */

.mapboxgl-moving .connection-line {
  stroke-width: 0.5 !important;
  opacity: 0.2 !important;
  transition: none !important;
}

.mapboxgl-moving .participant-dot,
.mapboxgl-moving .organizer-dot {
  opacity: 0.3 !important;
  transition: none !important;
}

/* Nascondi completamente elementi decorativi durante movimento veloce */
.mapboxgl-moving .virtual-marker-pulse {
  display: none !important;
}
/* .mapboxgl-moving .marker-content moved to mapMarkers.css */

/* Network layer durante movimento */
.mapboxgl-moving .network-layer {
  pointer-events: none !important;
}

/* ===========================
   MARKER STYLES
   =========================== */

.new-home-ui .marker-container {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Transitions only after initial positioning */
.new-home-ui .marker-container:not(.initializing) {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Force immediate position during initialization */
.new-home-ui .marker-container.initializing {
  transition: none !important;
  opacity: 0;
}

/* Virtual markers should always be visible for orbital animations */
.new-home-ui .marker-container.virtual-marker.initializing {
  opacity: 1;
}

.new-home-ui .marker-container.positioned {
  opacity: 1;
  transition: opacity 0.2s ease;
}

.new-home-ui .marker-container.repositioning {
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.new-home-ui .marker-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 20px;
  color: white;
  position: relative;
  transition: transform 0.3s;
}

.new-home-ui .marker-content:hover {
  transform: scale(1.2);
}

.new-home-ui .marker-live-indicator {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

/* Live pulse effect */
/* Live marker pulse styles moved to mapMarkers.css */

/* Virtual Marker */
.virtual-marker-pulse {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  pointer-events: none;
}

.virtual-marker-pulse::before,
.virtual-marker-pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid #9747ff;
  border-radius: 50%;
  opacity: 0;
  animation: virtualPulse 3s ease-out infinite;
}

.virtual-marker-pulse::after {
  animation-delay: 1.5s;
}

/* Ensure non-live virtual markers are visible in global mode */
.virtual-marker:not(.orbital-marker) {
  z-index: 1500 !important;
}

/* Static virtual markers should always be visible */
.marker-container.virtual-marker.positioned {
  opacity: 1 !important;
}

/* NUOVO: Nascondi i satelliti orbitali durante l'inizializzazione */
.marker-container.virtual-marker.orbital-marker.initializing {
  opacity: 0 !important;
  transition: none !important;
}

/* Mostra i satelliti solo quando sono posizionati */
.marker-container.virtual-marker.orbital-marker.positioned {
  opacity: 1 !important;
  transition: opacity 0.3s ease !important;
}

/* Premium Gym Marker */
/* Premium marker, gym logo, and event count badge styles moved to mapMarkers.css */

/* Participant Marker */
.participant-marker {
  width: 16px;
  height: 16px;
  transition: all 0.3s ease;
}

.participant-marker-content {
  background: rgba(185, 255, 102, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: bold;
  color: black;
  box-shadow: 0 0 8px rgba(185, 255, 102, 0.5);
  transition: all 0.3s ease;
}

.participant-marker.inactive {
  opacity: 0.05;
  transform: scale(0.3);
}

.participant-marker.inactive .participant-marker-content {
  width: 4px !important;
  height: 4px !important;
  background: rgba(185, 255, 102, 0.15);
  box-shadow: none;
  font-size: 0;
}

.participant-marker.active {
  opacity: 0.7;
  transform: scale(0.6);
}

.participant-marker.active .participant-marker-content {
  width: 10px !important;
  height: 10px !important;
  background: rgba(185, 255, 102, 0.7);
  box-shadow: 0 0 6px rgba(185, 255, 102, 0.5);
  font-size: 7px;
}

.participant-marker:hover {
  opacity: 1 !important;
  transform: scale(1) !important;
}

.participant-marker:hover .participant-marker-content {
  width: 14px !important;
  height: 14px !important;
  background: rgba(185, 255, 102, 0.9);
  box-shadow: 0 0 12px rgba(185, 255, 102, 0.8);
  animation: pulse 1.5s ease-in-out infinite;
}

/* Marker hover states */
.marker-container:hover {
  z-index: 1500 !important;
}

/* Premium marker hover states moved to mapMarkers.css */

/* Cluster styles moved to mapMarkers.css */

/* Marker priorities moved to mapMarkers.css */

/* Orbital marker */
.orbital-marker {
  transition: none !important;
}

.orbital-marker:hover .marker-content {
  transform: scale(1.1);
}

.orbital-marker:hover .virtual-marker-pulse {
  animation-play-state: paused;
}

.virtual-marker.orbital-marker {
  z-index: 2500 !important;
}

/* Prevent flickering during map updates */
.mapboxgl-marker {
  will-change: transform;
  -webkit-transform: translateZ(0);
  -webkit-backface-visibility: hidden;
}

/* All cluster styles moved to mapMarkers.css */

/* Global satellite markers */
.global-satellite .marker-content {
  box-shadow: 0 0 20px rgba(151, 71, 255, 0.6);
}

.global-satellite .virtual-marker-pulse {
  animation-duration: 2s;
  /* Più veloce per satelliti */
}

.global-satellite.orbital-marker .marker-content {
  background: linear-gradient(135deg, #9747ff, #5c2aed) !important;
}

/* ===========================
   NETWORK VISUALIZATION
   =========================== */

.network-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 500 !important;
}

.network-layer.active {
  opacity: 1;
}

.connection-line {
  stroke: #9747ff;
  stroke-width: 0.5;
  /* Ridotto da 0.8 */
  fill: none;
  opacity: 0.2;
  /* Ridotto da 0.35 */
  stroke-dasharray: 5, 5;
  animation: flowAnimation 3s linear infinite;
  transition: opacity 0.2s ease, stroke-width 0.2s ease;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.connection-line:hover {
  opacity: 0.4;
  /* Ridotto da 0.6 */
  stroke-width: 0.8;
  /* Ridotto da 1.2 */
}

.network-layer.hover-mode .connection-line {
  stroke-width: 0.1;
  /* Ridotto da 0.15 */
  transition: all 0.3s ease;
}

.network-layer .connection-group.active .connection-line {
  stroke-width: 0.3;
  /* Ridotto da 0.5 */
  opacity: 0.2;
  /* Ridotto da 0.3 */
}

.participant-dot,
.organizer-dot {
  transition: opacity 0.2s ease, r 0.2s ease, filter 0.3s ease;
}

.participant-dot {
  fill: #b9ff66;
}

.network-layer.hover-mode .participant-dot,
.network-layer.hover-mode .organizer-dot {
  r: 1.5;
  opacity: 0.15;
  transition: all 0.3s ease;
}

.network-layer .connection-group.active .participant-dot,
.network-layer .connection-group.active .organizer-dot {
  r: 3;
  /* Stessa dimensione per entrambi */
  opacity: 0.7;
}

.organizer-line {
  stroke: #ffd700 !important;
  stroke-width: 0.5 !important;
  /* Stesso spessore delle altre linee */
  opacity: 0.2 !important;
  /* Stessa opacità */
  filter: none !important;
  /* Rimuovi il glow */
}

.organizer-dot {
  fill: #ffd700 !important;
  /* Solo il colore è diverso */
  filter: none !important;
  /* Rimuovi il drop-shadow speciale */
}

/* Network overlays */
.heatmap-overlay,
.virtual-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none !important;
}

.heatmap-overlay {
  background: radial-gradient(
    circle at var(--center-x, 50%) var(--center-y, 50%),
    rgba(151, 71, 255, 0.08) 0%,
    rgba(151, 71, 255, 0.04) 20%,
    rgba(151, 71, 255, 0.02) 40%,
    transparent 50%
  );
  opacity: 0;
  transition: opacity 0.5s ease;
}

.heatmap-overlay.active,
.heatmap-overlay.hover-active {
  opacity: 1 !important;
}

.virtual-overlay {
  background: radial-gradient(
    circle at center,
    transparent 0%,
    rgba(151, 71, 255, 0.1) 100%
  );
  animation: gridPulse 4s ease-in-out infinite;
}

/* Network elements */
.beacon-pulse {
  position: absolute;
  inset: -5px;
  border: 2px solid #9747ff;
  border-radius: 25px;
  pointer-events: none;
  animation: beaconPulse 3s ease-out infinite;
}

.beacon-pulse::before,
.beacon-pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid #9747ff;
  border-radius: 25px;
}

.beacon-pulse::before {
  animation: beaconPulse 3s ease-out infinite;
  animation-delay: 1s;
}

.beacon-pulse::after {
  animation: beaconPulse 3s ease-out infinite;
  animation-delay: 2s;
}

.cyber-grid {
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
  background-image: linear-gradient(
      rgba(151, 71, 255, 0.05) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(151, 71, 255, 0.05) 1px, transparent 1px);
  background-size: 80px 80px;
  animation: gridMove 20s linear infinite;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.virtual-hub.expanded .cyber-grid {
  opacity: 1;
}

.orbit-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #b9ff66;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  margin: -3px 0 0 -3px;
  box-shadow: 0 0 8px #b9ff66;
  animation: orbit 20s linear infinite;
}

.virtual-centroid {
  width: 60px;
  height: 60px;
  background: radial-gradient(
    circle,
    rgba(151, 71, 255, 0.8) 0%,
    rgba(151, 71, 255, 0) 70%
  );
  border-radius: 50%;
  position: relative;
  animation: centroidPulse 3s ease-in-out infinite;
}

.virtual-centroid::before {
  content: "";
  position: absolute;
  inset: -20px;
  border: 2px solid rgba(151, 71, 255, 0.3);
  border-radius: 50%;
  animation: expandRing 3s ease-out infinite;
}

/* ===========================
   CAROUSEL WRAPPER CONTAINER
   =========================== */

.carousel-wrapper {
  position: fixed;
  bottom: var(--wrapper-bottom-desktop);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: var(--wrapper-gap);
  align-items: stretch;
  pointer-events: none; /* Click through to map */
  z-index: 4000;
  transition: bottom 0.3s ease-out;
}

/* Wrapper State: Hidden carousel */
.carousel-wrapper.carousel-hidden .carousel-container {
  height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Wrapper State: Expanded carousel */
.carousel-wrapper.carousel-expanded {
  bottom: 0;
  height: 100vh;
  padding-top: 80px; /* Space for top UI elements */
}

/* ===========================
   CAROUSEL STYLES
   =========================== */

.carousel-container {
  /* Remove position: fixed and bottom - wrapper handles positioning */
  position: relative;
  height: var(--carousel-height);
  background: transparent;
  pointer-events: auto;
  transition: height 0.3s ease-out, opacity 0.3s ease-out;
  box-shadow: none !important;
}

/* Desktop specific adjustment */
@media (min-width: 768px) {
  .carousel-container {
    height: auto;
  }
}

.carousel-container.peek {
  animation: peekAnimation 1s ease-out;
}

.carousel-scrollable {
  overflow-x: auto;
  overflow-y: visible; /* Permette contenuto visibile */
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  height: 100%;
  padding: 0px;
  position: relative;
  pointer-events: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  z-index: 4001 !important; /* FIX: was 2501 */
}

.carousel-scrollable::-webkit-scrollbar {
  display: none;
}

.carousel-track {
  display: flex;
  gap: 16px;
  height: auto !important;
  padding: 0 20px;
}

.carousel-card {
  flex: 0 0 320px;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  transition: transform 0.2s ease;
  z-index: 1 !important; /* Override z-index eccessivo con valore ragionevole */
}

.carousel-card > div {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(15px) saturate(120%);
}

.carousel-card:hover {
  transform: scale(1.02);
}

/* Hidden state handled by wrapper .carousel-wrapper.carousel-hidden */

/* ===========================
   FLOATING BUTTONS
   =========================== */

.floating-buttons {
  /* No position: fixed - wrapper handles positioning */
  display: flex;
  justify-content: space-between;
  padding: 0 24px;
  pointer-events: auto;
  /* No bottom, no z-index needed - inherited from wrapper */
}

.button-minimal {
  width: 48px;
  height: 48px;
  background: rgb(70 70 70 / 60%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(155,155,155, 0.2) !important;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: rgba(255, 255, 255, 0.6);
  overflow: visible;
  position: relative;
}

.button-minimal:hover {
  background: rgb(70 70 70 / 60%);
  color: rgba(255, 255, 255, 0.8);
  transform: scale(1.05);
}

.button-minimal:active {
  transform: scale(0.95);
}

.chevron-button i {
  font-size: 18px;
  transition: transform 0.3s ease;
}

.carousel-container.hidden ~ .floating-buttons .chevron-button i {
  transform: rotate(180deg);
}

/* State-specific positioning handled by wrapper states */

.gps-button i {
  font-size: 20px;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.gps-button.active {
  background: rgba(66, 133, 244, 0.2);
  color: #4285f4;
  box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.3);
}

.gps-button.loading {
  pointer-events: none;
}

.gps-button.loading i {
  animation: gpsPulse 1.5s ease-in-out infinite;
}

.gps-accuracy-ring {
  position: absolute;
  width: 60px;
  height: 60px;
  border: 2px solid #4285f4;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
}

.gps-button.active .gps-accuracy-ring {
  animation: singlePulse 1.5s ease-out forwards;
}

/* User Location Marker */
.user-location-marker {
  width: 20px;
  height: 20px;
  position: relative;
}

.user-location-dot {
  width: 14px;
  height: 14px;
  background: #4285f4;
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.user-location-pulse {
  width: 20px;
  height: 20px;
  background: rgba(66, 133, 244, 0.4);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: locationPulse 2s ease-out infinite;
}

/* ===========================
   EXPANDED CAROUSEL STYLES
   =========================== */

/* Map overlay con z-index sotto i satelliti */
#mapOverlay {
  z-index: 2550 !important;
  /* Sotto i satelliti (2500) */
}

/* Expanded state handled by wrapper .carousel-wrapper.carousel-expanded */
.carousel-container.expanded {
  /* Height will expand to fill wrapper minus buttons and gap */
  height: calc(100vh - 80px - 48px - var(--wrapper-gap)) !important;
}

.carousel-container.expanded .carousel-scrollable {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scroll-snap-type: none !important;
}

.carousel-container.expanded .carousel-track {
  flex-direction: column !important;
  gap: 16px !important;
  padding: 80px 20px 20px 20px !important;
}

.carousel-container.expanded .carousel-card {
  flex: none !important;
  width: 100% !important;
  max-width: none !important;
  scroll-snap-align: none !important;
}

/* Layout a griglia per desktop */
@media (min-width: 768px) {
  .carousel-container.expanded .carousel-track {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
    gap: 20px !important;
    padding: 82px 24px 24px 24px !important;
  }

  .carousel-container.expanded {
    height: calc(100vh - 75px) !important;
    /* 80px toggle + 60px header circa */
    top: auto !important;
  }
}

/* State positioning handled by wrapper */

/* REMOVED DUPLICATE - Consolidated into main mobile media query at line 2940 */

/* Mostra/nascondi chevron buttons - Desktop */
@media (min-width: 768px) {
  .carousel-container:not(.hidden) ~ .floating-buttons .chevron-up {
    display: flex !important;
  }

  /* .carousel-container.expanded ~ .floating-buttons .chevron-down {
    display: none !important;
  } */
}

/* Mobile: sempre entrambi visibili quando non hidden */
@media (max-width: 767px) {
  .carousel-container:not(.hidden) ~ .floating-buttons .chevron-up,
  .carousel-container:not(.hidden) ~ .floating-buttons .chevron-down {
    display: flex !important;
  }

  /* .carousel-container.expanded ~ .floating-buttons .chevron-down {
    display: none !important;
  } */
}

.carousel-container.expanded ~ .floating-buttons .chevron-up i {
  transform: rotate(180deg);
}

/* Smooth transitions */
.carousel-container,
.floating-buttons,
#mapOverlay {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Chevron container styles */
.chevron-container {
  display: flex;
  gap: 8px;
}

/* Mobile: stack chevrons vertically */
@media (max-width: 767px) {
  .chevron-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }
}

/* Show/hide chevron up based on carousel state */
.carousel-container:not(.hidden) ~ .floating-buttons .chevron-up {
  display: flex !important;
}

/* .carousel-container.hidden ~ .floating-buttons .chevron-up {
  display: none !important;
} */

/* When expanded, hide down chevron */
/* .carousel-container.expanded ~ .floating-buttons .chevron-down {
  display: none !important;
} */

/* Allineamento GPS con chevron più in basso */
@media (max-width: 767px) {
  .floating-buttons {
    align-items: flex-end !important;
    /* Allinea tutto al bottom */
  }

  .chevron-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    align-items: center !important;
  }

  /* GPS allineato con l'ultimo chevron visibile */
  .gps-button {
    align-self: flex-end !important;
  }
}

/* Desktop: mantieni allineamento orizzontale */
@media (min-width: 768px) {
  .floating-buttons {
    align-items: center !important;
  }

  .chevron-container {
    flex-direction: row !important;
    align-items: center !important;
  }
}

/* ===========================
   MAP SECTION
   =========================== */

.map-section {
  position: relative;
  height: 100vh;
  background: #171717;
}

img[src*="api.mapbox.com"] {
  filter: brightness(0.8);
}

/* ===========================
   MOBILE NAVIGATION
   =========================== */

.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background-color: rgb(23, 23, 23);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 24px;
  z-index: 200000;
  display: none;
}

.mobile-nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 24px;
}

.mobile-nav-btn {
  padding: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: white;
  transition: opacity 0.2s;
  height: 40px;
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-nav-btn:hover {
  opacity: 0.7;
}

.mobile-nav-search {
  border-radius: 9999px;
  background-color: #f5484d;
  width: 48px;
  height: 48px;
}

.mobile-nav-btn i {
  font-size: 20px;
}

.mobile-nav-btn svg {
  width: 24px;
  height: 24px;
}

nav button svg {
  fill: currentColor;
}

/* ===========================
   DRAWER STYLES
   =========================== */

.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, backdrop-filter 0.3s ease;
}

.drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.bottom-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1a1a1a;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  z-index: 200001 !important;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  max-height: calc(100vh - 56px);
  overflow: hidden;
  display: flex !important;
  flex-direction: column;
}

.bottom-drawer.active {
  transform: translateY(0);
}

.drawer-dragging {
  transition: none !important;
}

.drawer-handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  margin: 12px auto 8px;
  cursor: grab;
}

.drawer-header {
  position: sticky;
  top: 0;
  background: #1a1a1a;
  z-index: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 20px;
}

/* Prevent dragging on interactive elements */
.no-drag {
  touch-action: manipulation !important;
  user-select: none;
  -webkit-user-select: none;
}

/* Add active state feedback for buttons in drawer */
.drawer-content button:active,
.drawer-content .no-drag:active {
  opacity: 0.8;
  transform: scale(0.98);
}

body.drawer-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}
.cursor-pointer-car {
  cursor: pointer;
  transition: all 0.3s ease;
}
.cursor-pointer {
  cursor: pointer;
}
div.card-sec-2 {
  background-color: rgba(38, 38, 38, 0.5);
}
/* ===========================
   Z-INDEX HIERARCHY
   =========================== */

#filterPanel {
  /* z-index: 3100 !important; */
  z-index: 9999 !important;
}

#eventModal {
  z-index: 3000 !important;
}

#gymModal {
  z-index: 3000 !important;
}

#mainToggleContainer {
  z-index: 3200 !important;
}

#mobileToggle {
  z-index: 2400 !important;
}

header {
  z-index: 3200 !important;
}
/* GPU Acceleration Base */
.marker-container,
.orbital-marker,
.cluster-marker,
.carousel-card,
.carousel-scrollable,
.network-layer,
.connection-line,
.participant-dot,
.organizer-dot {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Containment for performance */
.carousel-scrollable {
  contain: layout style paint;
}

.carousel-card > div {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(15px) saturate(120%);
}

/* ===========================
   MOBILE BOTTOM NAV PIXEL-PERFECT
   =========================== */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background-color: rgb(23, 23, 23);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 24px;
  z-index: 200000;
  display: none;
}

.mobile-nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 24px;
}

.mobile-nav-btn {
  padding: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: white;
  transition: opacity 0.2s;
  height: 40px;
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-nav-btn:hover {
  opacity: 0.7;
}

.mobile-nav-search {
  border-radius: 9999px;
  background-color: #f5484d;
  width: 48px;
  height: 48px;
}

.mobile-nav-btn i {
  font-size: 20px;
}

.mobile-nav-btn svg {
  width: 24px;
  height: 24px;
}

nav button svg {
  fill: currentColor;
}

@media (min-width: 768px) {
  .mobile-bottom-nav {
    display: none;
  }
}

/* ===========================
   HEADER POSITIONING
   =========================== */

/* Z-INDEX HIERARCHY:
   - 1: Map section (base layer)
   - 1000: Mobile header & bottom nav
   - 2300: Map overlay (when carousel expanded)
   - 2600: Floating buttons
   - 3000: Desktop header & orbital satellite markers
   - 3100-3101: Carousel layers (highest, always above satellites)
   - 3200: Toggle bar (highest, always visible)
*/

/* Desktop Header */
.desktop-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  z-index: 3000;
  background: rgba(23, 23, 23, 0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Toggle Bar Container */
.toggle-bar-container {
  position: fixed !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 3200 !important;
  pointer-events: auto !important;
  width: auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 12px !important; /* Space between rows */
}

/* Desktop: position below header, centered on screen, with wider layout */
@media (min-width: 768px) {
  .toggle-bar-container {
    top: 96px !important; /* 80px header + 16px margin */
    width: 50% !important; /* 50% dello schermo per desktop */
    min-width: 600px !important; /* Larghezza minima per garantire leggibilità */
    max-width: 800px !important; /* Larghezza massima per evitare layout troppo esteso */
  }

  /* Su desktop, mostra sempre tutti i testi dei pulsanti (esclusi filter e search) */
  .toggle-button:not(.filter-button):not(.search-button) .button-text {
    display: inline !important;
    margin-left: 8px !important;
    white-space: nowrap !important;
  }

  /* Filter e search mantengono solo le icone anche su desktop */
  .filter-button .button-text,
  .search-button .button-text {
    display: none !important;
  }

  /* I pulsanti su desktop devono avere width auto per contenere testo + icona */
  .toggle-button:not(.filter-button):not(.search-button) {
    width: auto !important;
    min-width: 80px !important;
    padding: 8px 16px !important;
  }

  /* Assicura che i pulsanti abbiano spazio per il contenuto */
  .toggle-view-buttons {
    gap: 12px !important;
  }

  /* Su desktop, ignora la classe hidden per i button-text (esclusi filter e search) */
  .toggle-button:not(.filter-button):not(.search-button) .button-text.hidden {
    display: inline !important;
    opacity: 0.8 !important; /* Leggera trasparenza per i pulsanti non attivi */
  }

  .toggle-button:not(.filter-button):not(.search-button).active
    .button-text.hidden {
    opacity: 1 !important; /* Testo completamente opaco per il pulsante attivo */
  }
}

/* Mobile: position at top, centered on screen (no mobile header) */
@media (max-width: 767px) {
  .toggle-bar-container {
    top: 16px !important; /* 16px margin from top */
    left: 16px !important; /* 16px margin from left */
    right: 16px !important; /* 16px margin from right */
    width: auto !important; /* Auto width between left and right */
    transform: none !important; /* Remove center transform for mobile */
    max-width: none !important;
  }

  #mainToggleContainer {
    border: 1px solid rgba(155,155,155, 0.2) !important;
    width: 100% !important; /* Full width instead of fit-content */
    margin: 0 !important; /* Remove auto margin */
  }

  #normalToggleView {
    justify-content: space-between !important; /* Distribute buttons across full width */
    gap: 8px !important; /* Small gap between buttons */
  }

  .toggle-view-buttons {
    flex: 1 !important; /* Take up remaining space after filter button */
    justify-content: space-around !important; /* Distribute view buttons evenly */
    gap: 8px !important;
  }

  .toggle-button {
    flex: 1 !important; /* Each button takes equal space */
    min-width: 40px !important; /* Minimum size for touch targets */
  }

  /* Filter and search buttons stay 40px even on mobile */
  .filter-button,
  .search-button {
    flex: none !important; /* Override flex: 1 for filter/search buttons */
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
  }
}

/* Force visibility for toggle bar content */
.toggle-bar-container * {
  visibility: visible !important;
  opacity: 1 !important;
}

/* Mobile Header */
.mobile-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  z-index: 1000;
  background: rgba(23, 23, 23, 0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Show/hide headers based on screen size */
@media (min-width: 768px) {
  .mobile-header {
    display: none;
  }
}

@media (max-width: 767px) {
  .desktop-header {
    display: none;
  }
}

/* ===========================
   MAP SECTION
   =========================== */
.map-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
}

/* Desktop layout - map fullscreen but respect header space */
@media (min-width: 768px) {
  .map-section {
    top: 80px; /* Account for desktop header */
    height: calc(100vh - 80px);
  }
}

/* Mobile layout - no header, account only for bottom nav */
@media (max-width: 767px) {
  .map-section {
    top: 0; /* No mobile header, start from top */
    height: calc(100vh - 56px); /* Subtract only bottom nav */
  }

  .mobile-bottom-nav {
    display: block;
  }
}

/* ===========================
   MAPBOX CONTROLS HIDDEN
   =========================== */
/* Hide all Mapbox controls (zoom, navigation, etc.) */
.mapboxgl-ctrl-group,
.mapboxgl-ctrl-zoom-in,
.mapboxgl-ctrl-zoom-out,
.mapboxgl-ctrl-compass,
.mapboxgl-ctrl-geolocate,
.mapboxgl-ctrl-fullscreen,
.mapboxgl-ctrl-scale,
.mapboxgl-ctrl-attrib,
.mapboxgl-ctrl-logo {
  display: none !important;
}

/* ===========================
   ANIMATIONS
   =========================== */
/* Duplicate @keyframes removed for: pulse, ping, float, orbit, beaconPulse, pingSmall, premiumPulse, locationPulse, gpsPulse, singlePulse, and related animation blocks. */

/* ===========================
   NETWORK VISUALIZATION STYLES
   =========================== */

.network-layer {
  will-change: transform;
  contain: layout style paint;
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 500;
}

.network-layer.active {
  opacity: 1;
}

.connection-line {
  stroke: #9747ff;
  stroke-width: 0.6;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, stroke-width 0.2s ease;
  fill: none;
  stroke-dasharray: 2 3;
  animation: flowAnimation 3s linear infinite;
}

.connection-line:hover {
  stroke-width: 0.8;
}

.network-layer.hover-mode .connection-line {
  stroke-width: 0.1;
  transition: all 0.3s ease;
}

.network-layer .connection-group.active .connection-line {
  stroke-width: 0.3;
  opacity: 0.2;
}

.participant-dot,
.organizer-dot {
  transition: opacity 0.2s ease, r 0.2s ease, filter 0.3s ease;
  opacity: 0;
  visibility: hidden;
}

.participant-dot {
  fill: #b9ff66;
}

.network-layer.hover-mode .participant-dot,
.network-layer.hover-mode .organizer-dot {
  r: 1.5;
  opacity: 0.15;
  transition: all 0.3s ease;
}

.network-layer .connection-group.active .participant-dot,
.network-layer .connection-group.active .organizer-dot {
  r: 3;
  opacity: 0.7;
}

.organizer-line {
  stroke: #ffd700 !important;
  stroke-width: 0.5 !important;
  opacity: 0.2 !important;
  filter: none !important;
}

.organizer-dot {
  fill: #ffd700 !important;
  filter: none !important;
}

/* Connection group hover states */
.connection-group.hover-active .connection-line {
  opacity: 1 !important;
  visibility: visible !important;
  animation: flowAnimation 3s linear infinite !important;
}

.connection-group.hover-active .participant-dot,
.connection-group.hover-active .organizer-dot {
  opacity: 0.8 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  cursor: pointer !important;
}

.connection-group.hover-active {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Hover animations for satellite connections */
.hover-active-dot {
  animation: pulseGrow 1.5s ease-in-out infinite !important;
}

@keyframes pulseGrow {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.3);
    opacity: 1;
  }
}

/* Flow animation for connection lines */
@keyframes flowAnimation {
  0% {
    stroke-dashoffset: 0;
  }
  100% {
    stroke-dashoffset: 10;
  }
}

/* Network overlays */
.heatmap-overlay,
.virtual-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none !important;
}

.heatmap-overlay {
  background: radial-gradient(
    circle at var(--center-x, 50%) var(--center-y, 50%),
    rgba(151, 71, 255, 0.08) 0%,
    rgba(151, 71, 255, 0.04) 20%,
    rgba(151, 71, 255, 0.02) 40%,
    transparent 50%
  );
  opacity: 0;
  transition: opacity 0.5s ease;
}

.heatmap-overlay.active,
.heatmap-overlay.hover-active {
  opacity: 1 !important;
}

.virtual-overlay {
  background: radial-gradient(
    circle at center,
    transparent 0%,
    rgba(151, 71, 255, 0.1) 100%
  );
  animation: gridPulse 4s ease-in-out infinite;
}
/* Range Slider */
.slider {
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(90deg, #f5484d, #9747ff);
  border-radius: 5px;
  height: 6px;
  outline: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(45deg, #f5484d, #9747ff);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(45deg, #f5484d, #9747ff);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ===========================
   SCROLLBAR STYLING
   =========================== */
.scrollbar-thin {
  scrollbar-width: thin;
  scrollbar-color: rgba(156, 163, 175, 0.5) rgba(55, 65, 81, 0.5);
}

.scrollbar-thin::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.scrollbar-thin::-webkit-scrollbar-track {
  background: rgba(55, 65, 81, 0.5);
  border-radius: 3px;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
  background: rgba(156, 163, 175, 0.5);
  border-radius: 3px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
  background: rgba(156, 163, 175, 0.7);
}

/* ===========================
   TEXT UTILITIES
   =========================== */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-clamp: 2;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-clamp: 3;
}

/* ===========================
   CAROUSEL ENHANCEMENTS
   =========================== */
.carousel-card {
  flex: 0 0 320px;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  transition: transform 0.2s ease;
  z-index: 1 !important; /* Override z-index eccessivo con valore ragionevole */
  transform: translateZ(0);
}

.carousel-card:hover {
  transform: scale(1.02) translateZ(0);
}

.carousel-scrollable {
  scroll-snap-type: x mandatory;
}

.carousel-scrollable > * {
  scroll-snap-align: start;
}

/* ===========================
   CAROUSEL CARD PIXEL-PERFECT STYLES
   =========================== */

/* Ensure proper glassmorphism effect - override to match reference exactly */
.carousel-card > div {
  background: rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(15px) saturate(120%) !important;
  -webkit-backdrop-filter: blur(15px) saturate(120%) !important;
  border-radius: 0.75rem; /* 12px */
}

/* Ensure the gradient overlays work correctly */
.carousel-card .absolute.inset-0.bg-gradient-to-br {
  opacity: 0.05 !important;
}

/* ===========================
   END CAROUSEL CARD STYLES
   =========================== */

/* ===========================
   CAROUSEL CARD IMPROVEMENTS
   =========================== */

/* ===========================
   EXISTING CAROUSEL ENHANCEMENTS
   =========================== */

/* CUSTOM CSS FROM ORIGINAL HTML */

/* ===========================
   TOGGLE & UI COMPONENTS (removed duplicate - using the reference version below)
   =========================== */

/* Toggle buttons base */
.toggle-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  border-radius: 9999px;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.6);
  background: transparent;
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 16px;
  min-height: 40px;
  border: none;
}

.toggle-button:hover:not(.active) {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.1);
}

/* Toggle button active state */
.toggle-button.active {
  color: white;
  width: auto;
  padding: 8px 16px;
  gap: 8px;
  font-size: 14px;
}

/* Active state styling for different view modes */
.toggle-button.active[title*="All"] {
  background: rgb(110 110 110 / 40%) !important;
}

.toggle-button.active[title*="Indoor"] {
  background: linear-gradient(to right, #f5484d, #dc2626) !important;
}

.toggle-button.active[title*="Outdoor"] {
  background: linear-gradient(to right, #9ad746, #7fb935) !important;
}

.toggle-button.active[title*="Virtual"] {
  background: linear-gradient(to right, #9747ff, #ec4899) !important;
}

.toggle-button.active[title*="Board"] {
  background: linear-gradient(to right, #9747ff, #7c3aed) !important;
}

/* Filter and Search button active states */
.toggle-button.filter-button.active,
.toggle-button.search-button.active {
  background: rgba(255, 255, 255, 0.1);
}

/* Toggle button text */
.toggle-button .button-text {
  display: none;
}

.toggle-button.active .button-text {
  display: inline;
}

/* Toggle button icons */
.toggle-button i,
.toggle-button .board-icon {
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.toggle-button.active i,
.toggle-button.active .board-icon {
  transform: scale(1.1);
}

/* Filter and search buttons always maintain 40px width */
.filter-button,
.search-button {
  width: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  padding: 0 !important;
  flex-shrink: 0 !important;
}

/* Hide text for filter and search buttons even when active */
.filter-button .button-text,
.search-button .button-text {
  display: none !important;
}

/* Search input */
#mainSearchInput {
  background: transparent;
  border: none;
  outline: none;
  color: white;
  flex: 1;
  height: 40px;
  padding: 0 16px;
  font-size: 14px;
}

/* Search view buttons */
#searchToggleView button {
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  transition: all 0.2s ease;
  border: none;
  background: transparent;
  color: white;
  cursor: pointer;
}

#searchToggleView button:hover {
  background: rgba(255, 255, 255, 0.1);
}

#searchToggleView {
  display: none !important;
  align-items: center;
  width: 100%;
}

#searchToggleView.active {
  display: flex !important;
}

#normalToggleView.hidden {
  display: none !important;
}

/* ===========================
   BRAND COLORS & UTILITIES
   =========================== */

.brand-green {
  color: #b9ff66;
}

.brand-red {
  color: #f5484d;
}

.brand-purple {
  color: #9747ff;
}

.gradient-text {
  background: linear-gradient(to right, #f5484d, #9747ff, #b9ff66);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hover-scale {
  transition: transform 0.2s;
}

.hover-scale:hover {
  transform: scale(1.05);
}

.glass {
  background: rgba(38, 38, 38, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Animation utility classes */
.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-ping {
  animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-orbit {
  animation: orbit 20s linear infinite;
}

/* ===========================
   TOGGLE & UI COMPONENTS
   =========================== */

/* ===========================

   FLOATING BUTTONS
   =========================== */

/* REMOVED DUPLICATE - Base definition is at line 1267 */

/* Legacy .carousel-hidden class handled by sibling selector rules */

.button-minimal {
  width: 48px;
  height: 48px;
  background: rgb(70 70 70 / 60%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(155,155,155, 0.2) !important;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: rgba(255, 255, 255, 0.6);
  overflow: visible;
}

.button-minimal:hover {
  color: white;
  background: rgba(0, 0, 0, 0.7);
  transform: scale(1.1);
}

.button-minimal:active {
  transform: scale(0.95);
}

.chevron-button i {
  transition: transform 0.3s ease;
}

.gps-button i {
  font-size: 20px;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.gps-button.active {
  background: rgba(66, 133, 244, 0.2);
  color: #4285f4;
  box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.3);
}

.gps-button.loading {
  pointer-events: none;
}

.gps-button.loading i {
  animation: gpsPulse 1.5s ease-in-out infinite;
}

@keyframes gpsPulse {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes singlePulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.8;
  }
  100% {
    transform: translate(-50%, -50%) scale(3);
    opacity: 0;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.gps-accuracy-ring {
  position: absolute;
  width: 60px;
  height: 60px;
  border: 2px solid #4285f4;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
}

.gps-button.active .gps-accuracy-ring {
  animation: singlePulse 1.5s ease-out forwards;
}

/* User Location Marker */
.user-location-marker {
  width: 20px;
  height: 20px;
  position: relative;
}

.user-location-dot {
  width: 12px;
  height: 12px;
  background: #007cbf;
  border: 3px solid white;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 2px rgba(0, 124, 191, 0.3);
}

.user-location-pulse {
  position: absolute;
  /* inset: -6px; */
  border: 2px solid #007cbf;
  border-radius: 50%;
  animation: locationPulse 2s ease-out infinite;
}

@keyframes locationPulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(3);
    opacity: 0;
  }
}

/* Chevron container styles */
/* Chevron container: orizzontale su desktop, verticale su mobile */
.chevron-container {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
}

@media (max-width: 767px) {
  .chevron-container {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  /* Layout specifico mobile: GPS allineato con chevron down */
  .floating-buttons {
    justify-content: flex-start;
    align-items: flex-start;
    gap: 16px;
    position: relative;
  }

  /* GPS button posizionato alla stessa altezza del secondo chevron */
  .floating-buttons .gps-button {
    position: absolute;
    right: 16px;
    /* top: 56px; */
  }
}

/* REMOVED DUPLICATE TRANSITION - Transitions defined in base rules */

/* ===========================
   CAROUSEL STYLES
   =========================== */

/* REMOVED DUPLICATE - Base definition is at line 1191 */

.carousel-container.peek {
  animation: peekAnimation 1s ease-out;
}

.carousel-scrollable {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  height: 100%;
  padding: 0px;
  position: relative;
  pointer-events: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  z-index: 3101 !important;
}

.carousel-scrollable::-webkit-scrollbar {
  display: none;
}

.carousel-track {
  display: flex;
  gap: 16px;
  height: auto !important;
  padding: 0 20px;
}

.carousel-card {
  flex: 0 0 320px;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  transition: transform 0.2s ease;
  z-index: 1 !important; /* Override z-index eccessivo con valore ragionevole */
}

.carousel-card:hover {
  transform: scale(1.02);
}

/* Hidden state handled by wrapper .carousel-wrapper.carousel-hidden */

/* ===========================
   MAP OVERLAY
   =========================== */

/* Map overlay con z-index sotto i satelliti */
#mapOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(20px);
  transition: opacity 0.3s ease;
  z-index: 2300;
  pointer-events: auto;
}

/* ===========================
   EXPANDED CAROUSEL STYLES
   =========================== */

/* Expanded state handled by wrapper .carousel-wrapper.carousel-expanded */
.carousel-container.expanded {
  /* Height will expand to fill wrapper minus buttons and gap */
  height: calc(100vh - 80px - 48px - var(--wrapper-gap)) !important;
}

.carousel-container.expanded .carousel-scrollable {
  padding: 20px;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scroll-snap-type: none !important;
}

.carousel-container.expanded .carousel-track {
  display: flex;
  flex-direction: column !important;
  gap: 16px !important;
  padding: 80px 20px 20px 20px !important;
  height: auto;
}

.carousel-container.expanded .carousel-card {
  flex: none !important;
  width: 100% !important;
  max-width: none !important;
  scroll-snap-align: none !important;
}

/* Layout a griglia per desktop */
@media (min-width: 768px) {
  .carousel-container.expanded .carousel-track {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
    gap: 20px !important;
    padding: 82px 24px 24px 24px !important;
  }

  .carousel-container.expanded {
    height: calc(100vh - 75px) !important;
    /* 80px toggle + 60px header circa */
    top: auto !important;
  }
}
.new-home-ui .mapboxgl-marker.mapboxgl-marker-anchor-center
{
  z-index: 500 !important;
}
/* Floating buttons quando carousel è espanso - Desktop */
@media (min-width: 768px) {
  .carousel-container.expanded ~ .floating-buttons {
    bottom: 40px;
  }
}

/* Floating buttons quando carousel è espanso - Mobile */
@media (max-width: 767px) {
  .carousel-container.expanded ~ .floating-buttons {
    bottom: 120px;
  }
}

/* ===========================
   PEEK ANIMATION
   =========================== */

@keyframes peekAnimation {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

.carousel-container.peek {
  animation: peekAnimation 1s ease-out;
}

/* ===========================
   SCROLLBAR CUSTOMIZATION
   =========================== */

/* Custom scrollbar per carousel */
.carousel-scrollable::-webkit-scrollbar {
  display: none;
}

.carousel-scrollable {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ===========================
   RESPONSIVE ADJUSTMENTS
   =========================== */

/* Desktop adjustments */
@media (min-width: 768px) {
  .carousel-container {
    height: auto;
  }

  /* Wrapper handles positioning - no special rules needed */
}

/* Mobile adjustments */
@media (max-width: 767px) {
  /* Wrapper positioning for mobile */
  .carousel-wrapper {
    bottom: var(--wrapper-bottom-mobile);
  }

  .carousel-wrapper.carousel-expanded {
    padding-top: 60px; /* Less space needed on mobile */
    padding-bottom: var(--mobile-nav-height);
  }

  /* Carousel stays simple - wrapper handles positioning */
  .carousel-container {
    min-height: var(--carousel-height);
    height: var(--carousel-height);
  }

  /* Mobile expanded carousel */
  .carousel-container.expanded {
    /* Height fills wrapper minus top padding, buttons, gap, and bottom nav */
    height: calc(100vh - 60px - 48px - var(--wrapper-gap) - var(--mobile-nav-height)) !important;
  }

  .carousel-container.expanded .carousel-track {
    padding-bottom: 80px !important; /* Come nel main branch */
    /* Non override padding-top, mantiene 80px originale */
  }

  .carousel-card {
    flex: 0 0 300px;
  }
  
  .carousel-card .relative.p-4.space-y-3 {
    padding-bottom: 2rem !important; /* 32px invece di 16px */
  }

  .carousel-scrollable {
    scroll-padding: 0 20px;
  }

  .carousel-track {
    padding: 0 16px;
  }

  .floating-buttons {
    /* Simple - wrapper handles positioning */
    padding: 0 8px; /* 8px from borders */
  }

  /* Hide GPS button when carousel is expanded */
  .floating-buttons.carousel-expanded .gps-button {
    display: none !important;
  }
}

/* ===========================
   TOGGLE BAR & UI COMPONENTS  
   =========================== */

/* Container principale */
#mainToggleContainer {
  background: rgb(60 60 60 / 60%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(155,155,155, 0.2) !important;
  height: 48px;
  display: flex;
  align-items: center;
  padding: 4px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 9999px;
  width: fit-content;
  margin: 0 auto;
}

#mainToggleContainer.search-active {
  border: none !important;
}

/* Filter and search buttons always maintain 40px width */
.filter-button,
.search-button {
  width: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  padding: 0 !important;
  flex-shrink: 0 !important;
}

/* Hide text for filter and search buttons even when active */
.filter-button .button-text,
.search-button .button-text {
  display: none !important;
}

/* View containers */
#normalToggleView,
#searchToggleView {
  height: 40px;
  display: flex;
  align-items: center;
  width: 100%;
}

#searchToggleView {
  gap: 0.5rem;
  padding: 0 8px;
}

/* View buttons container */
.toggle-view-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Toggle buttons base */
.toggle-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  border-radius: 9999px;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.6);
  background: transparent;
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 16px;
  min-height: 40px;
  border: none;
}

.toggle-button:hover:not(.active) {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.1);
}

/* Toggle button active state */
.toggle-button.active {
  color: white;
  width: auto;
  padding: 8px 16px;
  gap: 8px;
  font-size: 14px;
  background: linear-gradient(135deg, #f5484d, #9747ff);
}

/* Active state styling for different view modes (come da reference) */
.toggle-button.active[title*="All"] {
  background: rgb(110 110 110 / 40%) !important;
}

.toggle-button.active[title*="Indoor"] {
  background: linear-gradient(to right, #f5484d, #dc2626) !important;
}

.toggle-button.active[title*="Outdoor"] {
  background: linear-gradient(to right, #9ad746, #7fb935) !important;
}

.toggle-button.active[title*="Virtual"] {
  background: linear-gradient(to right, #9747ff, #ec4899) !important;
}

.toggle-button.active[title*="Board"] {
  background: linear-gradient(to right, #9747ff, #7c3aed) !important;
}

/* Filter and Search button active states */
.toggle-button.filter-button.active,
.toggle-button.search-button.active {
  background: rgba(255, 255, 255, 0.1);
}

/* Toggle button text */
.toggle-button .button-text {
  display: none;
}

.toggle-button.active .button-text {
  display: inline;
}

/* Toggle button icons */
.toggle-button i,
.toggle-button .board-icon {
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.toggle-button.active i,
.toggle-button.active .board-icon {
  transform: scale(1.1);
}

/* Board icon */
.board-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Search input */
#mainSearchInput {
  background: transparent;
  border: none;
  outline: none;
  color: white;
  flex: 1;
  height: 40px;
  padding: 0 16px;
  font-size: 14px;
}

#mainSearchInput::placeholder {
  color: rgba(163, 163, 163, 1);
}

/* Search view buttons */
#searchToggleView button {
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  transition: all 0.2s ease;
  background: transparent;
  border: none;
  color: rgba(163, 163, 163, 1);
}

#searchToggleView button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

/* Mobile specific */
@media (max-width: 767px) {
  .toggle-button .button-text.hidden {
    display: none !important;
  }

  .toggle-button.active .button-text.hidden {
    display: none !important;
  }
}

/* Desktop specific */
@media (min-width: 768px) {
  .toggle-button .button-text {
    display: none;
  }

  .toggle-button.active .button-text:not(.hidden) {
    display: inline;
  }
}

/* ===========================
   DESKTOP HEADER (CLEAN)
   =========================== */

/* ===========================
   MODAL STYLES
   =========================== */

/* =========================== */
/* MODAL OVERLAY & CONTAINER   */
/* =========================== */

.new-home-ui .modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
  pointer-events: auto;
}
.new-home-ui .modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.new-home-ui .modal-container {
  position: relative;
  background: rgba(38, 38, 38, 0.98);
  border-radius: 24px;
  box-shadow: 0 8px 48px 0 rgba(0, 0, 0, 0.45),
    0 1.5px 6px 0 rgba(245, 72, 77, 0.1);
  max-width: 420px;
  width: 92vw;
  margin: 0 16px;
  padding: 0;
  overflow: hidden;
  z-index: 4100;
  animation: modalPopIn 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalPopIn {
  0% {
    transform: scale(0.92) translateY(40px);
    opacity: 0;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

@media (max-width: 480px) {
  .new-home-ui .modal-container {
    max-width: 98vw;
    border-radius: 16px;
    margin: 0 4px;
  }
}

/* =========================== */
/* MODAL HEADER                */
/* =========================== */
.new-home-ui .modal-header {
  position: relative;
  padding: 32px 24px 16px 24px;
  background: linear-gradient(
    180deg,
    rgba(23, 23, 23, 0.98) 60%,
    rgba(23, 23, 23, 0.7) 100%
  );
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  z-index: 1;
}
.new-home-ui .modal-header .modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
  line-height: 1.2;
}
.new-home-ui .modal-header .modal-subtitle {
  font-size: 1rem;
  color: #bdbdbd;
  font-weight: 400;
  margin-bottom: 0;
}

/* =========================== */
/* MODAL CLOSE BUTTON          */
/* =========================== */
.new-home-ui .modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  background: rgba(38, 38, 38, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  z-index: 2;
  transition: background 0.2s;
}
.new-home-ui .modal-close:hover {
  background: rgba(245, 72, 77, 0.9);
  color: #fff;
}

/* =========================== */
/* MODAL BODY                  */
/* =========================== */
.new-home-ui .modal-body {
  padding: 20px 24px 28px 24px;
  background: transparent;
  color: #e5e5e5;
  font-size: 1rem;
  line-height: 1.6;
}

/* =========================== */
/* MODAL FOOTER (if needed)    */
/* =========================== */
.new-home-ui .modal-footer {
  padding: 16px 24px 24px 24px;
  background: transparent;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* =========================== */
/* MODAL Z-INDEX FIX           */
/* =========================== */
#eventModal,
#gymModal,
.new-home-ui .modal-overlay,
.new-home-ui .modal-container {
  z-index: 4000 !important;
}

/* =========================== */
/* MODAL RESPONSIVE            */
/* =========================== */
@media (max-width: 480px) {
  .new-home-ui .modal-header,
  .new-home-ui .modal-body,
  .new-home-ui .modal-footer {
    padding-left: 12px;
    padding-right: 12px;
  }
  .new-home-ui .modal-header {
    padding-top: 24px;
    padding-bottom: 12px;
  }
  .new-home-ui .modal-footer {
    padding-bottom: 16px;
  }
}

/* =========================== */
/* CROWN STYLES (GYM TIER)     */
/* =========================== */
.crown-gold {
  color: #ffd700;
  filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.6));
}
.crown-silver {
  color: #c0c0c0;
  filter: drop-shadow(0 0 4px rgba(192, 192, 192, 0.6));
}
.crown-bronze {
  color: #cd7f32;
  filter: drop-shadow(0 0 4px rgba(205, 127, 50, 0.6));
}

/* ===========================
   DRAWER STYLES
   =========================== */

.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, backdrop-filter 0.3s ease;
}

.drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.bottom-drawer.active {
  transform: translateY(0);
}

.drawer-dragging {
  transition: none !important;
}

.drawer-handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  margin: 12px auto 8px;
  cursor: grab;
}

.drawer-header {
  position: sticky;
  top: 0;
  background: #1a1a1a;
  z-index: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.drawer-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* Responsive adjustments */
@media (max-width: 767px) {
  .drawer-overlay,
  .bottom-drawer {
    display: block;
  }
}

@media (min-width: 768px) {
  .drawer-overlay,
  .bottom-drawer {
    display: none !important;
  }
}

/* ===========================
   MARKER STYLES
   =========================== */

.marker-container {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
}

/* Transizioni solo dopo il posizionamento iniziale */
.marker-container:not(.initializing) {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Overflow hidden solo per marker fisici (non premium, non virtual, non user-location) */
.marker-container.physical-marker {
  border-radius: 50%;
  overflow: hidden;
}

/* Forza posizione immediata durante inizializzazione */
.marker-container.initializing {
  transition: none !important;
  opacity: 0;
}

/* Virtual markers devono essere sempre visibili per le animazioni orbital */
.marker-container.virtual-marker.initializing {
  opacity: 1;
}

.marker-container.positioned {
  opacity: 1;
  transition: opacity 0.2s ease;
}

.marker-container.repositioning {
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.marker-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 20px;
  color: white;
  position: relative;
  transition: transform 0.3s;
}

.marker-content:hover {
  transform: scale(1.2);
}

.marker-live-indicator {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

/* Live pulse effect */
/* Live marker pulse styles moved to mapMarkers.css */

/* Virtual Marker */
.virtual-marker-pulse {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  pointer-events: none;
}

.virtual-marker-pulse::before,
.virtual-marker-pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid #9747ff;
  border-radius: 50%;
  opacity: 0;
  animation: virtualPulse 3s ease-out infinite;
}

.virtual-marker-pulse::after {
  animation-delay: 1.5s;
}

/* Ensure non-live virtual markers are visible in global mode */
.virtual-marker:not(.orbital-marker) {
  z-index: 1500 !important;
}

/* Static virtual markers should always be visible */
.marker-container.virtual-marker.positioned {
  opacity: 1 !important;
}

/* NUOVO: Nascondi i satelliti orbitali durante l'inizializzazione */
.marker-container.virtual-marker.orbital-marker.initializing {
  opacity: 0 !important;
  transition: none !important;
}

/* Mostra i satelliti solo quando sono posizionati */
.marker-container.virtual-marker.orbital-marker.positioned {
  opacity: 1 !important;
  transition: opacity 0.3s ease !important;
}

/* Premium Gym Marker */
/* Premium marker styles moved to mapMarkers.css */

/* @keyframes premiumPulse moved to mapMarkers.css */

/* Cluster expand animation */
@keyframes clusterExpand {
  from {
    opacity: 0;
    transform: scale(0);
  }
  to {
    opacity: 0.9;
    transform: scale(0.8);
  }
}

/* Gym logo and event count badge styles moved to mapMarkers.css */

/* ===========================
   CAROUSEL CARD IMAGE OVERLAY & TEXT STYLES - PIXEL PERFECT
   =========================== */

/* Forza altezza costante per la sezione immagine */
.carousel-card .relative.h-32.overflow-hidden {
  height: 8rem !important; /* 128px - altezza costante come nel reference */
  min-height: 8rem !important;
  max-height: 8rem !important;
  overflow: hidden !important;
  position: relative !important;
}

/* Immagine sempre cover */
.carousel-card .relative.h-32.overflow-hidden img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
}

/* Overlay sfumato sempre visibile - SPECIFICO */
.carousel-card
  .relative.h-32.overflow-hidden
  .absolute.inset-0.bg-gradient-to-t {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.8) 0%,
    rgba(0, 0, 0, 0.4) 40%,
    transparent 100%
  ) !important;
  z-index: 10 !important;
  pointer-events: none !important;
  opacity: 1 !important;
}

/* Container dei testi sovrapposti - SPECIFICO */
.carousel-card
  .relative.h-32.overflow-hidden
  .absolute.bottom-2.left-2.right-2 {
  position: absolute !important;
  bottom: 0.5rem !important;
  left: 0.5rem !important;
  right: 0.5rem !important;
  z-index: 20 !important;
  color: white !important;
  pointer-events: none !important;
}

/* Titolo dell'evento - SPECIFICO */
.carousel-card
  .relative.h-32.overflow-hidden
  .absolute.bottom-2.left-2.right-2
  h3 {
  color: white !important;
  font-weight: 700 !important;
  font-size: 1rem !important; /* 16px - text-base */
  line-height: 1.25 !important;
  margin-bottom: 0.25rem !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8) !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* Sottotitolo per stage events - SPECIFICO */
.carousel-card
  .relative.h-32.overflow-hidden
  .absolute.bottom-2.left-2.right-2
  h3
  span {
  color: rgb(235, 235, 235) !important; /* sostituito da grigio chiaro */
  font-weight: 400 !important;
  font-size: 0.75rem !important; /* 12px - text-xs */
  display: block !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8) !important;
  line-height: 1.25 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Container per location e distanza - SPECIFICO */
.carousel-card
  .relative.h-32.overflow-hidden
  .absolute.bottom-2.left-2.right-2
  .flex.items-center.justify-between {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-top: 0.25rem !important;
}

/* Testo location - SPECIFICO */
.carousel-card
  .relative.h-32.overflow-hidden
  .absolute.bottom-2.left-2.right-2
  p {
  color: rgba(255, 255, 255, 0.95) !important; /* quasi bianco */
  font-size: 0.75rem !important; /* 12px - text-xs */
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8) !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.25rem !important;
  margin: 0 !important;
}

/* Testo distanza - SPECIFICO */
.carousel-card
  .relative.h-32.overflow-hidden
  .absolute.bottom-2.left-2.right-2
  span {
  color: rgba(255, 255, 255, 0.85) !important; /* bianco con opacità */
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Badge LIVE posizionato correttamente - SPECIFICO */
.carousel-card .relative.h-32.overflow-hidden .absolute.top-2.right-2 {
  position: absolute !important;
  top: 0.5rem !important;
  right: 0.5rem !important;
  z-index: 30 !important;
}

.carousel-card .relative.h-32.overflow-hidden .absolute.top-2.right-2 span {
  background: #f5484d !important;
  color: white !important;
  font-weight: 700 !important;
  font-size: 0.75rem !important; /* 12px - text-xs */
  padding: 0.25rem 0.5rem !important;
  border-radius: 9999px !important;
  box-shadow: 0 2px 8px rgba(245, 72, 77, 0.5) !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.25rem !important;
}

/* Animazione del dot nel badge LIVE - SPECIFICO */
.carousel-card
  .relative.h-32.overflow-hidden
  .absolute.top-2.right-2
  span
  .w-2.h-2 {
  width: 0.5rem !important;
  height: 0.5rem !important;
  background: white !important;
  border-radius: 50% !important;
  animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite !important;
}

/* ===========================
   FORCE VISIBILITY - ULTRA SPECIFIC FOR IMAGE OVERLAYS
   =========================== */

/* FORZA OVERLAY SFUMATO - MASSIMA SPECIFICITÀ */
.carousel-track
  .carousel-card
  .relative.h-32.overflow-hidden
  .absolute.inset-0.bg-gradient-to-t {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.2) 30%,
    rgba(0, 0, 0, 0.6) 70%,
    rgba(0, 0, 0, 0.8) 100%
  ) !important;
  z-index: 10 !important;
  pointer-events: none !important;
  opacity: 1 !important;
  display: block !important;
  visibility: visible !important;
}

/* FORZA TESTI SOVRAPPOSTI - MASSIMA SPECIFICITÀ */
.carousel-track
  .carousel-card
  .relative.h-32.overflow-hidden
  .absolute.bottom-2.left-2.right-2 {
  position: absolute !important;
  bottom: 0.5rem !important;
  left: 0.5rem !important;
  right: 0.5rem !important;
  z-index: 20 !important;
  color: white !important;
  pointer-events: auto !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* FORZA VISIBILITÀ TITOLO */
.carousel-track
  .carousel-card
  .relative.h-32.overflow-hidden
  .absolute.bottom-2.left-2.right-2
  h3 {
  color: white !important;
  font-weight: 700 !important;
  font-size: 1rem !important;
  line-height: 1.25 !important;
  margin: 0 0 0.25rem 0 !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8) !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* FORZA VISIBILITÀ CONTAINER LOCATION/DISTANZA */
.carousel-track
  .carousel-card
  .relative.h-32.overflow-hidden
  .absolute.bottom-2.left-2.right-2
  .flex.items-center.justify-between {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-top: 0.25rem !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* FORZA VISIBILITÀ TESTO LOCATION */
.carousel-track
  .carousel-card
  .relative.h-32.overflow-hidden
  .absolute.bottom-2.left-2.right-2
  p {
  color: rgb(235, 235, 235) !important;
  font-size: 0.75rem !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8) !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.25rem !important;
  margin: 0 !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* FORZA VISIBILITÀ TESTO DISTANZA */
.carousel-track
  .carousel-card
  .relative.h-32.overflow-hidden
  .absolute.bottom-2.left-2.right-2
  span {
  color: rgb(235, 235, 235) !important;
  font-size: 0.75rem !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8) !important;
  display: inline !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* ===========================
   END FORCE VISIBILITY
   =========================== */

/* ===========================
   CAROUSEL CARD INFO/STATS SECTION - PIXEL PERFECT
   =========================== */

/* Container principale della sezione info */
.carousel-card .relative.p-4.space-y-3 {
  padding: 1rem !important;
  gap: 0.75rem !important;
  display: flex !important;
  flex-direction: column !important;
}

/* Type Badge and Trending container */
.carousel-card
  .relative.p-4.space-y-3
  .flex.items-center.justify-between:first-child {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 0.75rem !important;
}

/* Type Badge */
.carousel-card .relative.p-4.space-y-3 .inline-flex.items-center.gap-1\.5 {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.375rem !important;
  padding: 0.25rem 0.625rem !important;
  border-radius: 9999px !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  color: white !important;
}

/* Badge Type Colors - FORCE SOLID COLORS */
.carousel-card
  .relative.p-4.space-y-3
  .bg-gradient-to-r.from-\[#9747FF\].to-purple-600,
.carousel-card .inline-flex.bg-gradient-to-r.from-\[#9747FF\].to-purple-600 {
  background: #9747ff !important;
}

.carousel-card
  .relative.p-4.space-y-3
  .bg-gradient-to-r.from-\[#F5484D\].to-red-600,
.carousel-card .inline-flex.bg-gradient-to-r.from-\[#F5484D\].to-red-600 {
  background: #f5484d !important;
}

.carousel-card
  .relative.p-4.space-y-3
  .bg-gradient-to-r.from-\[#9AD746\].to-\[#7FB935\],
.carousel-card .inline-flex.bg-gradient-to-r.from-\[#9AD746\].to-\[#7FB935\] {
  background: linear-gradient(135deg, #9ad746 0%, #7fb935 100%) !important;
}

.carousel-card
  .relative.p-4.space-y-3
  .bg-gradient-to-r.from-neutral-500.to-neutral-600,
.carousel-card .inline-flex.bg-gradient-to-r.from-neutral-500.to-neutral-600 {
  background: linear-gradient(135deg, #737373 0%, #525252 100%) !important;
}

/* Board icon sizing */
.carousel-card .board-icon {
  width: 14px !important;
  height: 14px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.carousel-card .board-icon svg {
  width: 100% !important;
  height: 100% !important;
}

/* Trending badge */
.carousel-card .relative.p-4.space-y-3 .text-\[#B9FF66\] {
  color: #b9ff66 !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.25rem !important;
}

/* Stats Grid */
.carousel-card .relative.p-4.space-y-3 .grid.grid-cols-2.gap-2.text-xs {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 0.5rem !important;
  font-size: 0.75rem !important;
  margin-bottom: 0.75rem !important;
}

/* Stats Grid Items */
.carousel-card
  .relative.p-4.space-y-3
  .grid.grid-cols-2.gap-2.text-xs
  .flex.items-center.gap-1\.5 {
  display: flex !important;
  align-items: center !important;
  gap: 0.375rem !important;
  color: rgb(235, 235, 235) !important; /* sostituito da grigio chiaro */
}

/* Stats Grid Icons */
.carousel-card .relative.p-4.space-y-3 .grid.grid-cols-2.gap-2.text-xs i {
  font-size: 0.75rem !important;
  color: inherit !important;
  flex-shrink: 0 !important;
  width: auto !important;
  text-align: center !important;
}

/* Stats Grid Text */
.carousel-card .relative.p-4.space-y-3 .grid.grid-cols-2.gap-2.text-xs span {
  color: inherit !important;
  font-size: 0.75rem !important;
  line-height: 1.25 !important;
}

/* Duration Bar Container */
.carousel-card .relative.p-4.space-y-3 .space-y-1 {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.25rem !important;
}

/* Duration Bar Header */
.carousel-card
  .relative.p-4.space-y-3
  .space-y-1
  .flex.justify-between.text-xs {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  font-size: 0.75rem !important;
}

/* Duration Bar Labels */
.carousel-card .relative.p-4.space-y-3 .space-y-1 .text-neutral-400 {
  color: rgb(235, 235, 235) !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.25rem !important;
}

.carousel-card .relative.p-4.space-y-3 .space-y-1 .text-neutral-300 {
  color: rgb(235, 235, 235) !important;
  font-weight: 500 !important;
}

/* Text neutral 500 - Used for concluded status */
.carousel-card .relative.p-4.space-y-3 .space-y-1 .text-neutral-500 {
  color: rgb(235, 235, 235) !important;
  font-weight: 500 !important;
}

/* Duration Bar Progress */
.carousel-card .relative.p-4.space-y-3 .space-y-1 .h-2.bg-white\/10 {
  height: 0.5rem !important;
  background: rgba(255, 255, 255, 0.1) !important;
  border-radius: 9999px !important;
  overflow: hidden !important;
}

.carousel-card .relative.p-4.space-y-3 .space-y-1 .h-2.bg-white\/10 div {
  height: 100% !important;
  border-radius: 9999px !important;
  transition: width 0.5s ease !important;
}

/* ===========================
   ADDRESS SCROLLING ANIMATION
   =========================== */

/* Container per scrolling indirizzo nell'overlay */
.carousel-card .address-scroll-container {
  overflow: hidden;
  width: 100%;
  position: relative;
}

.carousel-card .address-scroll-container p {
  white-space: nowrap !important;
  overflow: hidden;
  width: 100%;
  margin: 0 !important;
}

.carousel-card .address-content {
  display: inline-block;
  padding-left: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 20px); /* Lascia spazio per l'icona */
}

/* Animazione al hover - solo se il testo è troncato */
.carousel-card:hover .address-scroll-container .address-content.is-truncated {
  animation: scrollAlternate 8s linear infinite;
}

/* Animazione alternata */
@keyframes scrollAlternate {
  0%, 10% {
    transform: translateX(0);
  }
  40%, 50% {
    transform: translateX(calc(-100% + 150px)); /* Scorre a sinistra mostrando la parte nascosta */
  }
  80%, 90% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(0);
  }
}

/* Ottimizzazione per mobile */
@media (max-width: 768px) {
  .carousel-card .address-content {
    font-size: 0.7rem !important;
  }
  
  @keyframes scrollAlternate {
    0%, 10% {
      transform: translateX(0);
    }
    40%, 50% {
      transform: translateX(calc(-100% + 100px)); /* Meno spazio su mobile */
    }
    80%, 90% {
      transform: translateX(0);
    }
    100% {
      transform: translateX(0);
    }
  }
}

/* Fix per evitare jump dell'icona durante l'animazione */
.carousel-card .address-scroll-container svg {
  flex-shrink: 0;
}

/* Distance info styling */
.carousel-card .distance-info {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.25rem !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  min-width: fit-content !important;
}

.carousel-card .distance-info svg {
  flex-shrink: 0 !important;
}

/* ===========================
   UPCOMING EVENT PROGRESS BARS
   =========================== */

/* Empty progress bar pulse effect for registration open events */
.carousel-card .h-2.bg-white\/10 .animate-pulse {
  animation: registrationPulse 2s ease-in-out infinite;
}

@keyframes registrationPulse {
  0%, 100% {
    opacity: 0.4;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
  50% {
    opacity: 0.8;
    box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.3);
  }
}

/* ===========================

   GLOBAL BADGE GRADIENT FIXES
   =========================== */

/* Force solid colors for badges globally */
.new-home-ui .inline-flex.bg-gradient-to-r.from-\[#9747FF\] {
  background: #9747ff !important;
}

.new-home-ui .inline-flex.bg-gradient-to-r.from-\[#F5484D\] {
  background: #f5484d !important;
}

.new-home-ui .inline-flex.bg-gradient-to-r.from-\[#9AD746\] {
  background: linear-gradient(135deg, #9ad746 0%, #7fb935 100%) !important;
}

.new-home-ui .inline-flex.bg-gradient-to-r.from-neutral-500 {
  background: linear-gradient(135deg, #737373 0%, #525252 100%) !important;
}

/* ===========================
   END GLOBAL BADGE FIXES
   =========================== */

/* ===========================
   CARD BACKGROUND COLOR TINTS
   =========================== */

/* Virtual/Board events - Purple tint */
.carousel-card[data-event-type="virtual"] > div {
  background: rgba(180, 125, 250, 0.1) !important;
}

/* Board events - Purple tint */
.carousel-card[data-event-type="board"] > div {
  background: rgba(180, 125, 250, 0.1) !important;
}

/* Indoor events - Red tint */
.carousel-card[data-event-type="indoor"] > div {
  background: rgba(235, 155, 155, 0.1) !important;
}

/* Outdoor events - Green tint */
.carousel-card[data-event-type="outdoor"] > div {
  background: rgba(185, 215, 145, 0.15) !important;
}

/* ===========================
   BOARD MARKER SYSTEM
   =========================== */

/* Virtual marker pulse system */
.virtual-marker-pulse {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(151, 71, 255, 0.3) 0%,
    transparent 70%
  );
  animation: virtualPulse 2s ease-in-out infinite;
  z-index: -1;
}

/* Board marker specific styles */
.virtual-marker .marker-content {
  background: linear-gradient(135deg, #9747ff, #7c3aed) !important;
  box-shadow: 0 0 20px rgba(151, 71, 255, 0.4);
}

.virtual-marker.static-virtual-marker .marker-content {
  box-shadow: none;
}

/* Global satellite markers */
.global-satellite .marker-content {
  box-shadow: 0 0 20px rgba(151, 71, 255, 0.6);
}

.global-satellite .virtual-marker-pulse {
  animation-duration: 2s;
}

.global-satellite.orbital-marker .marker-content {
  background: linear-gradient(135deg, #9747ff, #5c2aed) !important;
}

/* Board icon styling */
.board-icon {
  position: relative;
  z-index: 2;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.board-icon svg {
  width: 100%;
  height: 100%;
  fill: white;
}

/* Orbital dots for complex animations */
.orbit-dot {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #9747ff;
  border-radius: 50%;
  opacity: 0.6;
  animation: orbit 20s linear infinite;
}

/* Map movement optimizations */
.mapboxgl-moving .animate-orbit,
/* Virtual marker pulse animation state moved to mapMarkers.css */

.mapboxgl-moving .network-layer {
  opacity: 0 !important;
  transition: none;
}

/* Priority system for markers */
.marker-priority-high {
  z-index: 2500 !important;
}

.marker-priority-medium {
  z-index: 2200 !important;
}

.marker-priority-low {
  z-index: 1900 !important;
}

/* ===========================
   CAROUSEL CARD TEXT STYLES
   =========================== */

/* Card titles and text styles to match reference exactly */
.carousel-card .absolute.bottom-2.left-2.right-2 h3 {
  color: white;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.25;
}

.carousel-card .absolute.bottom-2.left-2.right-2 h3 span {
  color: rgb(235, 235, 235);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-weight: 400;
  font-size: 0.75rem;
  line-height: 1rem;
}

.carousel-card .absolute.bottom-2.left-2.right-2 p {
  color: rgba(255, 255, 255, 0.95);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 0.75rem;
  line-height: 1rem;
}

.carousel-card .absolute.bottom-2.left-2.right-2 span {
  color: rgba(255, 255, 255, 0.8);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Stats grid text styling */
.carousel-card .grid.grid-cols-2.gap-2.text-xs span {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: rgb(235, 235, 235);
}

/* Duration bar text styling */
.carousel-card .space-y-1 .flex.justify-between.text-xs span {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* ===========================
   GRID CONTEXT CSS OVERRIDES
   For EventCard in UserProfile/GymProfile pages
   =========================== */

/* Grid card base styling - matches carousel-card */
.grid-card {
  width: 100%;
  height: 420px;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

/* Copy all carousel-card styles to grid-card */
.grid-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Grid-specific layout adjustments */
.created-rumble-grid-container .grid-card {
  width: 100%;
  height: auto;
  min-height: 420px;
}

/* Event type background tints for grid cards */
.grid-card[data-event-type="virtual"] > div,
.grid-card[data-event-type="board"] > div {
  background: rgba(180, 125, 250, 0.1) !important;
}

.grid-card[data-event-type="indoor"] > div {
  background: rgba(235, 155, 155, 0.1) !important;
}

.grid-card[data-event-type="outdoor"] > div {
  background: rgba(185, 215, 145, 0.15) !important;
}

/* Copy glassmorphism effects */
.grid-card .card-sec-2 {
  background: rgba(47, 51, 56, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Title container adjustments for settings button */
.grid-card .rumble-box-title-container {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

/* Ensure all text styles match */
.grid-card h3,
.grid-card p,
.grid-card span {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Match all hover states and transitions */
.grid-card .position-relative.overflow-hidden.rounded-4 {
  border-radius: 16px;
  overflow: hidden;
}

/* Live status badge styling */
.grid-card .absolute.top-2.right-2 span {
  background: #F5484D;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Type badge gradient matching */
.grid-card .inline-flex.items-center {
  background-image: var(--event-gradient);
}

/* Progress bar animations */
.grid-card .h-2.bg-white\/10.rounded-full {
  background: rgba(255, 255, 255, 0.1);
}

/* Responsive adjustments for grid */
@media (max-width: 768px) {
  .created-rumble-grid-container {
    grid-template-columns: 1fr;
  }
  
  .grid-card {
    width: 100%;
    max-width: 100%;
  }
}

/* Settings dropdown specific styling for grid context */
.grid-card .dropdown-toggle {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  padding: 4px;
  transition: all 0.2s ease;
}

.grid-card .dropdown-toggle:hover {
  color: rgba(255, 255, 255, 1);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* ===========================
   SISTEMA LAYERING BEN DEFINITO
   =========================== */

/* Reset z-index per evitare conflitti */
.grid-card,
.carousel-card {
  position: relative;
  z-index: 1;
}

/* Hover state con leggero aumento */
.grid-card:hover,
.carousel-card:hover {
  z-index: 2; /* Minimo incremento per hover */
}

/* MUI Dropdown usa il suo z-index standard (1300) */
/* Non serve override, funziona già correttamente */


/* Map Toggle Row Styling */
.map-toggle-row {
  display: flex;
  justify-content: center;
  width: 100%;
}

/* Adjust map toggle when inside toggle bar container */
.toggle-bar-container .map-style-toggle-pill {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
  opacity: 0.9 !important;
  transition: opacity 0.2s ease !important;
}

.toggle-bar-container .map-style-toggle-pill:hover {
  opacity: 1 !important;
}

/* Ensure proper spacing on mobile */
@media (max-width: 767px) {
  .toggle-bar-container {
    gap: 8px !important; /* Smaller gap on mobile */
  }

  .map-toggle-row {
    padding: 0 8px; /* Add some horizontal padding on mobile */
  }
}

/* ===========================
   LIVE EVENT MAP MARKER STYLES
   =========================== */

/* Live marker info container - positioned badge */
.marker-info {
  position: absolute;
  top: -8px;
  right: -8px;
  z-index: 10;
  pointer-events: none; /* Don't interfere with marker clicks */
}

/* Base marker label styles */
.marker-label {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: bold;
  font-family: "DINBold", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1;
}

/* Live label specific styles with high specificity */
.marker-label.live-label {
  background: linear-gradient(135deg, #ff4458 0%, #ff6b6b 100%);
  color: white;
  animation: pulse-live 2s ease-in-out infinite;
  box-shadow: 0 2px 8px rgba(255, 68, 88, 0.4);
}

/* Pulse animation for live events */
@keyframes pulse-live {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.9;
  }
}

/* ===========================
   HEIGHT-BASED RESPONSIVE
   =========================== */

/* Short screens */
@media (max-height: 700px) {
  :root {
    --card-height: 240px;
  }
}

/* Tall screens */
@media (min-height: 900px) {
  :root {
    --card-height: 300px;
  }
}

/* ===========================
   iOS SAFE AREA SUPPORT
   =========================== */

@supports (padding: env(safe-area-inset-bottom)) {
  /* Handle safe area separately for mobile devices with notch/home indicator */

  /* Mobile wrapper with safe area */
  @media (max-width: 767px) {
    .carousel-wrapper {
      /* Add safe area to the fixed 64px value */
      bottom: calc(var(--wrapper-bottom-mobile) + env(safe-area-inset-bottom, 0));
    }

    .floating-buttons {
      padding-left: max(8px, var(--safe-left));
      padding-right: max(8px, var(--safe-right));
    }
  }
}

/* ===========================
   RESPONSIVE BREAKPOINTS
   =========================== */

/* iPhone SE and small phones */
@media (max-width: 375px) and (max-height: 667px) {
  :root {
    --card-height: 240px;
  }
}

/* Landscape mobile */
@media (max-width: 896px) and (max-height: 414px) and (orientation: landscape) {
  .carousel-wrapper {
    /* Use same fixed value approach for landscape */
    bottom: 64px; /* Simple fixed value */
  }

  .carousel-container {
    height: calc(var(--card-height) + 16px);
  }
}

/* iPad and tablets - wrapper handles positioning, no special rules needed */
