/* ABOUTME: Mobile-first dark styling for the WhereWhen PWA.
   ABOUTME: One screen, big touch target for the primary action, a list below. */

:root {
  --bg: #0b1d2a;
  --bg-elev: #11293a;
  --fg: #e7ecf0;
  --fg-dim: #8aa0b1;
  --accent: #4ec9b0;
  --accent-fg: #0b1d2a;
  --danger: #e06c75;
  --radius: 12px;
  --gap: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: env(safe-area-inset-top, 12px) var(--gap) 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.icon-btn {
  background: transparent;
  color: var(--fg-dim);
  border: none;
  font-size: 1.5rem;
  padding: 8px;
  cursor: pointer;
}

.icon-btn:hover { color: var(--fg); }

main {
  padding: var(--gap);
  display: flex;
  flex-direction: column;
  gap: 32px;
}

#checkin-section {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.primary-btn {
  background: var(--accent);
  color: var(--accent-fg);
  border: none;
  border-radius: var(--radius);
  padding: 22px;
  font-size: 1.25rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 80px;
  transition: filter 0.15s, transform 0.05s;
}

.primary-btn:active { transform: scale(0.98); }
.primary-btn:disabled { filter: grayscale(0.5) brightness(0.7); cursor: not-allowed; }

#status-line {
  margin: 0;
  text-align: center;
  color: var(--fg-dim);
  font-size: 0.95rem;
  min-height: 1.2em;
}

#status-line.success { color: var(--accent); }
#status-line.error { color: var(--danger); }

#recents-section h2 {
  margin: 0 0 12px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
}

#recents-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#recents-list li {
  background: var(--bg-elev);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.recent-place {
  font-weight: 600;
  color: var(--fg);
}

.recent-line {
  margin: 4px 0 0;
  color: var(--fg-dim);
  font-size: 0.85rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-word;
}

#recents-list:empty::before {
  content: "No visits yet.";
  display: block;
  color: var(--fg-dim);
  text-align: center;
  padding: 32px 0;
}

/* Dialogs */

dialog {
  background: var(--bg-elev);
  color: var(--fg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 20px;
  max-width: 92vw;
  width: 420px;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

dialog h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

dialog p {
  margin: 0 0 12px;
  color: var(--fg-dim);
  font-size: 0.95rem;
}

dialog form { display: flex; flex-direction: column; gap: 12px; }
dialog label { display: flex; flex-direction: column; gap: 4px; }
dialog label > span { font-size: 0.85rem; color: var(--fg-dim); }

dialog input, dialog select {
  background: rgba(0, 0, 0, 0.25);
  color: var(--fg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 1rem;
  font-family: inherit;
}

dialog input:focus, dialog select:focus {
  outline: none;
  border-color: var(--accent);
}

dialog details {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 8px 12px;
}

dialog details summary {
  cursor: pointer;
  color: var(--fg-dim);
  font-size: 0.9rem;
  padding: 4px 0;
}

dialog details[open] { padding-bottom: 12px; }
dialog details > label { margin-top: 8px; }

dialog menu {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0;
  margin: 8px 0 0;
}

dialog menu button {
  background: rgba(255, 255, 255, 0.08);
  color: var(--fg);
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 1rem;
  cursor: pointer;
}

dialog menu button#token-save,
dialog menu button#np-create {
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
}
