/**
 * Stili per la visualizzazione geografica (View 3)
 */

/* Container della mappa */
.map-container {
  position: relative;
  width: 100%;
  height: 600px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Mappa Leaflet */
#map3 {
  width: 100%;
  height: 100%;
  background-color: #f8f9fa;
}

/* Controlli della mappa */
.map-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-control-btn {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #2c3e50;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.map-control-btn:hover {
  background: rgba(255, 255, 255, 1);
  border-color: #3498db;
  color: #3498db;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.map-control-btn:active {
  transform: translateY(0);
}

/* Bottone fullscreen */
.fullscreen-btn {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 12px;
}

.fullscreen-btn:hover {
  background: linear-gradient(135deg, #2980b9, #1f5f8b);
  color: white;
}

/* Stato fullscreen */
.map-container.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  border-radius: 0;
  background-color: #000;
}

/* Container mappa fullscreen */
#map3-fullscreen {
  width: 100% !important;
  height: 100% !important;
  visibility: visible !important;
  display: block !important;
}

/* Assicurati che la mappa sia visibile */
#map3 {
  width: 100% !important;
  height: 100% !important;
  visibility: visible !important;
  display: block !important;
}

/* Nascondi controlli in fullscreen */
.map-container.fullscreen .map-controls {
  display: none !important;
}

/* Nascondi info box in fullscreen */
.map-container.fullscreen .map-info {
  display: none !important;
}

/* Nascondi hint di uscita in fullscreen (ridondante con ESC) */
.map-container.fullscreen .fullscreen-exit-hint {
  display: none !important;
}



/* Hint per uscita fullscreen */
.fullscreen-exit-hint {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  z-index: 10000;
  backdrop-filter: blur(10px);
  animation: fadeInOut 2s ease-in-out infinite;
}

/* Messaggio informativo fullscreen */
.fullscreen-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 15px 25px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  z-index: 10001;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  text-align: center;
  max-width: 400px;
  line-height: 1.4;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* Popup della mappa */
.map-popup {
  font-family: var(--font-primary);
  max-width: 300px;
}

.map-popup h3 {
  margin: 0 0 8px 0;
  color: #2c3e50;
  font-size: 16px;
  font-weight: 600;
}

.map-popup p {
  margin: 0 0 12px 0;
  color: #7f8c8d;
  font-size: 13px;
}

.map-popup div {
  border-bottom: 1px solid #ecf0f1;
  padding: 8px 0;
  transition: background-color 0.2s ease;
}

.map-popup div:hover {
  background-color: #f8f9fa;
}

.map-popup div:last-child {
  border-bottom: none;
}

/* Marker personalizzati con forma pin classica */
.custom-pin-marker {
  background: transparent !important;
  border: none !important;
}

.custom-pin-marker svg {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  transition: transform 0.2s ease;
}

.custom-pin-marker:hover svg {
  transform: scale(1.1);
}

/* Info box della mappa */
.map-info {
  position: absolute;
  top: 10px;
  left: 60px; /* Spostato verso destra per evitare i controlli di zoom */
  background: rgba(255, 255, 255, 0.95);
  border-radius: 6px;
  padding: 12px 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  z-index: 1000;
  max-width: 250px;
}

.map-info h4 {
  margin: 0 0 8px 0;
  color: #2c3e50;
  font-size: 14px;
  font-weight: 600;
}

.map-info p {
  margin: 0;
  color: #7f8c8d;
  font-size: 12px;
  line-height: 1.4;
}

/* Loading indicator per la mappa */
.map-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.map-loading .spinner {
  width: 30px;
  height: 30px;
  border: 3px solid #ecf0f1;
  border-top: 3px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
  .map-container {
    height: 400px;
  }
  
  .map-controls {
    top: 5px;
    right: 5px;
  }
  
  .map-control-btn {
    padding: 6px 10px;
    font-size: 12px;
  }
  
  .map-info {
    max-width: 200px;
    padding: 8px 12px;
  }
}

/* Modalità fullscreen su mobile */
@media (max-width: 768px) {
  .map-container.fullscreen {
    height: 100vh;
  }
  
  .map-controls {
    position: fixed;
    top: 20px;
    right: 20px;
  }
  
  .map-info {
    position: fixed;
    top: 20px;
    left: 20px;
  }
}

/* Box informativo fullscreen */
.fullscreen-info-box {
  position: absolute;
  bottom: 0px;
  left: 0px;
  width: 25%;
  min-width: 400px;
  height: 80px;
  background-color: #e6316c; /* Magenta come i pin */
  border-radius: 0px;
  box-shadow: 0 4px 15px rgba(230, 49, 108, 0.3);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: left;
}

.fullscreen-info-content {
  color: white;
  font-family: var(--font-primary);
  font-size: 1.5rem;
  font-weight: var(--font-weight-bold);
  text-align: left;
  padding: 0 20px;
  line-height: 1.2;
}

/* Responsive per il box fullscreen */
@media (max-width: 768px) {
  .fullscreen-info-box {
    width: calc(100% - 40px);
    min-width: auto;
    left: 20px;
    right: 20px;
  }
}
