/*
 * geo-tools.css: scoped styles for the free GeoTIFF and LAS/LAZ viewers (/datadelivery/geotiff-viewer/,
 * /datadelivery/las-viewer/). Plan: .claude/plans/2026-10-07-free-geo-viewer.md, step 2.
 * Plain CSS with .gt-* classes only. The viewer UI (static markup and anything the viewer JS creates) never uses
 * Tailwind utilities, so it renders the same whatever CSS loads after it.
 * Colors: navy #1A2533 (text), accent #44B3E6 (borders and highlights only; too light for body text).
 */

.gt-tool {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(26, 37, 51, 0.08);
  padding: 20px;
  color: #1f2937;
  font-size: 1rem;
  line-height: 1.5;
}
.gt-tool [hidden] {
  display: none !important;
}

/* Drop zone and file input (no <form> anywhere on the page) */
.gt-drop {
  border: 2px dashed #9ca3af;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  background: #f9fafb;
  transition: border-color 0.15s, background-color 0.15s;
}
.gt-drop-active {
  border-color: #44B3E6;
  background: #f0f9fe;
}
.gt-drop-title {
  margin: 0 0 10px;
  font-size: 1.125rem;
  font-weight: 700;
  color: #1A2533;
}
.gt-drop-label {
  display: block;
  margin: 0 0 8px;
  font-weight: 600;
  color: #1A2533;
}
.gt-file-input {
  max-width: 100%;
  font-size: 0.95rem;
}
.gt-file-input:focus-visible {
  outline: 3px solid #1A2533;
  outline-offset: 2px;
  border-radius: 6px;
}
.gt-drop-note {
  margin: 10px 0 0;
  font-size: 0.875rem;
  color: #4b5563;
}

/* Status, messages, progress */
.gt-status {
  margin: 14px 0 0;
  font-weight: 600;
  color: #1A2533;
}
.gt-message {
  margin: 10px 0 0;
  padding: 10px 14px;
  border-radius: 8px;
  border-left: 4px solid #44B3E6;
  background: #f0f9fe;
  color: #1f2937;
}
.gt-message-warn {
  border-left-color: #d97706;
  background: #fffbeb;
}
.gt-message-error {
  border-left-color: #b91c1c;
  background: #fef2f2;
}
.gt-progress {
  margin: 12px 0 0;
  height: 8px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}
.gt-progress-bar {
  height: 100%;
  width: 0;
  background: #44B3E6;
  transition: width 0.2s;
}

/* Map / 3D stage */
.gt-stage {
  position: relative;
  margin: 16px 0 0;
}
.gt-viewport {
  position: relative;
  width: 100%;
  height: 62vh;
  min-height: 360px;
  max-height: 760px;
  border-radius: 12px;
  overflow: hidden;
  background: #d9dde3;
}
.gt-viewport-dark {
  background: #1d2126;
}
.gt-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.gt-north {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 3px rgba(26, 37, 51, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #1A2533;
  pointer-events: none;
  z-index: 2;
}
.gt-north-arrow {
  display: block;
  line-height: 1;
  font-size: 0.9rem;
  transform-origin: 50% 60%;
}
.gt-legend {
  position: absolute;
  left: 12px;
  top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 3px rgba(26, 37, 51, 0.25);
  font-size: 0.8rem;
  color: #1A2533;
  z-index: 2;
}
.gt-legend-bar {
  display: inline-block;
  width: 120px;
  height: 10px;
  border-radius: 4px;
}
.gt-readout {
  min-height: 1.5em;
  margin: 8px 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  color: #374151;
}
/* OpenLayers scale line (the only OpenLayers control used; ol.css is not loaded) */
.gt-viewport .ol-scale-line {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(26, 37, 51, 0.75);
}
.gt-viewport .ol-scale-line-inner {
  border: 1px solid #ffffff;
  border-top: none;
  color: #ffffff;
  font-size: 0.7rem;
  text-align: center;
  margin: 1px;
  will-change: contents, width;
  transition: all 0.25s;
}

/* LAS controls */
.gt-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  align-items: flex-end;
  margin: 14px 0 0;
}
.gt-control {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
  color: #1A2533;
}
.gt-control label {
  font-weight: 600;
}
.gt-control select {
  min-width: 180px;
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  font-size: 0.95rem;
}
.gt-control input[type='range'] {
  width: 220px;
  accent-color: #1A2533;
}
.gt-control select:focus-visible,
.gt-control input:focus-visible {
  outline: 3px solid #1A2533;
  outline-offset: 2px;
}
.gt-control-value {
  font-size: 0.85rem;
  color: #4b5563;
}

/* Panels: file details and import check */
.gt-panels {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 16px 0 0;
}
@media (min-width: 768px) {
  .gt-panels {
    grid-template-columns: 1fr 1fr;
  }
}
.gt-panel {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px 18px;
  background: #f9fafb;
}
.gt-panel-title {
  margin: 0 0 10px;
  font-size: 1.0625rem;
  font-weight: 700;
  color: #1A2533;
}
.gt-meta-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 14px;
  margin: 0;
  font-size: 0.9rem;
}
.gt-meta-list dt {
  font-weight: 600;
  color: #374151;
}
.gt-meta-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #1f2937;
}
.gt-preflight-label {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: #4b5563;
}
.gt-preflight-summary {
  margin: 0 0 10px;
  font-weight: 600;
}
.gt-checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
}
.gt-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.gt-check-badge {
  flex: 0 0 auto;
  min-width: 48px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  color: #ffffff;
  background: #15803d;
}
.gt-check-warn .gt-check-badge {
  background: #b45309;
}
.gt-check-fail .gt-check-badge {
  background: #b91c1c;
}

/* Post-open call to action */
.gt-cta {
  margin: 16px 0 0;
  padding: 16px 18px;
  border-radius: 12px;
  background: #1A2533;
  color: #ffffff;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  justify-content: space-between;
}
.gt-cta p {
  margin: 0;
  max-width: 640px;
}
.gt-cta-button {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 8px;
  background: #44B3E6;
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
}
.gt-cta-button:hover {
  background: #389fc1;
}
.gt-cta-button:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
}

/* Privacy statement and credits */
.gt-privacy {
  margin: 0;
  padding: 14px 18px;
  border-radius: 12px;
  border-left: 4px solid #44B3E6;
  background: #f9fafb;
  color: #1f2937;
}
.gt-credits {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #4b5563;
}
.gt-credits a {
  color: #1A2533;
  text-decoration: underline;
}
