/* Soaringlab v2 — phase 1 styles. Plain CSS, no preprocessor. */

:root {
  --bg:        #14181d;
  --bg-elev:   #1d232b;
  --bg-card:   #232b35;
  --border:    #2f3a47;
  --fg:        #e4e8ee;
  --fg-muted:  #8c97a6;
  --accent:    #2e9e54;
  --accent-2:  #38b000;
  --danger:    #e63946;
  --warn:      #f4a261;
  --shadow:    0 2px 6px rgba(0,0,0,.4);
  --radius:    6px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.5 'Saira', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
#appHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}
.logo .logo-main {
  /*font-weight: 700;*/
  font-size: 18px;
  /*letter-spacing: .12em;*/
}
.logo .logo-sub {
  color: var(--accent);
  font-weight: 600;
  margin-left: 6px;
  font-size: 14px;
}
nav .nav-link {
  margin-left: 18px;
  font-size: 13px;
  color: var(--fg-muted);
}
nav .nav-link:hover { color: var(--fg); }
nav .nav-user {
  margin-left: 18px;
  font-size: 13px;
  color: var(--accent-2);
}

/* Admin dropdown — only rendered for admins (see index.php). */
.admin-menu { position: relative; margin-left: 18px; }
.admin-menu > summary {
  list-style: none;
  cursor: pointer;
  margin-left: 0;            /* override nav-link's left margin inside the summary */
}
.admin-menu > summary::-webkit-details-marker { display: none; }
.admin-menu[open] > summary { color: var(--fg); }
.admin-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  display: flex;
  flex-direction: column;
  min-width: 170px;
  padding: 6px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  z-index: 1000;
}
.admin-menu-list a {
  padding: 7px 10px;
  font-size: 13px;
  color: var(--fg-muted);
  border-radius: 6px;
  white-space: nowrap;
}
.admin-menu-list a:hover {
  background: rgba(255, 255, 255, .06);
  color: var(--fg);
  text-decoration: none;
}
/* "View as non-PRO" toggle — a POST form styled to read like a menu link. */
.admin-menu-list form.admin-pro-preview { margin: 0; }
.admin-menu-list form.admin-pro-preview button {
  display: block; width: 100%; text-align: left;
  padding: 7px 10px; font: inherit; font-size: 13px; color: var(--fg-muted);
  background: none; border: none; border-radius: 6px; white-space: nowrap; cursor: pointer;
}
.admin-menu-list form.admin-pro-preview button:hover {
  background: rgba(255, 255, 255, .06); color: var(--fg);
}

/* Account avatar dropdown (logged-in users). Reuses the .admin-menu-list box. */
.user-menu { position: relative; margin-left: 18px; }
.user-menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-elev); border: 1px solid var(--border); color: var(--fg-muted);
}
.user-avatar svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.user-avatar:hover, .user-menu[open] .user-avatar { color: var(--fg); border-color: var(--fg-muted); }
.user-menu-list button {
  display: block; width: 100%; text-align: left;
  padding: 7px 10px; font: inherit; font-size: 13px; color: var(--fg-muted);
  background: none; border: none; border-radius: 6px; white-space: nowrap; cursor: pointer;
}
.user-menu-list button:hover { background: rgba(255, 255, 255, .06); color: var(--fg); }

/* Main */
#appMain { padding: 24px; max-width: 1200px; margin: 0 auto; }

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .2s, background .2s;
}
.dropzone.dragover {
  border-color: var(--accent);
  background: #1a242f;
}
.dropzone-inner { text-align: center; padding: 24px; }
.dropzone h1 { margin: 0 0 8px; font-size: 22px; font-weight: 500; }
.dropzone p  { margin: 4px 0; color: var(--fg-muted); }
.dropzone .file-link { color: var(--accent); cursor: pointer; text-decoration: underline; }
.dropzone .hint { font-size: 12px; opacity: .8; margin-top: 12px; }

/* Results */
.results.hidden, .hidden { display: none !important; }
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.results-header h2 { margin: 0; font-weight: 500; font-size: 18px; }
.results-actions .btn { margin-left: 8px; }

.btn {
  background: var(--bg-card);
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font: inherit;
}
.btn:hover { background: var(--bg-elev); }
.btn-primary {
  background: #2e9e54;
  border-color: #2e9e54;
  color: #fff;
}
.btn-primary:hover { background: #278548; }
.btn-danger {
  background: transparent;
  border-color: #b3413a;
  color: #d9534f;
}
.btn-danger:hover { background: #b3413a; color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Flight-edit footer: verwijder-knop links, spacer duwt Cancel/Save rechts.
   Id-selector wint van de generieke `.modal-footer .btn { flex: 1 }`. */
#flightEditModal .modal-footer .btn { flex: 0 0 auto; }
#flightEditModal .modal-footer-spacer { flex: 1 1 auto; }

/* Messages */
.messages { margin-bottom: 16px; }
.msg {
  padding: 8px 12px;
  border-radius: var(--radius);
  margin-bottom: 6px;
  font-size: 13px;
}
.msg-error { background: #3a1820; border-left: 3px solid var(--danger); }
.msg-warn  { background: #3a2b18; border-left: 3px solid var(--warn);   }
.msg-info  { background: #182d3a; border-left: 3px solid var(--accent); }

/* Grid */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card h3 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--fg-muted);
}
.card-wide { grid-column: 1 / -1; }

/* Key-value tables */
table.kv {
  width: 100%;
  border-collapse: collapse;
}
table.kv td {
  padding: 6px 8px;
  border-bottom: 1px solid #2a323d;
  vertical-align: top;
}
table.kv td:first-child {
  width: 38%;
  color: var(--fg-muted);
  font-size: 13px;
}
table.kv td.muted { color: var(--fg-muted); font-style: italic; }
table.kv tr:last-child td { border-bottom: none; }

@media (max-width: 700px) {
  .grid { grid-template-columns: 1fr; }
  table.kv td:first-child { width: 50%; }
}
