/* Side panel layout: two step cards (1 Airport → 2 Recording), an
   optional Highlight card, collapsible Settings, and a small footer.
   Loaded after style.css and overrides its panel rules. */

:root {
  --panel-width: 360px;
  --ok: #15803d;
  --warn: #b45309;
  --card-bg: #ffffff;
  --card-border: #e3e7ee;
  --soft: #f4f6f9;
}

#panel {
  padding: 20px 18px 20px;
  background: var(--soft);
  border-left: 1px solid var(--card-border);
  font-size: 13px;
  line-height: 1.45;
}

/* ---- Top-right icon buttons (presentation, panel toggle) ---- */
#top-right-controls { top: 14px; right: 14px; gap: 6px; }
#top-right-controls button {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: #475467;
}
#top-right-controls button svg { width: 16px; height: 16px; }
#top-right-controls button:hover { color: var(--ui-accent); border-color: var(--ui-accent); }

/* ---- Exit button for presentation mode ----
   Hidden outside presentation mode. Inside it, it fades in when the mouse
   moves (body.presentation-pointer, set by main.js) and fades out after a
   short idle, so it doesn't end up in screen recordings. */
#presentation-exit { display: none; }
body.presentation #presentation-exit {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1100;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(16, 24, 40, 0.75);
  color: #fff;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
body.presentation.presentation-pointer #presentation-exit,
body.presentation #presentation-exit:focus-visible {
  opacity: 1;
  pointer-events: auto;
}
body.presentation #presentation-exit:hover { background: rgba(16, 24, 40, 0.92); border-color: rgba(255, 255, 255, 0.5); }
#presentation-exit svg { width: 15px; height: 15px; }

/* ---- Intro ---- */
.panel-intro { padding-right: 80px; margin-bottom: 16px; }
.panel-title { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.panel-lead { margin: 4px 0 0; color: var(--text-dim); font-size: 12.5px; }

/* ---- Step cards ---- */
.step, .card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.step[data-state="active"] {
  border-color: var(--ui-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.step-head { display: flex; align-items: center; gap: 10px; }
.step-title { font-size: 14px; font-weight: 650; }
.step-sub { font-size: 12px; color: var(--text-dim); }

.step-badge {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 700;
  background: #e8ecf2;
  color: #667085;
}
.step-badge .step-check { display: none; width: 14px; height: 14px; }
.step[data-state="active"] .step-badge { background: var(--ui-accent); color: #fff; }
.step[data-state="done"] .step-badge { background: var(--ok); color: #fff; }
.step[data-state="done"] .step-num { display: none; }
.step[data-state="done"] .step-check { display: block; }

.step-body { margin-top: 12px; }

/* Step 2 before an airport is set: visible (so the flow is obvious) but
   inert. */
.step[data-state="locked"] .step-body { opacity: 0.45; pointer-events: none; filter: grayscale(1); }
.step-locked-note { display: none; margin-top: 10px; font-size: 12px; color: var(--text-dim); }
.step[data-state="locked"] .step-locked-note { display: block; }
.step[data-state="locked"] .step-title { color: var(--text-dim); }

/* ---- Step 1: airport ---- */
.icao-lookup-row { display: flex; gap: 8px; }
.icao-lookup-row input {
  flex: 1;
  height: 38px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 8px;
  padding: 0 12px;
}
.icao-lookup-row input::placeholder { font-weight: 400; letter-spacing: 0; text-transform: none; color: #98a2b3; }
.icao-lookup-row input:focus,
#panel input[type="text"]:focus,
#panel input[type="number"]:focus,
#panel select:focus { outline: none; border-color: var(--ui-accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }

.btn-primary {
  height: 38px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--ui-accent);
  background: var(--ui-accent);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
}
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }

.step-note { margin-top: 8px; font-size: 12.5px; }
.step-note:empty { display: none; }
#icao-lookup-status { display: block; min-height: 0; margin: 8px 0 0; font-size: 12.5px; }
#icao-lookup-status:empty { display: none; }
#icao-lookup-status.status-ok { color: var(--text); font-weight: 500; }
#icao-lookup-status.status-ok::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--ok);
  vertical-align: 1px;
}
.status-warn { color: var(--warn); }

.inline-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}
.inline-field label { color: var(--text-dim); font-size: 12.5px; }
#panel .inline-field select { width: auto; min-width: 110px; margin: 0; border-radius: 8px; padding: 6px 8px; }

/* ---- Step 2: recording ---- */
.dropzone {
  border: 1.5px dashed #c5ccd8;
  border-radius: 10px;
  padding: 18px 12px;
  margin: 0;
  align-items: center;
  text-align: center;
  gap: 4px;
  background: #fafbfd;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--ui-accent); background: rgba(37, 99, 235, 0.04); }
.dropzone.loaded { border-style: solid; border-color: var(--card-border); background: #fafbfd; }
.dropzone.sync-error { border-color: var(--danger); }
.dz-icon { width: 26px; height: 26px; color: var(--ui-accent); margin-bottom: 2px; }
.dropzone .dz-label { font-weight: 600; font-size: 13px; }
.dz-link { color: var(--ui-accent); text-decoration: underline; text-underline-offset: 2px; }
.dropzone .dz-hint { font-style: normal; font-size: 11.5px; color: var(--text-dim); word-break: break-all; }

.dz-status { margin-top: 8px; font-size: 12.5px; color: var(--text-dim); }
.dz-status:empty { display: none; }
.dz-status.dz-file {
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dz-status.dz-file::before { content: '♪'; margin-right: 6px; color: var(--ui-accent); }
#traffic-status.status-ok { color: var(--ok); font-weight: 500; }
#traffic-status.status-ok::before { content: '✓'; margin-right: 6px; }

/* ---- Highlight card ---- */
.card-title { font-size: 14px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.card-tag {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #667085;
  background: #eef1f5;
  border-radius: 999px;
  padding: 1px 7px;
}
.card-sub { font-size: 12px; color: var(--text-dim); margin: 2px 0 10px; }
#highlight-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#highlight-columns input[type="text"] { border-radius: 8px; height: 34px; }
.highlight-column-green input[type="text"] { border-left: 3px solid var(--accent); }
.highlight-column-pink input[type="text"] { border-left: 3px solid var(--highlight-pink); }

/* ---- Settings (collapsible) ---- */
.settings-heading {
  margin: 18px 2px 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}
#section-settings {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
}
#section-settings .settings-heading { display: none; }
#section-settings details { margin: 0; padding: 0; border-top: 1px solid var(--card-border); }
#section-settings details:first-of-type { border-top: none; }
#section-settings summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
#section-settings summary::before { content: none; }
#section-settings summary::after {
  content: '';
  width: 7px;
  height: 7px;
  border-right: 1.8px solid #98a2b3;
  border-bottom: 1.8px solid #98a2b3;
  transform: rotate(-45deg);
  transition: transform 0.15s;
}
#section-settings details[open] > summary::after { transform: rotate(45deg); }
#section-settings summary:hover { background: #f8f9fb; color: var(--text); }
#section-settings details > summary + * { margin-top: 0; }
.settings-body { padding: 2px 14px 14px; }

.sub-heading {
  margin: 10px 0 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}
.settings-body > .sub-heading:first-child { margin-top: 4px; }
.settings-hint { font-size: 11.5px; color: var(--text-dim); margin-bottom: 6px; }

.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin: 8px 0 4px; }
#section-settings .check-grid label,
#section-settings .check-single { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12.5px; }
#section-settings .check-single { margin-top: 12px; }

.slider-label,
#section-settings label.slider-label {
  display: flex;
  justify-content: space-between;
  margin: 8px 0 2px;
  font-size: 12px;
  color: var(--text-dim);
}
.slider-label span { color: var(--text); font-variant-numeric: tabular-nums; }

.aircraft-display-group {
  background: var(--soft);
  border: none;
  border-radius: 8px;
  padding: 2px 10px 10px;
  margin: 10px 0 0;
}
.aircraft-display-group-highlight { border-left: 3px solid var(--ui-accent); }
.aircraft-display-group .sub-heading { margin-top: 8px; }
.aircraft-display-group-highlight .sub-heading { color: var(--ui-accent); }
#section-settings #highlight-declutter-label,
#section-settings #highlight-dim-label { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; font-size: 12.5px; }

.filter-range-row { margin: 10px 0 0; }
.filter-range-inputs input { border-radius: 6px; }

.view-slots { margin-top: 4px; }
.view-slot-row { border-radius: 6px; background: var(--soft); border-color: transparent; }

/* ---- Footer ---- */
.panel-footer { margin-top: 16px; padding: 0 2px; font-size: 11.5px; color: var(--text-dim); }
.footer-row { display: flex; gap: 8px; margin-top: 4px; }
.footer-key { flex: 0 0 74px; font-weight: 600; }
.panel-footer kbd { font-size: 10.5px; padding: 0 4px; }

/* ---- Fixes after first look ---- */
/* Title row stays pinned while the panel scrolls, so the two top-right
   icon buttons never sit on top of scrolled content. */
.panel-intro {
  position: sticky;
  top: -20px;
  z-index: 5;
  margin: -20px -18px 14px;
  padding: 20px 98px 12px 18px;
  background: var(--soft);
}
#panel input[type="text"], #panel input[type="number"] { background: #fff; border-color: #d0d5dd; }
.dropzone .dz-hint { word-break: normal; overflow-wrap: anywhere; }
/* Once a file is in, the drop area shrinks to a one-line "replace" target. */
.dropzone.loaded { padding: 9px 12px; flex-direction: row; justify-content: center; gap: 6px; }
.dropzone.loaded .dz-icon { width: 16px; height: 16px; margin: 0; }
.dropzone.loaded .dz-hint { display: none; }
.dropzone.loaded .dz-label { font-weight: 500; color: var(--text-dim); }
/* Highlight columns: plain drop targets for dragging callsigns between colors. */
.highlight-column {
  padding: 0;
  border: none;
  background: transparent;
  min-height: 0;
}
#highlight-columns .highlight-tags-group { margin-top: 6px; }
.dz-replace { display: none; }
.dropzone.loaded .dz-label { display: none; }
.dropzone.loaded .dz-replace { display: inline; color: var(--text-dim); font-size: 12.5px; }

/* ---- "Traffic data available for" card ---- */
.coverage-card {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #eef4ff;
  border: 1px solid #d6e4ff;
}
.coverage-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #3b5bdb;
  margin-bottom: 6px;
}
.coverage-list {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 3px 10px;
  margin: 0;
  font-size: 12.5px;
}
.coverage-list dt { color: var(--text-dim); }
.coverage-list dd { margin: 0; color: var(--text); font-weight: 500; }
#radius-note { color: var(--text-dim); font-size: 12px; }

/* ---- Alerts in step 2 (no traffic for this recording, etc.) ---- */
.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 10px;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid;
  font-size: 12.5px;
  line-height: 1.45;
}
.alert-icon { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; }
.alert-title { font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.alert-error { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }
.alert-error .alert-body { color: #7f1d1d; }
.alert-warn { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
.alert-warn .alert-body { color: #78350f; }
.alert-compact { display: block; padding: 9px 12px; }
.alert.hidden { display: none; }
.coverage-list dd[title] { cursor: help; text-decoration: underline dotted #98a2b3; text-underline-offset: 3px; }
