/* Van Adventures Journal — shared styles. Keep this readable and easy to tweak. */

:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-2: #f1ede5;
  --border: #e3ddd0;
  --text: #2a2a28;
  --text-muted: #6b6b66;
  --accent: #2d6e56;       /* forest green */
  --accent-2: #c87241;     /* sunset orange */
  --accent-blue: #3a7ab8;
  --danger: #b54040;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

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

/* ---------- LAYOUT ---------- */
.shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

.brand-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: 2px 0 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-muted);
}

/* ---------- AUTH ---------- */
.auth-wrap {
  max-width: 380px;
  margin: 6rem auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.auth-wrap h1 {
  font-size: 22px;
  margin: 0 0 0.25rem;
}
.auth-wrap p.lede {
  margin: 0 0 1.25rem;
  font-size: 14px;
  color: var(--text-muted);
}

.auth-toggle {
  display: flex;
  gap: 8px;
  font-size: 13px;
  margin-top: 1rem;
  color: var(--text-muted);
}
.auth-toggle button {
  background: none;
  border: none;
  color: var(--accent-blue);
  cursor: pointer;
  padding: 0;
  font: inherit;
}

/* ---------- FORMS ---------- */
.field { display: block; margin-bottom: 0.85rem; }
.field label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
}
.field textarea { resize: vertical; min-height: 80px; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45,110,86,0.15);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--surface-2); }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.btn.primary:hover { background: #245b48; }
.btn.danger { color: var(--danger); border-color: #e0bdbd; }
.btn.danger:hover { background: #faecec; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-full { width: 100%; }

/* ---------- STATS ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 1.5rem;
}
.stat {
  background: var(--surface-2);
  padding: 14px 16px;
  border-radius: var(--radius);
}
.stat-label { font-size: 13px; color: var(--text-muted); margin: 0; }
.stat-value { font-size: 24px; font-weight: 500; margin: 4px 0 0; }

/* ---------- CARDS ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.card-header h2 { font-size: 16px; font-weight: 500; margin: 0; }

/* ---------- MAP ---------- */
.map {
  width: 100%;
  height: 380px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.map-sm { height: 280px; }

.map-legend {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--text-muted);
  align-items: center;
}
.map-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
@media (max-width: 580px) {
  .map-legend { gap: 10px; font-size: 11px; }
}

/* ---------- TRIP LIST ---------- */
.trip-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.trip-row:last-child { border-bottom: none; }
.trip-row .name { font-weight: 500; margin: 0; }
.trip-row .meta { font-size: 13px; color: var(--text-muted); margin: 2px 0 0; }
.trip-row .right { text-align: right; font-size: 13px; color: var(--text-muted); }
.trip-row a { color: var(--text); }

/* ---------- TRIP DETAIL ---------- */
.trip-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.trip-header h1 { font-size: 22px; margin: 0 0 4px; }
.trip-header .meta { color: var(--text-muted); font-size: 14px; margin: 0; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 760px) {
  .two-col { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .field-row { grid-template-columns: 1fr; }
}

.stop-row, .journal-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.stop-row:last-child, .journal-row:last-child { border-bottom: none; }
.stop-row .title, .journal-row .title { font-weight: 500; margin: 0; }
.stop-row .meta, .journal-row .meta { font-size: 12px; color: var(--text-muted); margin: 2px 0 0; }
.stop-row .notes, .journal-row .body { font-size: 13px; margin: 6px 0 0; white-space: pre-wrap; }
.row-actions { margin-top: 6px; display: flex; gap: 6px; }

/* ---------- MODAL ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20,20,18,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
}
.modal h2 { margin: 0 0 1rem; font-size: 18px; }
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 1rem;
}

.hidden { display: none !important; }

.empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  padding: 1.5rem 0;
}

.error {
  background: #fbeaea;
  color: var(--danger);
  border: 1px solid #e8c2c2;
  border-radius: var(--radius);
  padding: 8px 10px;
  font-size: 13px;
  margin-bottom: 0.75rem;
}
