/* Trip planner (plan.html): the question wizard and the generated itinerary. */

/* ============ WIZARD SHELL ============ */
.plan-shell {
  width: min(720px, 100% - 48px);
  margin: 0 auto;
  padding: 30px 0 90px;
}
.plan-progress {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 30px;
}
.plan-progress i {
  width: 34px;
  height: 4px;
  border-radius: 999px;
  background: var(--cream-deep);
  transition: background 0.25s ease;
}
.plan-progress i.on { background: var(--accent); }

.plan-card {
  padding: 40px 42px 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  box-shadow: 0 30px 60px -40px rgba(30, 35, 64, 0.5);
}
.plan-step h2 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.plan-step .hint { margin: 0 0 24px; color: var(--muted); font-size: 15px; }

/* ---- option chips ---- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chip-opt {
  min-width: 132px;
  padding: 10px 32px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font: inherit;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.chip-opt:hover { transform: translateY(-1px); border-color: var(--accent); }
.chip-opt.on {
  border-color: var(--accent);
  background: rgba(63, 95, 190, 0.1);
  color: var(--accent-dark);
}
.chip-opt .sub { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }

/* ---- city photo picker ---- */
.city-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.city-pick {
  position: relative;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 16px;
  overflow: hidden;
  background: var(--cream-deep);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.city-pick:hover { transform: translateY(-2px); box-shadow: 0 16px 28px -20px rgba(30, 35, 64, 0.8); }
.city-pick img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.city-pick span {
  position: absolute;
  inset: auto 0 0 0;
  padding: 22px 10px 8px;
  background: linear-gradient(180deg, transparent, rgba(20, 24, 48, 0.78));
  color: #fff;
  font-size: 11px;
  line-height: 1.3;
  text-align: left;
  padding-left: 12px;
}
.city-pick span strong { display: block; font-size: 13.5px; letter-spacing: -0.01em; }
.city-pick.on { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(63, 95, 190, 0.25); }
.city-pick.on::after {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

/* ---- "somewhere else" tile & input ---- */
.city-more {
  border: 2px dashed rgba(63, 95, 190, 0.45);
  background: rgba(63, 95, 190, 0.05);
}
.city-more span { background: none; color: var(--ink); }
.city-more .plus {
  position: absolute;
  top: 22%;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 36px;
  font-weight: 300;
  line-height: 1;
  color: var(--accent);
}
.city-more .label {
  position: absolute;
  inset: auto 0 0 0;
  padding: 8px 12px;
  font-size: 11px;
  color: var(--muted);
}
.city-more .label strong { display: block; font-size: 13.5px; color: var(--ink); }
.custom-city-row { margin-top: 16px; align-items: flex-end; }
.custom-city-use { flex: 0 0 auto; }
.custom-city-use .btn { border: 0; cursor: pointer; font: inherit; }

/* ---- inputs ---- */
.plan-row { display: flex; gap: 16px; flex-wrap: wrap; }
.plan-field { flex: 1; min-width: 180px; }
.plan-field label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.plan-field input, .plan-field select {
  width: 100%;
  padding: 12px 15px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fff;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
}
.plan-field input:focus, .plan-field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---- stepper buttons ---- */
.plan-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 30px;
}
.plan-back {
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}
.plan-back:hover { color: var(--ink); }
.plan-next { border: 0; cursor: pointer; font: inherit; }

/* counter */
.counter { display: inline-flex; align-items: center; gap: 14px; }
.counter button {
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: #fff;
  font-size: 20px;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
}
.counter button:hover { border-color: var(--accent); color: var(--accent-dark); }
.counter strong { min-width: 34px; text-align: center; font-size: 22px; }

/* ============ GENERATING ============ */
.plan-loading { text-align: center; padding: 60px 0 40px; }
.plan-loading .orbit {
  width: 54px;
  height: 54px;
  margin: 0 auto 22px;
  border: 3px dotted var(--accent);
  border-radius: 50%;
  animation: orbit-spin 1.6s linear infinite;
}
@keyframes orbit-spin { to { transform: rotate(360deg); } }
.plan-loading p { color: var(--muted); }

/* ============ ITINERARY ============ */
.itin-hero {
  position: relative;
  margin: -40px -42px 26px; /* bleed to the card edges */
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
}
.itin-hero img {
  width: 100%;
  height: clamp(150px, 24vw, 230px);
  object-fit: cover;
}
.itin-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(20, 24, 48, 0.55) 100%);
}
.itin-hero-name {
  position: absolute;
  left: 22px;
  bottom: 14px;
  z-index: 2;
  color: #fff;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.itin-head { text-align: center; margin: 8px 0 26px; }
.itin-head h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.itin-head p { margin: 0; color: var(--muted); }
.itin-head .badges { margin-top: 14px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.itin-badge {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(63, 95, 190, 0.1);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 600;
}

.day-card {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.85);
  overflow: hidden;
}
.day-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 24px;
  background: var(--cream-deep);
}
.day-head h3 { margin: 0; font-size: 16px; font-weight: 600; flex: 1; }
.day-head .date { color: var(--muted); font-size: 13.5px; }
.weather {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
}
.weather svg { width: 17px; height: 17px; }
.weather.rainy { color: #33518f; }
.weather.sunny { color: #b07a1f; }

.slot {
  display: flex;
  gap: 16px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
}
.slot-time {
  flex: none;
  width: 86px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 3px;
}
.slot-body { flex: 1; min-width: 0; }
.slot-body strong { display: block; font-size: 15.5px; letter-spacing: -0.01em; }
.slot-body p { margin: 3px 0 0; font-size: 13.5px; color: var(--muted); }
.slot-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  font-size: 12.5px;
  color: #33518f;
  background: rgba(63, 95, 190, 0.08);
  border-radius: 999px;
  padding: 3px 11px;
}
.slot-note svg {
  width: 14px;
  height: 14px;
  flex: none;
}
.slot .btn { align-self: center; flex: none; padding: 9px 18px; font-size: 13px; }

/* ---- per-slot editing tools ---- */
.slot-tools {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  flex: none;
}
.slot-tools button {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.slot-tools button:hover { color: var(--accent-dark); border-color: var(--accent); }
.slot-tools button svg { width: 13px; height: 13px; }

.itin-hint {
  margin: 0 0 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* ---- top sights (live Wikipedia data) ---- */
.sights {
  margin-top: 20px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.85);
}
.sights h3 { margin: 0 0 4px; font-size: 17px; letter-spacing: -0.01em; }
.sights > p { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.sights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.sight {
  display: flex;
  gap: 11px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.sight:hover { transform: translateY(-2px); box-shadow: 0 14px 24px -20px rgba(30, 35, 64, 0.8); }
.sight img, .sight-ph {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--cream-deep);
}
.sight-body { min-width: 0; }
.sight-body strong { display: block; font-size: 13.5px; line-height: 1.3; }
.sight-body em {
  display: block;
  margin: 2px 0;
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  color: #b07a1f;
}
.sight-body small {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.35;
}
.sights-loading {
  margin: 18px 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.itin-total {
  margin-top: 24px;
  padding: 22px 26px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.itin-total strong { font-size: 22px; }
.itin-total span { color: rgba(255, 255, 255, 0.75); font-size: 14px; flex: 1; min-width: 200px; }

.itin-actions { display: flex; gap: 12px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }

@media (max-width: 560px) {
  .plan-card { padding: 28px 22px; }
  .slot { flex-wrap: wrap; }
  .itin-hero { margin: -28px -22px 20px; }
}
