/* Fire Geo — light theme carried over from the original 2013 site
   (bootstrap-2 hero unit, whitesmoke event rows, red timestamps). */

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  background: #fff;
  color: #333;
  font: 14px/20px 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a { color: #08c; text-decoration: none; }
a:hover { color: #005580; text-decoration: underline; }

/* ---- hero banner (original graphic) ------------------------------------- */

.hero-link, .hero-link:hover { text-decoration: none; color: inherit; }

.hero-unit {
  padding: 14px 20px;
  background: #eee url('images/fire_geo_header_background.jpg') 0 -216px;
}
.hero-unit h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1;
  letter-spacing: -1px;
  font-weight: bold;
  color: #333;
}

.container { max-width: 940px; margin: 0 auto; padding: 0 12px; }

/* ---- menubar (bootstrap-2 nav-tabs look) --------------------------------- */

#menubar {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  border-bottom: 1px solid #ddd;
  overflow: hidden;
}
#menubar li { float: left; margin-bottom: -1px; }
#menubar li a {
  display: block;
  padding: 8px 14px;
  margin-right: 2px;
  line-height: 20px;
  border: 1px solid transparent;
  border-radius: 4px 4px 0 0;
}
#menubar li a:hover { background-color: #eee; border-color: #eee #eee #ddd; text-decoration: none; }
#menubar li.active a {
  color: #555;
  background-color: #fff;
  border: 1px solid #ddd;
  border-bottom-color: transparent;
  cursor: default;
}
#menubar li.login-status {
  float: right;
  padding: 9px 0;
  color: #999;
  white-space: nowrap;
}
#menubar li.login-status a {
  display: inline;
  padding: 0;
  margin: 0;
  border: none;
}
#menubar li.login-status a:hover { background: none; text-decoration: underline; }

/* ---- developer worker status -------------------------------------------- */
.status-intro { color: #666; }
.delivery-health { display: flex; align-items: baseline; gap: 10px; margin: 18px 0 6px; padding: 10px 12px; border-left: 4px solid #287a3c; background: #f4faf5; }
.delivery-health.retrying { border-left-color: #a06400; background: #fff9ed; }
.delivery-health.error { border-left-color: #a42d2d; background: #fdf3f3; }
.delivery-label { color: #666; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.delivery-health span:last-child { color: #666; }
.worker-status { width: 100%; border-collapse: collapse; margin-top: 16px; }
.worker-status th, .worker-status td { padding: 9px 10px; border-bottom: 1px solid #e5e5e5; text-align: left; }
.worker-status th { color: #666; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.worker-state { font-weight: 600; }
.worker-state.ok { color: #287a3c; }
.worker-state.degraded, .worker-state.stale { color: #a06400; }
.worker-state.error, .worker-state.stopped { color: #a42d2d; }

/* ---- date bar ------------------------------------------------------------ */

.daynav {
  text-align: center;
  padding: 14px 0 18px;
  font-size: 15px;
}
.daynav .day-label { font-weight: bold; }
.daynav .disabled { color: #ccc; }

/* ---- event list ---------------------------------------------------------- */

.event {
  display: flex;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 6px 4px;
  border-bottom: 1px solid lightgray;
  background-color: whitesmoke;
  font-size: 12px;
}
.event:first-of-type { border-top: 1px solid lightgray; }

.event.triggered { background-color: #ebf8a4; }

.event-time {
  min-width: 74px;
  padding: 4px 6px 0 6px;
  text-align: left;
  color: red;
  font-size: 9px;
  line-height: 14px;
}
.event-time .when { display: block; font-size: 12px; }
.event-time .dist { display: block; font-size: 12px; color: #667; }

.event-body {
  flex: 1;
  min-width: 0;
  padding: 4px 10px;
  border-left: 1px dotted grey;
}
.event-body h2 {
  margin: 0;
  font-size: 12px;
  font-weight: bold;
  line-height: 18px;
}
.event-body .address { margin: 0; overflow-wrap: anywhere; }
.event-body .meta { margin: 0; color: #777; overflow-wrap: anywhere; }

details { margin-top: 4px; }
summary { cursor: pointer; color: #08c; }
summary:hover { text-decoration: underline; }

.audio-players label { display: block; margin: 6px 0; color: #777; }
.audio-players audio { display: block; width: 100%; max-width: 420px; }

.event-details {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 0 15px;
  margin: 8px 0 4px;
}
.event-details dt {
  padding: 4px;
  color: grey;
  text-align: right;
}
.event-details dd {
  margin: 0;
  padding: 4px;
  overflow-wrap: anywhere;
}

.empty { color: #999; text-align: center; padding: 40px 0; }

/* ---- forms (login / settings) -------------------------------------------- */

.card {
  background: whitesmoke;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 20px;
  margin: 20px 0;
}
.card.narrow { max-width: 340px; margin-left: auto; margin-right: auto; }
.card h1 { margin: 0 0 14px; font-size: 22px; }

fieldset {
  border: 1px solid #ddd;
  border-radius: 4px;
  margin: 0 0 16px;
  padding: 12px 14px;
  background: #fff;
}
legend { color: #555; font-weight: bold; padding: 0 6px; }

label { display: block; margin: 10px 0; color: grey; }
label.inline { display: flex; align-items: center; gap: 8px; }

input[type=text], input[type=tel], input[type=email],
input[type=password], input[type=number], textarea {
  display: block;
  width: 100%;
  max-width: 350px;
  margin-top: 4px;
  padding: 6px 8px;
  color: #333;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  font: inherit;
}
input:focus, textarea:focus {
  outline: none;
  border-color: rgba(82, 168, 236, 0.8);
  box-shadow: 0 0 8px rgba(82, 168, 236, 0.6);
}

button {
  color: #fff;
  border: 1px solid #7d99ca;
  border-radius: 3px;
  padding: 8px 20px;
  font: inherit;
  font-weight: bold;
  text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.3);
  cursor: pointer;
  background-color: #a5b8da;
  background-image: linear-gradient(to bottom, #a5b8da, #7089b3);
}
button:hover {
  border-color: #5d7fbc;
  background-color: #819bcb;
  background-image: linear-gradient(to bottom, #819bcb, #536f9d);
}
button:disabled { opacity: .45; cursor: not-allowed; }
button.danger { background: #b94a48; border-color: #913b39; }

/* ---- fleet discovery ------------------------------------------------------ */
.discovery-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin: 20px 0; }
.discovery-head h2 { margin: 0 0 5px; }
.discovery-head p { margin: 0; max-width: 620px; color: #666; }
.discovery-run { min-width: 180px; padding: 10px 12px; background: #f4f8fb; border-left: 4px solid #1999ce; }
.discovery-run strong, .discovery-run span { display: block; }
.discovery-run span { color: #666; font-size: 12px; }
.discovery-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin: 18px 0; }
#review-feedback.is-live { position: fixed; z-index: 1000; top: 14px; right: 14px; max-width: min(420px, calc(100vw - 28px)); padding: 10px 14px; border: 1px solid #ccc; border-radius: 5px; background: #fff; box-shadow: 0 3px 16px rgba(0,0,0,.2); }
#review-feedback.is-live p { margin: 0; }
.discovery-tabs a { padding: 6px 10px; border: 1px solid #ccc; border-radius: 14px; color: #555; }
.discovery-tabs a.active { color: #fff; background: #1999ce; border-color: #1687b7; }
.candidate-list { display: grid; gap: 14px; }
.candidate-card { padding: 15px; border: 1px solid #ddd; border-radius: 6px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.candidate-card.is-saving { opacity: .62; }
.candidate-card.is-reviewed { opacity: 0; transform: translateY(-6px); transition: opacity .2s, transform .2s; }
.candidate-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.candidate-card h3 { display: inline; margin: 0 8px 0 0; font-size: 19px; }
.candidate-photo { position: relative; flex: 0 0 auto; margin-left: auto; }
.candidate-photo[hidden] { display: none; }
.candidate-photo-link { display: block; width: 72px; height: 48px; overflow: hidden; border: 1px solid #ccc; border-radius: 4px; background: #f1f1f1; }
.candidate-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.candidate-photo-link:hover, .candidate-photo-link:focus { position: relative; z-index: 10; width: 288px; height: 192px; margin: -72px -108px -72px -108px; box-shadow: 0 5px 18px rgba(0,0,0,.35); outline: 2px solid #1999ce; }
.candidate-callsigns { display: block; margin-top: 4px; color: #777; font-size: 12px; }
.mono { color: #777; font-family: monospace; }
.candidate-state { padding: 3px 8px; border-radius: 10px; background: #eee; font-size: 12px; font-weight: bold; }
.candidate-state.matched { color: #287a3c; background: #eaf5ec; }
.candidate-state.conflict { color: #a42d2d; background: #fbeaea; }
.candidate-state.pending, .candidate-state.unavailable { color: #8a5b00; background: #fff4da; }
.candidate-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px 24px; margin: 14px 0; }
.candidate-grid small, .candidate-grid strong, .candidate-grid span { display: block; overflow-wrap: anywhere; }
.candidate-grid small { color: #888; text-transform: uppercase; letter-spacing: .04em; }
.candidate-grid span { color: #666; }
.candidate-actions { display: flex; align-items: end; gap: 8px; margin-top: 12px; }
.candidate-actions input { flex: 1; margin: 0; max-width: none; }
.candidate-actions.compact { justify-content: flex-end; }
.reviewed { color: #666; font-size: 12px; }
@media (max-width: 680px) {
  .discovery-head, .candidate-actions { display: block; }
  .candidate-grid { grid-template-columns: 1fr; }
  .candidate-photo-link:hover, .candidate-photo-link:focus { width: 216px; height: 144px; margin: -48px -48px -48px -96px; }
  .discovery-run { margin-top: 12px; }
  .candidate-actions button { margin-top: 8px; width: 100%; }
}

.error { color: #b94a48; }
.saved { color: #468847; }

/* ---- footer --------------------------------------------------------------- */

.footer {
  text-align: center;
  padding: 50px;
  background-color: #C1DDFF;
  margin-top: 25px;
  font-size: 12px;
}

/* ---- small screens --------------------------------------------------------- */

@media (max-width: 600px) {
  .event { flex-direction: column; gap: 2px; }
  .event-time { display: flex; gap: 10px; align-items: baseline; min-width: 0; }
  .event-body { border-left: none; padding: 0 6px 4px; }
}

/* ---- map tabs (lightning, airtankers): compact header + full-height frame -- */

body.map { display: flex; flex-direction: column; min-height: 100vh; }
body.map .container { flex: 1 1 auto; display: flex; flex-direction: column;
                      max-width: none; width: 100%; margin: 0; padding: 0 8px; }
body.map #menubar { margin-top: 10px; }
body.map main { flex: 1 1 auto; display: flex; }
body.map .mapframe { flex: 1 1 auto; width: 100%; border: 0; min-height: 320px; }
body.map #map { flex: 1 1 auto; width: 100%; min-height: 320px; }
body.map .footer { padding: 8px; margin-top: 0; }

/* ---- shared event replays ------------------------------------------------ */

.replay-index { max-width: 820px; margin: 24px auto; padding: 0 12px; width: 100%; }
.replay-heading h1 { margin-bottom: 4px; }
.replay-heading p { margin-top: 0; color: #667; }
.replay-card {
  display: flex; align-items: center; gap: 14px; margin: 10px 0; padding: 15px 16px;
  border: 1px solid #d8dfe6; border-radius: 8px; background: #fff; color: #234;
  text-decoration: none; box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.replay-card:hover { border-color: #79a9ca; box-shadow: 0 2px 7px rgba(25,85,125,.12); }
.replay-icon { font-size: 25px; color: #2878b5; }
.replay-card-body { display: flex; flex: 1; flex-direction: column; gap: 3px; }
.replay-card-body span { color: #778; font-size: 12px; }
.replay-open { color: #2878b5; font-weight: bold; white-space: nowrap; }
.replay-shell { position: relative; flex: 1 1 auto; width: 100%; min-height: 430px; overflow: hidden; }
#replay-map { position: absolute; inset: 0; }
.replay-topbar {
  position: absolute; z-index: 1000; top: 10px; left: 50px; right: 10px;
  display: flex; gap: 14px; align-items: center; padding: 8px 12px;
  border-radius: 7px; background: rgba(255,255,255,.95); box-shadow: 0 1px 5px rgba(0,0,0,.18);
}
.replay-topbar > div { display: flex; flex: 1; min-width: 0; flex-direction: column; }
.replay-topbar strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.replay-topbar span { color: #667; font-size: 11px; }
.replay-back { color: #2878b5; text-decoration: none; white-space: nowrap; }
.replay-controls {
  --trigger-pos: 50%; position: absolute; z-index: 1000; bottom: 18px; left: 18px; right: 18px;
  display: flex; gap: 10px; align-items: center; padding: 11px 14px;
  border-radius: 9px; background: rgba(20,31,42,.94); color: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.35);
}
.replay-controls button { padding: 6px 11px; min-width: 48px; text-shadow: none; }
.replay-controls select { padding: 6px; border-radius: 4px; }
.replay-controls input[type=range] {
  flex: 1; min-width: 80px; accent-color: #e17a36;
  background: linear-gradient(to right, #2878b5 0 var(--trigger-pos), #d96b25 var(--trigger-pos) 100%);
}
.replay-time { display: flex; min-width: 105px; flex-direction: column; }
.replay-time span { color: #aebaca; font-size: 10px; }
.replay-legend {
  position: absolute; z-index: 999; right: 18px; bottom: 78px; display: flex; gap: 12px;
  padding: 5px 9px; border-radius: 5px; background: rgba(255,255,255,.92); font-size: 11px;
}
.replay-legend i { display: inline-block; width: 14px; height: 3px; vertical-align: middle; }
.replay-legend .pre { background: #2878b5; }.replay-legend .post { background: #d96b25; }
.replay-legend .trigger { width: 8px; height: 8px; border: 2px solid #c33; border-radius: 50%; }
.replay-aircraft span { display: block; width: 36px; height: 36px; transform-origin: center; }
.replay-aircraft svg { width: 36px; height: 36px; overflow: visible; filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 1px #fff); }
.replay-aircraft path,.replay-aircraft ellipse { fill: #174f78; stroke: #174f78; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.replay-aircraft.helicopter path { fill: none; }
.replay-aircraft.helicopter ellipse { fill: #174f78; }
@media (max-width: 600px) {
  .replay-topbar { left: 45px; gap: 7px; }.replay-back { font-size: 0; }.replay-back:first-letter { font-size: 22px; }
  .replay-controls { left: 8px; right: 8px; bottom: 8px; gap: 6px; padding: 8px; }
  .replay-time { display: none; }.replay-controls button { min-width: 40px; padding: 6px; }
  .replay-legend { right: 8px; bottom: 64px; }
}
