:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --bg-primary: #070a0e;
  --bg-secondary: #0d121a;
  --bg-card: rgba(18, 26, 38, 0.7);
  --border-card: rgba(255, 255, 255, 0.08);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-indigo: #6366f1;
  --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
  
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Glowing Ambient Backgrounds */
.bg-glow-1 {
  position: fixed;
  top: -150px;
  right: -150px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

.bg-glow-2 {
  position: fixed;
  bottom: -200px;
  left: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.12) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 40px 24px;
}

/* Header Styling */
header {
  margin-bottom: 40px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-icon {
  font-size: 2.5rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--border-card);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

h1 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(to right, #ffffff, #93c5fd, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-top: 4px;
  font-weight: 500;
}

/* Upload & Drop Zone */
.drop-zone {
  background: var(--bg-card);
  border: 2px dashed rgba(59, 130, 246, 0.3);
  border-radius: 24px;
  padding: 60px 40px;
  text-align: center;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  max-width: 800px;
  margin: 40px auto;
  position: relative;
  overflow: hidden;
}

.drop-zone::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(6, 182, 212, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

.drop-zone.dragging {
  border-color: var(--accent-cyan);
  background: rgba(18, 26, 38, 0.95);
  box-shadow: 0 0 40px rgba(6, 182, 212, 0.2);
  transform: translateY(-4px);
}

.drop-zone.dragging::before {
  opacity: 1;
}

.drop-zone-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.icon-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  transition: transform 0.3s ease;
}

.drop-zone:hover .icon-circle {
  transform: scale(1.08) rotate(5deg);
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.4);
}

.upload-icon {
  width: 36px;
  height: 36px;
  color: var(--accent-blue);
}

.drop-zone h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.supported-formats {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 30px;
  max-width: 420px;
}

/* Glassmorphic Cards */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  padding: 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.primary-gradient-border {
  border-color: rgba(59, 130, 246, 0.25);
  box-shadow: 0 10px 30px -10px rgba(59, 130, 246, 0.15);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.header-main-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-icon {
  width: 22px;
  height: 22px;
  color: var(--text-secondary);
}

.accent-icon {
  color: var(--accent-blue);
  filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.5));
}

.card-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card-badge {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: var(--accent-blue);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  margin-top: -8px;
}

.inline-desc-icon {
  width: 14px;
  height: 14px;
  display: inline;
  vertical-align: middle;
  margin-right: 4px;
  color: var(--accent-blue);
}

/* Workspace Grid */
.workspace-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  align-items: start;
}

.workspace-column {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.sticky-column {
  position: sticky;
  top: 40px;
}

/* Clean Image Preview (no overlay) */
.image-preview-container {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16/10;
}

#previewImage {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: opacity 0.3s ease;
}

.image-diminsions-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  letter-spacing: 0.05em;
  backdrop-filter: blur(4px);
  z-index: 50;
}

/* Standalone Leaflet Map Card */
.map-standalone-card {
  border-color: rgba(59, 130, 246, 0.2);
}

.standalone-map {
  width: 100%;
  height: 300px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 10;
  position: relative;
}

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

#map.map-empty-state::after {
  content: 'Upload EXIF GPS or run OCR to plot location';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(7, 10, 14, 0.55);
  pointer-events: none;
  z-index: 500;
}

/* Read-only extracted metadata */
.extracted-fields {
  margin-top: 8px;
}

.fields-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.field-display {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  min-height: 44px;
  display: flex;
  align-items: center;
  word-break: break-word;
}

.field-display.field-empty {
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-style: italic;
}

.field-display.field-loading {
  color: var(--accent-cyan);
  font-family: var(--font-sans);
  font-style: normal;
}

.mode-info-box {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
}

.mode-info-box p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.mode-info-icon {
  width: 18px;
  height: 18px;
  color: var(--accent-blue);
  flex-shrink: 0;
  margin-top: 2px;
}

.address-dual-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.address-dual-row:last-child {
  margin-bottom: 0;
}

.address-source-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 4px;
  width: fit-content;
}

.address-source-badge.ocr-source {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.address-source-badge.geo-source {
  background: rgba(6, 182, 212, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.ocr-match-empty .ocr-match-label {
  color: var(--warning);
}

/* Collapsible coordinate mini-map */
.coords-map-collapse {
  margin: 4px 0 16px;
}

.coords-map-collapse.hidden {
  display: none !important;
}

.coords-map-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.22);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.coords-map-toggle:hover {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.35);
}

.coords-map-toggle-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.coords-map-toggle svg {
  width: 16px;
  height: 16px;
  color: var(--accent-blue);
}

.coords-map-toggle .collapse-chevron {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
  transition: transform 0.25s ease;
}

.coords-map-toggle.expanded .collapse-chevron {
  transform: rotate(180deg);
}

.coords-map-panel {
  margin-top: 10px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(59, 130, 246, 0.2);
  animation: fadeIn 0.25s ease-out;
}

.coords-map-panel.hidden {
  display: none !important;
}

.coords-mini-map {
  width: 100%;
  height: 240px;
  min-height: 240px;
  background: #1e293b;
  z-index: 1;
}

.coords-mini-map.leaflet-container {
  font-family: var(--font-sans);
}

/* Ensure Leaflet tiles render above panel background */
.coords-mini-map .leaflet-tile-pane {
  opacity: 1;
}

.coords-mini-map iframe,
.standalone-map iframe,
#map iframe {
  width: 100%;
  height: 100%;
  min-height: 100%;
  border: 0;
  display: block;
}

.google-maps-key-group {
  margin-bottom: 16px;
}

.google-maps-key-group .field-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.google-maps-key-group .field-hint a {
  color: var(--accent-cyan);
  text-decoration: none;
}

.google-maps-key-group .field-hint a:hover {
  text-decoration: underline;
}

/* Segmented Mode Selector */
.extraction-mode-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 24px;
}

.mode-btn {
  background: transparent;
  color: var(--text-secondary);
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.mode-btn svg {
  width: 16px;
  height: 16px;
  transition: color 0.25s ease;
}

.mode-btn:hover {
  color: #fff;
}

.mode-btn.active {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.mode-btn.active svg {
  color: #fff;
}

/* OCR Scanning Panel */
.ocr-scanner-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 24px;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.ocr-scanner-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.ocr-scanner-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.03) 0%, transparent 60%);
  pointer-events: none;
}

.ocr-scan-large-icon {
  width: 42px;
  height: 42px;
  color: var(--accent-cyan);
  margin-bottom: 12px;
  filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.4));
}

.ocr-scanner-box h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.ocr-scanner-box p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.4;
}

.btn-ocr-scan {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  color: #fff;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 0.9rem;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.25);
  width: 100%;
}

.btn-ocr-scan:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.35);
}

.ocr-progress-wrapper {
  margin-top: 16px;
  text-align: left;
}

.ocr-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.ocr-progress-bar {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 3px;
  transition: width 0.1s ease;
}

#ocrProgressStatus {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* OCR Results Insights */
.ocr-matches-box {
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: 14px;
  padding: 16px;
}

.ocr-matches-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.ocr-matches-box h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--success);
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-engine-badge {
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.25);
  color: var(--accent-cyan);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-sans);
}

.ocr-matches-box h4 svg {
  width: 16px;
  height: 16px;
}

.ocr-matches-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.ocr-match-item {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 8px 12px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.775rem;
}

.ocr-match-label {
  color: var(--text-secondary);
  font-weight: 600;
}

.ocr-match-value {
  color: #fff;
  font-weight: 700;
  font-family: monospace;
}

.raw-ocr-text-toggle {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 10px;
  margin-top: 10px;
}

.raw-ocr-text {
  background: #040609;
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 10px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-family: monospace;
  max-height: 100px;
  overflow-y: auto;
  white-space: pre-wrap;
  text-align: left;
  margin-top: 8px;
}

/* Form Styles */
.edit-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

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

.form-group label {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-group label span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-group label svg {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

.form-group input,
.select-premium {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: all 0.2s ease;
  width: 100%;
}

.form-group input:focus,
.select-premium:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
  background: rgba(0, 0, 0, 0.5);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

/* Premium Layout Radio Selector */
.control-section {
  margin-bottom: 20px;
}

.control-section h3 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.layout-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.layout-grid-five {
  grid-template-columns: repeat(5, 1fr);
}

.layout-card-option {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.layout-card-option input {
  display: none;
}

.layout-mock {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.4);
  padding: 4px;
  display: flex;
  gap: 4px;
  transition: all 0.2s ease;
  overflow: hidden;
  position: relative;
}

.mock-img {
  background: rgba(255, 255, 255, 0.05);
  flex-grow: 1;
  border-radius: 6px;
  position: relative;
}

.mock-panel {
  background: var(--accent-blue);
  opacity: 0.4;
  border-radius: 6px;
  transition: opacity 0.2s ease;
}

/* Layout Mock Variations */
.layout-mock.top {
  flex-direction: column;
}
.layout-mock.top .mock-panel {
  height: 24%;
  width: 100%;
  flex-shrink: 0;
}

.layout-mock.bottom {
  flex-direction: column;
}
.layout-mock.bottom .mock-panel {
  height: 24%;
  width: 100%;
}

.layout-mock.right {
  flex-direction: row;
}
.layout-mock.right .mock-panel {
  width: 32%;
  height: 100%;
}

.layout-mock.left {
  flex-direction: row;
}
.layout-mock.left .mock-panel {
  width: 32%;
  height: 100%;
}

.layout-mock.overlay .mock-panel-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  right: 6px;
  height: 28%;
  background: var(--accent-blue);
  opacity: 0.4;
  border-radius: 4px;
}

/* Active states */
.layout-card-option:hover .layout-mock {
  border-color: rgba(255, 255, 255, 0.2);
}

.layout-card-option input:checked + .layout-mock {
  border-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.06);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.2);
}

.layout-card-option input:checked + .layout-mock .mock-panel,
.layout-card-option input:checked + .layout-mock .mock-panel-badge {
  opacity: 1;
  background: var(--accent-gradient);
}

.layout-card-option span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
}

.layout-card-option input:checked ~ span {
  color: #fff;
}

/* Canvas Display */
.canvas-container {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #05070a;
  border: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16/11;
}

#canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: none;
}

.canvas-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  padding: 30px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Buttons System */
button {
  font-family: var(--font-sans);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 0.95rem;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(59, 130, 246, 0.45);
}

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

.btn-text {
  background: transparent;
  color: var(--accent-blue);
  font-size: 0.775rem;
  padding: 2px 6px;
  border-radius: 6px;
}

.btn-text:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-cyan);
}

.action-buttons-group {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-generate {
  width: 100%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  padding: 16px;
  border-radius: 12px;
  font-size: 1rem;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
}

.btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

.action-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 12px;
}

.btn-download {
  background: var(--accent-gradient);
  color: #fff;
  padding: 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.25);
}

.btn-download:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35);
}

.btn-download:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-reset {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border-card);
  padding: 14px;
  border-radius: 12px;
  font-size: 0.9rem;
}

.btn-reset:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Spin Animations */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.icon-spin {
  animation: spin 1s linear infinite;
}

.icon-spin-hover:hover {
  animation: spin 1.2s linear infinite;
}

/* Loading Overlay Styles */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(7, 10, 14, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.loader-content {
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  padding: 40px 60px;
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 460px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(59, 130, 246, 0.1);
  border-left-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 1s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
  margin-bottom: 24px;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.loader-content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.loader-content p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.hidden {
  display: none !important;
}

/* Leaflet Dark Customizations */
.leaflet-bar {
  border: 1px solid var(--border-card) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}
.leaflet-bar a {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border-bottom: 1px solid var(--border-card) !important;
}
.leaflet-bar a:hover {
  background-color: var(--accent-blue) !important;
  color: #fff !important;
}
.leaflet-container {
  font-family: var(--font-sans) !important;
}

/* Site navigation (multi-feature) */
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
  padding: 6px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  width: fit-content;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
}

.nav-link svg {
  width: 16px;
  height: 16px;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
  color: #fff;
  background: var(--accent-gradient);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

/* Bulk export page */
.drop-zone-bulk {
  max-width: 900px;
}

.bulk-progress-track {
  width: 100%;
  max-width: 320px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  margin-top: 16px;
  overflow: hidden;
}

.bulk-progress-bar {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 3px;
  transition: width 0.15s ease;
}

.export-workspace {
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: fadeIn 0.35s ease-out;
}

.export-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}

.webllm-panel {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(168, 85, 247, 0.06);
  border: 1px solid rgba(168, 85, 247, 0.2);
}

.webllm-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.webllm-toggle input {
  accent-color: #a855f7;
}

.webllm-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.btn-webllm-load {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid rgba(168, 85, 247, 0.35);
  background: rgba(168, 85, 247, 0.15);
  color: #e9d5ff;
  cursor: pointer;
}

.btn-webllm-load:hover:not(:disabled) {
  background: rgba(168, 85, 247, 0.28);
}

.btn-webllm-load:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.webllm-status {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.webllm-status.webllm-ready {
  color: #c4b5fd;
  font-weight: 600;
}

.webllm-progress-wrap {
  flex: 1 1 180px;
  max-width: 240px;
}

.webllm-progress-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.webllm-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #a855f7, #6366f1);
  transition: width 0.15s ease;
}

.export-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stat-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  letter-spacing: 0.02em;
}

.stat-total {
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.stat-gps {
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.stat-ocr {
  background: rgba(6, 182, 212, 0.12);
  color: #67e8f9;
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.stat-miss {
  background: rgba(245, 158, 11, 0.12);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.export-table-card {
  padding: 0;
  overflow: hidden;
}

.export-table-card .card-header {
  padding: 18px 20px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border-card);
}

.export-table-wrap {
  overflow-x: auto;
  max-height: min(70vh, 640px);
  overflow-y: auto;
}

.export-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.export-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  padding: 12px 16px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  background: rgba(9, 13, 18, 0.95);
  border-bottom: 1px solid var(--border-card);
}

.export-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  vertical-align: middle;
}

.export-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.04);
}

.export-table .row-no-gps {
  background: rgba(245, 158, 11, 0.04);
}

.col-preview-head {
  width: 72px;
}

.col-preview {
  width: 72px;
  padding: 8px 10px !important;
  vertical-align: middle;
}

.export-thumb-link {
  display: block;
  line-height: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.export-thumb-link:hover {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.export-thumb {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: cover;
  background: #0a0e14;
}

.ocr-debug-rot {
  font-size: 0.7rem;
  color: var(--accent-cyan);
  margin-right: auto;
  margin-left: 12px;
}

.col-filename {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.col-coord {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
}

.source-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 4px;
}

.source-exif {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.source-ocr {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
}

.source-manual {
  background: rgba(168, 85, 247, 0.15);
  color: #c4b5fd;
}

.col-coord-edit {
  min-width: 108px;
}

.coord-input {
  width: 100%;
  min-width: 96px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 8px 10px;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
}

.coord-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.coord-input::placeholder {
  color: var(--text-muted);
  font-family: var(--font-sans);
}

.col-location {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.source-miss {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.source-error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.col-debug-head {
  width: 88px;
  white-space: nowrap;
}

.col-debug {
  width: 88px;
  vertical-align: middle;
}

.ocr-debug-empty {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.btn-ocr-debug-toggle {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(6, 182, 212, 0.35);
  background: rgba(6, 182, 212, 0.1);
  color: var(--accent-cyan);
  cursor: pointer;
}

.btn-ocr-debug-toggle:hover {
  background: rgba(6, 182, 212, 0.22);
}

.ocr-debug-engine {
  display: block;
  font-size: 0.62rem;
  color: var(--text-muted);
  margin-top: 4px;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ocr-debug-row td {
  padding: 0 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: top;
}

.ocr-debug-panel {
  background: #040609;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 12px;
}

.ocr-debug-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.btn-ocr-debug-close {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  cursor: pointer;
}

.btn-ocr-debug-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.ocr-debug-text {
  margin: 0;
  max-height: 160px;
  overflow: auto;
  font-size: 0.7rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
}

.col-actions-head {
  width: 52px;
}

.col-actions {
  width: 52px;
  text-align: center;
}

.btn-row-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn-row-delete:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fff;
}

.btn-row-delete svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 640px) {
  .export-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .export-actions {
    flex-direction: column;
  }
  .export-actions .btn-download,
  .export-actions .btn-reset {
    width: 100%;
  }
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .workspace-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .sticky-column {
    position: static;
  }
  .floating-map-widget {
    position: relative;
    bottom: auto;
    right: auto;
    width: 100%;
    height: 250px;
    margin-top: 16px;
    border-radius: 12px;
    box-shadow: none;
  }
  .floating-map-widget.expanded {
    width: 100%;
    height: 320px;
  }
  .btn-map-control {
    display: none;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 24px 16px;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .layout-grid,
  .layout-grid-five {
    grid-template-columns: repeat(2, 1fr);
  }
  .action-row {
    grid-template-columns: 1fr;
  }
}
