/* AU/NZ Adventure PWA - Unified Styles */

:root {
  /* Default theme (Australia) - overridden by JS per trip */
  --bg: #0b1020;
  --card: #121a33;
  --card-alpha: rgba(18,26,51,.86);
  --muted: #9fb0ff;
  --text: #e9ecff;
  --accent: #7aa2ff;
  --ok: #43d39e;
  --warn: #ffcc66;
  --border: rgba(122,162,255,.18);
  --border-light: rgba(122,162,255,.12);
  --gradient: radial-gradient(1200px 800px at 30% 0%, #19255a 0%, var(--bg) 55%);
  --shadow: 0 10px 25px rgba(0,0,0,.35);
  --soft: rgba(255,255,255,.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  background: var(--gradient);
  color: var(--text);
  line-height: 1.45;
  min-height: 100vh;
}

/* Trip Switcher */
.trip-switcher {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.trip-btn {
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--soft);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.trip-btn:hover {
  background: rgba(255,255,255,.1);
  border-color: var(--accent);
}

.trip-btn.active {
  background: var(--accent);
  color: #0b1020;
  border-color: var(--accent);
}

.trip-btn .flag {
  font-size: 16px;
}

/* Header */
header {
  padding: 28px 18px 16px;
  max-width: 1100px;
  margin: 0 auto;
}

h1 {
  margin: 0 0 8px;
  font-size: 26px;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sub {
  color: var(--muted);
  font-size: 14px;
}

/* Main wrapper */
.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 18px 40px;
}

/* Cards */
.card {
  background: var(--card-alpha);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin: 14px 0;
  transition: opacity 0.2s ease;
}

.card.completed {
  opacity: 0.5;
}

.card-head {
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
}

.title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.title strong {
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.meta {
  color: var(--muted);
  font-size: 13px;
}

/* Day checkbox */
.day-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.day-checkbox:hover {
  border-color: var(--accent);
}

.day-checkbox.checked {
  background: var(--ok);
  border-color: var(--ok);
}

.day-checkbox.checked::after {
  content: "✓";
  color: #0b1020;
  font-size: 14px;
  font-weight: bold;
}

/* Badges */
.badge {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  color: var(--text);
  background: rgba(255,255,255,.06);
  white-space: nowrap;
  height: fit-content;
}

.badge.ok {
  border-color: rgba(67,211,158,.35);
  background: rgba(67,211,158,.09);
}

.badge.warn {
  border-color: rgba(255,204,102,.35);
  background: rgba(255,204,102,.10);
}

/* Card body */
.card-body {
  padding: 14px 16px 16px;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 14px;
}

@media (max-width: 900px) {
  .card-body {
    grid-template-columns: 1fr;
  }
}

/* Lists */
ul {
  margin: 8px 0 0 18px;
  padding: 0;
}

li {
  margin: 6px 0;
}

/* Maps */
.map {
  width: 100%;
  height: 320px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.map.big {
  height: 460px;
}

/* Notes */
.note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.tiny {
  font-size: 12px;
  color: var(--muted);
}

/* Links and pills */
.links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed rgba(122,162,255,.5);
}

a:hover {
  opacity: 0.92;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  font-size: 13px;
}

/* Collapsible details (from NZ South) */
details {
  margin-top: 12px;
  border: 1px solid var(--border);
  background: var(--soft);
  border-radius: 14px;
  padding: 10px 12px;
}

summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  user-select: none;
  font-weight: 600;
  color: var(--text);
}

summary::-webkit-details-marker {
  display: none;
}

.chev {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  flex: 0 0 auto;
  transition: transform 0.15s ease;
}

details[open] .chev {
  transform: rotate(180deg);
}

.detail-body {
  margin-top: 10px;
  color: rgba(234,242,255,.92);
  font-size: 14px;
}

.detail-body p {
  margin: 10px 0;
}

/* Chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  color: var(--muted);
}

/* Notes textarea */
.notes-section {
  margin-top: 12px;
}

.notes-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  padding: 6px 0;
}

.notes-toggle:hover {
  color: var(--accent);
}

.notes-textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.2);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
  margin-top: 8px;
}

.notes-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.notes-textarea::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

/* Loading states */
.loading {
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
}

/* Footer */
.footer {
  margin-top: 22px;
  color: var(--muted);
  font-size: 12px;
  opacity: 0.95;
}

/* Utility: hidden */
.hidden {
  display: none !important;
}

/* PWA install prompt */
.install-prompt {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
  z-index: 1000;
}

.install-prompt button {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

.install-prompt .install-btn {
  background: var(--accent);
  color: #0b1020;
}

.install-prompt .dismiss-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

/* PWA update prompt */
.update-prompt {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ok);
  color: #0b1020;
  border-radius: 14px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
  z-index: 1001;
  font-weight: 500;
  font-size: 14px;
}

.update-prompt .update-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  background: #0b1020;
  color: var(--ok);
}
