/**
 * @license
 * SPDX-License-Identifier: Apache-2.0
*/

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  overflow: hidden; /* Evita barre di scorrimento non necessarie */
}

#map {
  height: 100%;
  width: 100%;
  cursor: grab;
}

#map.add-spot-mode {
  cursor: crosshair;
}

.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: white;
  color: #333;
  box-shadow: 0 3px 14px rgba(0,0,0,0.4);
}

/* --- Notification Banner --- */
#notification {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000; /* Assicura che sia sopra la mappa */
  background-color: rgba(255, 235, 59, 0.95); /* Giallo avviso semi-trasparente */
  color: #333;
  padding: 12px 40px 12px 20px; /* Più padding a destra per il pulsante chiudi */
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
  text-align: center;
  max-width: 90%;
  font-size: 0.9em;
  border: 1px solid #f0e68c;
  display: flex;
  align-items: center;
}

#notification-close {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #555;
  padding: 0 5px;
}

#notification-close:hover {
  color: #000;
}

.hidden {
  display: none !important;
}

/* Status overlay */
#app-status {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2000;
  background: rgba(255,255,255,0.95);
  border: 1px solid #ccc;
  padding: 8px 10px;
  border-radius: 6px;
  color: #333;
  font-size: 14px;
}

/* --- Map Controls --- */
.map-controls {
  position: absolute;
  top: 15px;
  right: 10px; /* Modificato da 'left' a 'right' */
  z-index: 800;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-controls button {
  background-color: white;
  border: 2px solid rgba(0,0,0,0.2);
  border-radius: 4px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  box-shadow: 0 1px 5px rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.map-controls button svg {
  width: 20px;
  height: 20px;
  color: #333;
}

.map-controls button:hover {
  background-color: #f4f4f4;
}

/* --- Spot Modal --- */
#spot-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
}

#spot-modal {
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  width: 90%;
  max-width: 450px;
}

#spot-modal h2 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 1.5em;
  color: #333;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #555;
}

.form-group input[type="text"],
.form-group select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box; /* Cruciale per il padding */
}

.form-group input[type="file"] {
  padding: 5px;
}

#image-preview-container {
  margin-top: 10px;
  text-align: center;
}

#image-preview {
  max-width: 100%;
  max-height: 150px;
  border-radius: 6px;
  border: 1px solid #ddd;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.form-actions button {
  padding: 10px 20px;
  border-radius: 6px;
  border: none;
  font-size: 1em;
  cursor: pointer;
  font-weight: 600;
}

.form-actions button[type="submit"] {
  background-color: #28a745;
  color: white;
}
.form-actions button[type="submit"]:hover {
  background-color: #218838;
}

.form-actions button[type="button"] {
  background-color: #f0f0f0;
  color: #333;
  border: 1px solid #ccc;
}
.form-actions button[type="button"]:hover {
  background-color: #e0e0e0;
}

/* --- Custom Spot Marker Icons --- */
.spot-marker-icon {
  font-size: 28px;
  text-shadow: 0 0 3px black;
}

/* --- Spot Popup Content --- */
.spot-popup-content {
  text-align: center;
}

.spot-popup-content h3 {
  margin: 5px 0;
}

.spot-popup-content img {
  max-width: 200px;
  border-radius: 5px;
  margin-top: 10px;
}

.spot-popup-actions {
  margin-top: 15px;
  display: flex;
  justify-content: space-around;
}

.spot-popup-actions button {
  background: none;
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 5px 10px;
  cursor: pointer;
}

.spot-popup-actions .confirm { border-color: #28a745; color: #28a745; }
.spot-popup-actions .deny { border-color: #dc3545; color: #dc3545; }

.spot-popup-score {
  margin-top: 10px;
  font-size: 0.9em;
  color: #666;
}