/* ============================================================
   upgrade.css — Stili per i nuovi moduli:
   Scheda bene, Geo panel, Storico analisi, Export PDF
   ============================================================ */

/* ── Sezione scheda bene ──────────────────────────────────── */
.scheda-section {
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
}

.scheda-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.scheda-title {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.scheda-toggle {
  background: none;
  border: 0.5px solid var(--gold-border);
  color: var(--muted);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--t-fast);
}
.scheda-toggle:hover,
.scheda-toggle.open {
  border-color: var(--gold);
  color: var(--gold);
}

.scheda-form {
  display: none;
  background: var(--surface);
  border: 0.5px solid var(--gold-border);
  border-radius: var(--r-lg);
  padding: 1rem 1.25rem;
  flex-direction: column;
  gap: 10px;
  animation: fadeIn 0.2s ease;
}
.scheda-form.open { display: flex; }

.scheda-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.scheda-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.scheda-input,
.scheda-select,
.scheda-textarea {
  background: var(--surface2);
  border: 0.5px solid var(--muted2);
  color: var(--cream);
  font-size: 13px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: var(--t-fast);
  width: 100%;
}
.scheda-input:focus,
.scheda-select:focus,
.scheda-textarea:focus {
  border-color: var(--gold);
}
.scheda-input::placeholder,
.scheda-textarea::placeholder { color: var(--muted2); }
.scheda-select option { background: var(--surface2); }
.scheda-textarea {
  resize: vertical;
  min-height: 60px;
  line-height: 1.5;
}

.scheda-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* ── Geo panel ───────────────────────────────────────────── */
.geo-panel {
  background: var(--surface);
  border: 0.5px solid var(--gold-border);
  border-radius: var(--r-lg);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.geo-btn {
  background: var(--surface2);
  border: 0.5px solid var(--gold-border);
  color: var(--muted);
  font-size: 12px;
  padding: 7px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: var(--t-fast);
  flex-shrink: 0;
  white-space: nowrap;
}
.geo-btn:hover { border-color: var(--gold); color: var(--gold); }
.geo-btn.acquired {
  border-color: var(--success);
  color: var(--success);
}

.geo-info {
  flex: 1;
  min-width: 0;
}
.geo-coords {
  font-size: 11px;
  color: var(--cream);
  font-family: monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.geo-address {
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.geo-status {
  font-size: 11px;
  color: var(--muted);
}

/* ── Storico panel ───────────────────────────────────────── */
.storico-btn {
  background: var(--surface);
  border: 0.5px solid var(--gold-border);
  color: var(--muted);
  font-size: 13px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--t-fast);
  width: 100%;
}
.storico-btn:hover { border-color: var(--gold); color: var(--gold); }
.storico-btn .badge {
  background: var(--gold-dim);
  color: var(--gold);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: auto;
}

/* Modal storico */
.storico-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,15,26,0.95);
  z-index: 100;
  flex-direction: column;
  animation: fadeIn 0.2s ease;
}
.storico-modal.open { display: flex; }

.storico-modal-header {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 0.5px solid var(--gold-border);
  background: var(--bg);
  flex-shrink: 0;
}
.storico-modal-title {
  font-family: 'DM Serif Display', serif;
  font-size: 20px;
  color: var(--cream);
}
.storico-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.storico-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.storico-empty {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 3rem 0;
}
.storico-empty i {
  font-size: 40px;
  display: block;
  margin-bottom: 10px;
  opacity: 0.3;
}

.storico-item {
  background: var(--surface);
  border: 0.5px solid var(--gold-border);
  border-radius: var(--r-lg);
  padding: 12px;
  display: flex;
  gap: 12px;
  cursor: pointer;
  transition: var(--t-fast);
}
.storico-item:hover { border-color: var(--gold); }

.storico-thumb {
  width: 60px;
  height: 60px;
  border-radius: var(--r-sm);
  object-fit: cover;
  background: var(--surface2);
  flex-shrink: 0;
}
.storico-thumb-placeholder {
  width: 60px;
  height: 60px;
  border-radius: var(--r-sm);
  background: var(--surface2);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 22px;
}

.storico-meta {
  flex: 1;
  min-width: 0;
}
.storico-oggetto {
  font-size: 14px;
  font-weight: 600;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.storico-data {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.storico-tecniche {
  font-size: 11px;
  color: var(--gold);
  margin-top: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.storico-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}
.storico-action-btn {
  background: none;
  border: 0.5px solid var(--gold-border);
  color: var(--muted);
  font-size: 14px;
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--t-fast);
}
.storico-action-btn:hover { color: var(--gold); border-color: var(--gold); }
.storico-action-btn.delete:hover { color: var(--danger); border-color: var(--danger); }

.storico-footer {
  padding: 0.75rem 1.25rem;
  border-top: 0.5px solid var(--gold-border);
  background: var(--bg);
  flex-shrink: 0;
}
.storico-svuota-btn {
  background: none;
  border: 0.5px solid var(--danger);
  color: var(--danger);
  font-size: 12px;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--t-fast);
  width: 100%;
  justify-content: center;
}
.storico-svuota-btn:hover { background: rgba(226,75,74,0.1); }

/* ── Export PDF button ───────────────────────────────────── */
.export-btn {
  background: var(--surface);
  border: 0.5px solid var(--gold-border);
  color: var(--cream);
  font-size: 14px;
  padding: 12px;
  border-radius: var(--r-md);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  transition: var(--t-fast);
}
.export-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-dim);
}
.export-btn i { font-size: 18px; }
.export-btn.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* ── Toast notifica ──────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: var(--surface2);
  border: 0.5px solid var(--gold-border);
  color: var(--cream);
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 20px;
  z-index: 200;
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.toast.success { border-color: var(--success); }
.toast.error   { border-color: var(--danger); }

/* ── Animazione ──────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── EXIF mini panel nei risultati ───────────────────────── */
.meta-exif-panel {
  background: var(--surface);
  border: 0.5px solid var(--gold-border);
  border-radius: var(--r-md);
  padding: 10px 14px;
  margin-top: 8px;
}
.meta-exif-title {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.meta-exif-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.meta-exif-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.meta-exif-label {
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.meta-exif-value {
  font-size: 12px;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Geo chip nei risultati ──────────────────────────────── */
.geo-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(61,201,138,0.1);
  border: 0.5px solid rgba(61,201,138,0.3);
  color: var(--success);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  margin-right: 6px;
  margin-bottom: 8px;
}
