/**
 * Stili per Sistema di Geolocalizzazione
 * CSS specifico per interfaccia geolocalizzazione
 */

/* Modale Geolocalizzazione */
.geolocation-modal {
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
}

.geolocation-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #e0e0e0;
  background: #f8f9fa;
}

.geolocation-modal .modal-body {
  padding: 20px;
}

.geolocation-modal .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px;
  border-top: 1px solid #e0e0e0;
  background: #f8f9fa;
}

/* Sezioni Metodi */
.geolocation-method {
  margin-bottom: 30px;
  padding: 20px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
}

.geolocation-method h3 {
  margin: 0 0 15px 0;
  color: #2f6b2f;
  font-size: 16px;
  font-weight: 600;
}

/* Form Indirizzo Strutturato */
.address-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

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

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 5px;
  font-weight: 500;
  color: #333;
  font-size: 14px;
}

.form-group input {
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #2f6b2f;
  box-shadow: 0 0 0 2px rgba(47, 107, 47, 0.1);
}

/* Form Coordinate */
.coordinates-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

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

/* Risultati Ricerca */
.search-results {
  margin-top: 15px;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
}

.search-result-item {
  padding: 12px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: #f8f9fa;
}

.result-address {
  font-weight: 500;
  color: #333;
}

.result-coordinates {
  font-size: 12px;
  color: #666;
  font-family: monospace;
}

.result-accuracy {
  font-size: 12px;
  color: #2f6b2f;
}

/* Anteprima Risultati */
.preview-container {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  margin-top: 15px;
}

.preview-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 15px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #e0e0e0;
}

.info-item:last-child {
  border-bottom: none;
}

.info-item .label {
  font-weight: 500;
  color: #333;
  min-width: 100px;
}

.info-item .value {
  color: #666;
  font-family: monospace;
  text-align: right;
  flex: 1;
}

.preview-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* Pulsanti */
.btn-primary, .btn-secondary, .btn-accent, .btn-outline {
  padding: 10px 16px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  background: #2f6b2f;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #245a24;
}

.btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
}

.btn-accent {
  background: #007bff;
  color: white;
}

.btn-accent:hover {
  background: #0056b3;
}

.btn-outline {
  background: transparent;
  color: #2f6b2f;
  border: 1px solid #2f6b2f;
}

.btn-outline:hover:not(:disabled) {
  background: #2f6b2f;
  color: white;
}

.btn-outline:disabled {
  color: #ccc;
  border-color: #ccc;
  cursor: not-allowed;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
  background: #2f6b2f;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.btn-small:hover {
  background: #245a24;
}

/* Stati di Caricamento */
.loading {
  text-align: center;
  padding: 20px;
  color: #666;
}

.error {
  text-align: center;
  padding: 20px;
  color: #dc3545;
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
}

/* Input Group */
.input-group {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.input-group input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.input-group button {
  white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
  .geolocation-modal {
    max-width: 95vw;
    margin: 10px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .preview-actions {
    flex-direction: column;
  }
  
  .info-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .info-item .value {
    text-align: left;
  }
}

/* Animazioni */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.search-result-item {
  animation: slideInRight 0.3s ease-out;
}

/* Indicatori di Stato */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-indicator.success {
  background: #d4edda;
  color: #155724;
}

.status-indicator.warning {
  background: #fff3cd;
  color: #856404;
}

.status-indicator.error {
  background: #f8d7da;
  color: #721c24;
}

/* Tooltip */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 200px;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 8px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -100px;
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 12px;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* Scrollbar personalizzata */
.search-results::-webkit-scrollbar {
  width: 6px;
}

.search-results::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.search-results::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}
