/* ═══════════════════════════════════════════
   Memoroam — Itinerary Cards v8
   Reference-inspired design: clean collapsed
   rows + rich gradient expanded cards.
   ═══════════════════════════════════════════ */

/* ── List container ──────────────────────── */

.ic-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 4px 0;
}

.ic-empty {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: #B5B3AC;
  padding: 16px 0;
}

/* ── Card shell ──────────────────────────── */

.ic {
  border-radius: 18px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.ic[data-open="0"] {
  background: #FFFFFF;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.03);
}

.ic[data-open="1"] {
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.08), 0 8px 20px rgba(0,0,0,0.05);
}

/* Toggle visibility */
.ic[data-open="0"] .ic-expanded { display: none; }
.ic[data-open="1"] .ic-collapsed { display: none; }

/* ═══════════════════════════════════════════
   COLLAPSED ROW
   ═══════════════════════════════════════════ */

.ic-collapsed {
  padding: 10px 14px 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ic-icon-tile {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ic-col-body {
  flex: 1;
  min-width: 0;
}

.ic-col-name {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #2A2A2A;
  line-height: 1.2;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sub-line: stars · cost */
.ic-sub {
  display: flex;
  align-items: center;
  gap: 5px;
}

.ic-sub-dot {
  font-size: 9px;
  color: #DDD;
}

/* Collapsed star row */
.ic-stars-row {
  display: inline-flex;
  align-items: center;
  gap: 1.5px;
  color: #D4A843;
}

.ic-star-svg { display: block; }
.ic-star-on { color: #D4A843; }
.ic-star-half { color: #D4A843; opacity: .5; }
.ic-star-off { color: #CCC; }

.ic-rating-val {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #888;
  margin-left: 3px;
}

.ic-cost-compact {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #5A9E5A;
}

/* Right column: time + duration */
.ic-col-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.ic-col-time {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #777;
  font-variant-numeric: tabular-nums;
}

.ic-col-dur {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  color: #CCC;
}

/* ═══════════════════════════════════════════
   EXPANDED CARD (gradient background)
   ═══════════════════════════════════════════ */

.ic-expanded {
  padding: 22px;
  position: relative;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  animation: icExpand 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes icExpand {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Decorative glow */
.ic-ex-glow {
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  filter: blur(40px);
  pointer-events: none;
}

/* Top bar: icon + label ... time pill */
.ic-ex-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.ic-ex-top-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ic-ex-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255,255,255,0.2);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ic-ex-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ic-ex-time-pill {
  background: rgba(255,255,255,0.18);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  padding: 6px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  font-variant-numeric: tabular-nums;
}

/* Name */
.ic-ex-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 24px;
  font-weight: 500;
  color: #FFF;
  margin: 8px 0 4px;
  line-height: 1.15;
}

/* Description subtitle (from editorial_summary) */
.ic-ex-desc {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  margin: 0 0 12px;
  line-height: 1.45;
}

/* Meta row: stars (reviews) | price | duration */
.ic-ex-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.ic-ex-sep {
  width: 1px;
  height: 13px;
  background: rgba(255,255,255,0.22);
  flex-shrink: 0;
}

/* Star group wrapper */
.ic-ex-star-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Expanded stars */
.ic-stars-light {
  color: rgba(255,255,255,0.9);
  display: inline-flex;
  align-items: center;
}

.ic-rating-val-light {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.95);
  margin-left: 4px;
}

/* Review count e.g. (12.3k) */
.ic-ex-review-count {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: rgba(255,255,255,0.5);
}

/* Price pill — "Free" or "$$" */
.ic-ex-price-pill {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 2px 9px;
  letter-spacing: 0.01em;
}

/* Duration */
.ic-ex-dur {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: rgba(255,255,255,0.55);
}

/* User-authored notes on gradient card */
.ic-ex-notes {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.55;
  padding: 2px 0 2px 12px;
  margin: 10px 0 16px;
  border-left: 2px solid rgba(255, 255, 255, 0.28);
  font-style: italic;
  letter-spacing: 0.005em;
}

/* Address */
.ic-ex-addr {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  margin-bottom: 6px;
  line-height: 1.4;
}

/* Opening hours */
.ic-ex-hours {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  margin-bottom: 6px;
  line-height: 1.4;
}

.ic-ex-hours--conflict {
  color: rgba(255,180,100,0.85);
}

.ic-ex-hours-warn {
  font-size: 10px;
  opacity: 0.9;
}

/* Collapsed conflict warning */
.ic-col-conflict {
  display: block;
  font-size: 12px;
  color: #D4834A;
  text-align: right;
  line-height: 1;
  margin-top: 2px;
}

/* Tip / reason card */
.ic-ex-tip {
  background: rgba(255,255,255,0.1);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-radius: 12px;
  padding: 10px 14px;
  margin-top: 4px;
  margin-bottom: 16px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.ic-ex-tip-icon {
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 1px;
}

.ic-ex-tip-text {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: rgba(255,255,255,0.75);
  margin: 0;
  line-height: 1.5;
  font-style: italic;
}

/* Action buttons */
.ic-ex-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 4px;
}

.ic-ex-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, background 0.15s ease;
  font-family: 'DM Sans', sans-serif;
}
.ic-ex-btn:active { transform: scale(0.97); }

/* Primary CTA — hugs content, pushes secondary icons to the right */
.ic-ex-btn--nav {
  padding: 11px 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.09);
  letter-spacing: -0.005em;
  white-space: nowrap;
  margin-right: auto;
}

/* Secondary icon buttons — quieter, no box */
.ic-ex-btn--icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  border: none;
  background: rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.8);
  flex-shrink: 0;
  text-decoration: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.ic-ex-btn--icon:active {
  background: rgba(255, 255, 255, 0.18);
}

/* Legacy — kept for the route-editor swap button */
.ic-ex-btn--swap {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  border: none;
  background: rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.8);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   ROUTE CONNECTOR
   ═══════════════════════════════════════════ */

.ic-conn {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 2px 0;
}

.ic-conn-line-wrap {
  width: 40px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ic-conn-svg {
  display: block;
}

.ic-conn-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #EEEEE8;
  border-radius: 12px;
  padding: 7px 14px;
  flex: 1;
}

.ic-conn-time {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #666;
  font-variant-numeric: tabular-nums;
}

.ic-conn-sep {
  width: 1px;
  height: 12px;
  background: #D5D3CC;
}

.ic-conn-dist {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #AAA;
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════
   SWAP OVERLAY
   ═══════════════════════════════════════════ */

.itin-swap-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.32);
  z-index: 9999;
  align-items: flex-end;
  justify-content: center;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.itin-swap-sheet {
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 18px 16px 28px;
  width: 100%;
  max-width: 390px;
  max-height: 65vh;
  display: flex;
  flex-direction: column;
  animation: icSheetUp .18s ease;
}

@keyframes icSheetUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.itin-swap-header {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: #B5B3AC;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
  margin-bottom: 2px;
}

.itin-swap-current {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  font-weight: 600;
  color: #1A1A1A;
  text-align: center;
  margin-bottom: 14px;
}

.itin-swap-input-wrap {
  position: relative;
  margin-bottom: 10px;
}
.itin-swap-input-wrap svg {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: #B5B3AC;
  opacity: .45;
}

.itin-swap-input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.06);
  background: #F4F3EE;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: #1A1A1A;
  outline: none;
  box-sizing: border-box;
}
.itin-swap-input:focus { border-color: rgba(74,140,138,.35); }
.itin-swap-input::placeholder { color: #B5B3AC; opacity: .55; }

.itin-swap-results {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.itin-swap-empty,
.itin-swap-loading {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: #B5B3AC;
  text-align: center;
  padding: 20px 0;
  opacity: .55;
}

.itin-swap-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 6px;
  cursor: pointer;
  border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
}
.itin-swap-result:active { background: rgba(0,0,0,.025); }

.itin-swap-result-icon {
  width: 32px; height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.itin-swap-result-info { flex: 1; min-width: 0; }

.itin-swap-result-name {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #1A1A1A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.itin-swap-result-meta {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  color: #B5B3AC;
  margin-top: 1px;
}

.itin-swap-cancel {
  display: block;
  width: 100%;
  padding: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #B5B3AC;
  background: none;
  border: none;
  cursor: pointer;
  margin-top: 4px;
}

/* ── Dark Mode ── */
[data-theme="dark"] .itin-swap-sheet{background:var(--card);}
