/* ════════════════════════════════════════════
   The Holidave — Itinerary Builder
   template-itinerary-builder.php
═══════════════════════════════════════════════ */

.itb-wrap { font-family: 'Inter', sans-serif; background: #F2F2F0; }
.itb-page { max-width: 1220px; margin: 0 auto; padding: 2rem 2rem 4rem; }

/* ─── BREADCRUMB ─── */
.itb-bc { margin-bottom: 1.5rem; }
.itb-bc-list { list-style: none; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0; padding: 0; }
.itb-bc-item { font-size: 12px; }
.itb-bc-link { color: #767676; text-decoration: none; display: flex; align-items: center; gap: 4px; }
.itb-bc-link:hover { color: #0a5b66; }
.itb-bc-sep { color: #ccc; font-size: 10px; }
.itb-bc-cur { color: #333; font-weight: 600; font-size: 12px; }

/* ─── ACCESS GATE (not logged in / not approved) ─── */
.itb-gate { text-align: center; background: #fff; border-radius: 6px; padding: 3.5rem 2rem; box-shadow: 0 4px 20px rgba(0,0,0,.06); }
.itb-gate i { font-size: 40px; color: #0a5b66; opacity: .35; margin-bottom: 1rem; display: block; }
.itb-gate h1 { font-size: 22px; font-weight: 800; color: #111; margin: 0 0 .5rem; }
.itb-gate p { font-size: 14px; color: #767676; margin: 0 0 1.5rem; }

/* ─── HERO ─── */
.itb-hero { margin-bottom: 2rem; }
.itb-hero-h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; color: #111; margin: 0 0 .4rem; }
.itb-hero-sub { font-size: 14px; color: #767676; margin: 0; }

/* ─── BUTTONS ─── */
.itb-btn-primary { display: inline-flex; align-items: center; gap: 8px; background: #FB5B32; color: #fff; border: none; padding: 12px 22px; border-radius: 6px; font-size: 14px; font-weight: 700; cursor: pointer; text-decoration: none; }
.itb-btn-primary:hover { background: #e04a22; }
.itb-btn-secondary { display: inline-flex; align-items: center; gap: 8px; background: #fff; color: #0a5b66; border: 1.5px solid #0a5b6638; padding: 10px 18px; border-radius: 6px; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.itb-btn-secondary:hover { background: #E3F2F4; }
.itb-btn-danger { display: inline-flex; align-items: center; gap: 8px; background: #fff; color: #c62828; border: 1.5px solid #c6282857; padding: 10px 18px; border-radius: 6px; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.itb-btn-danger:hover { background: #fdeaea; }
.itb-btn-small { padding: 6px 12px; font-size: 12px; }
.itb-btn-add { display: inline-flex; align-items: center; gap: 6px; background: #F4F4F2; color: #0a5b66; border: 1px dashed #c5c5c2; padding: 10px 16px; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; margin-top: 8px; }
.itb-btn-add:hover { background: #E3F2F4; }
.itb-btn-remove { background: none; border: none; color: #c62828; cursor: pointer; padding: 6px 8px; flex-shrink: 0; }
.itb-btn-remove:hover { color: #8a1c1c; }

/* ─── LIST VIEW ─── */
.itb-list-view { background: #fff; border-radius: 6px; padding: 2rem; box-shadow: 0 4px 20px rgba(0,0,0,.06); }
.itb-list-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.itb-list-hdr h2 { font-size: 18px; font-weight: 800; color: #111; margin: 0; }
.itb-loading { text-align: center; padding: 2.5rem; color: #888; font-size: 13px; }
.itb-empty { text-align: center; padding: 2.5rem; color: #888; }
.itb-empty i { font-size: 32px; opacity: .25; display: block; margin-bottom: .75rem; }
.itb-error { color: #c62828; text-align: center; padding: 1.5rem; }

.itb-list-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.itb-list-card { background: #F8F8F6; border: 1px solid #E2E2DE; border-radius: 6px; padding: 1.25rem; }
.itb-list-card-title { font-size: 15px; font-weight: 700; color: #111; margin-bottom: 4px; }
.itb-list-card-dest { font-size: 12.5px; color: #767676; margin-bottom: 6px; display: flex; align-items: center; gap: 5px; }
.itb-list-card-meta { font-size: 11.5px; color: #999; margin-bottom: 12px; }
.itb-status-badge { text-transform: uppercase; font-weight: 700; font-size: 10px; padding: 2px 7px; border-radius: 6px; }
.itb-status-draft { background: #fff3cd; color: #8a6500; }
.itb-status-publish { background: #d4f4dd; color: #1d7a3d; }
.itb-list-card-actions { display: flex; gap: 8px; }

/* ─── BUILDER ─── */
.itb-builder-topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; background: #fff; border-radius: 6px; padding: 1rem 1.25rem; box-shadow: 0 4px 20px rgba(0,0,0,.06); position: sticky; top: 10px; z-index: 20; }
.itb-builder-status { font-size: 12.5px; font-weight: 600; color: #888; flex: 1; text-align: center; }
.itb-builder-status.itb-saved { color: #1d7a3d; }
.itb-builder-status.itb-unsaved { color: #b08400; }
.itb-builder-actions { display: flex; gap: 8px; }

.itb-section { background: #fff; border-radius: 6px; padding: 1.75rem; margin-bottom: 1.25rem; box-shadow: 0 4px 20px rgba(0,0,0,.06); }
.itb-section-h { font-size: 15px; font-weight: 800; color: #111; margin: 0 0 1.1rem; padding-bottom: .75rem; border-bottom: 1px solid #F0F0EE; }

.itb-field { margin-bottom: 14px; }
.itb-field:last-child { margin-bottom: 0; }
.itb-field label { display: block; font-size: 11.5px; font-weight: 700; color: #555; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 5px; }
.itb-field input, .itb-field textarea { width: 100%; border: 1.5px solid #E2E2DE; border-radius: 6px; padding: 10px 12px; font-size: 14px; font-family: inherit; outline: none; }
.itb-field input:focus, .itb-field textarea:focus { border-color: #0a5b66; }
.itb-field textarea { resize: vertical; }
.itb-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.itb-field-row:last-child { margin-bottom: 0; }
.itb-field-row .itb-field { margin-bottom: 0; } /* fields inside a row rely on the row's own margin instead, so spacing never doubles up */

/* Hero image upload */
.itb-image-upload { border: 2px dashed #c5c5c2; border-radius: 6px; height: 160px; display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; background: #FAFAF8; margin-bottom: 8px; }
.itb-image-upload:hover { border-color: #0a5b66; }
.itb-image-upload img { width: 100%; height: 100%; object-fit: cover; }
.itb-image-upload-empty { color: #999; font-size: 13px; text-align: center; }
.itb-image-upload-empty i { font-size: 28px; display: block; margin-bottom: 6px; opacity: .5; }

/* Dynamic rows (highlights / cost / hotels) */
.itb-dyn-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.itb-dyn-row input { flex: 1; border: 1.5px solid #E2E2DE; border-radius: 6px; padding: 9px 11px; font-size: 13.5px; font-family: inherit; outline: none; }
.itb-dyn-row input:focus { border-color: #0a5b66; }
.itb-dyn-row-cost input:nth-child(1) { flex: 2; }
.itb-dyn-row-cost input:nth-child(2) { flex: 0 0 100px; }
.itb-dyn-row-cost input:nth-child(3) { flex: 1; }
.itb-dyn-row-3col .itb-field-mini:nth-child(1) { flex: 1; }
.itb-dyn-row-3col .itb-field-mini:nth-child(2) { flex: 0 0 110px; }
.itb-dyn-row-3col .itb-field-mini:nth-child(3) { flex: 2; }

/* Day cards */
.itb-day-card { background: #FAFAF8; border: 1px solid #E2E2DE; border-radius: 6px; padding: 1.1rem; margin-bottom: 10px; }
.itb-day-card-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 10px; }
.itb-day-card-hdr strong { font-size: 13px; color: #0a5b66; text-transform: uppercase; letter-spacing: .03em; }

.itb-section-hint { font-size: 12.5px; color: #888; margin: -4px 0 12px; }
.itb-inc-items { padding-left: 12px; border-left: 2px solid #E2E2DE; margin-bottom: 8px; }

/* Hotel row fields — each input now sits inside a small wrapper
   with a persistent label above it. Desktop keeps these labels
   subtle (small, muted) since the row's left-to-right order plus
   placeholders already make the field purpose clear; on mobile,
   once the row stacks to full-width, the label becomes the ONLY
   way to tell "Dubai" (city) apart from "Dubai" (hotel name). */
.itb-field-mini { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.itb-mini-label { font-size: 10px; font-weight: 700; color: #999; text-transform: uppercase; letter-spacing: .04em; }

/* Inclusion group header (city name input + delete button) — on
   mobile the input was sharing a tight flex row with the delete
   button, truncating the placeholder text. Wrapping lets the input
   take a full row of its own with the delete button below it. */
@media (max-width: 480px) {
  .itb-day-card-hdr { flex-wrap: wrap; }
  .itb-day-card-hdr .itb-inc-city { flex: 1 1 100% !important; order: 1; }
  .itb-day-card-hdr .itb-btn-remove { order: 2; margin-left: auto; }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .itb-page { padding: 1.25rem 1rem 3rem; }
  .itb-field-row { grid-template-columns: 1fr; }
  .itb-list-grid { grid-template-columns: 1fr; }
  .itb-builder-topbar { flex-direction: column; align-items: stretch; position: static; }
  .itb-builder-status { text-align: left; }
  .itb-builder-actions { justify-content: stretch; }
  .itb-builder-actions button { flex: 1; justify-content: center; }
  .itb-dyn-row-3col { flex-wrap: wrap; }
  .itb-dyn-row-3col .itb-field-mini { flex: 1 1 100% !important; }
  .itb-dyn-row-3col input { width: 100%; }
  .itb-dyn-row-cost { flex-wrap: wrap; }
  .itb-dyn-row-cost input { flex: 1 1 100% !important; }
}