/* Janet Engine v2 — wishlist, price calendar, recommendations, character states, mobile */

/* ─── Toast notification ──────────────────────────────────────────────────── */
#janet-toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #0D2145; color: #fff; padding: 10px 22px; border-radius: 24px;
  font-size: .85rem; opacity: 0; pointer-events: none; z-index: 9999;
  transition: opacity .25s, transform .25s; white-space: nowrap;
}
#janet-toast.janet-toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── Janet character bubble ──────────────────────────────────────────────── */
.janet-char-wrap { position: relative; display: inline-block; }
.janet-char-img  { display: block; width: 100%; max-width: 340px; border-radius: 16px;
  object-fit: cover; transition: opacity .3s; }
.janet-bubble {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: #0D2145; color: #fff; padding: 10px 16px; border-radius: 16px;
  font-size: .85rem; line-height: 1.45; min-width: 220px; max-width: 300px;
  text-align: center; box-shadow: 0 4px 16px rgba(0,0,0,.35);
  transition: opacity .25s, transform .25s;
}
.janet-bubble::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 8px solid transparent; border-top-color: #0D2145;
}
.janet-bubble-in { animation: bubbPop .3s ease-out; }
@keyframes bubbPop { 0%{transform:translateX(-50%) scale(.9)} 60%{transform:translateX(-50%) scale(1.04)} 100%{transform:translateX(-50%) scale(1)} }
@media (prefers-reduced-motion: reduce) { .janet-bubble, .janet-char-img { transition: none; } .janet-bubble-in { animation: none; } }

/* ─── Character state badges ──────────────────────────────────────────────── */
[data-state="searching"] .janet-char-img  { opacity: .85; }
[data-state="price_drop"] .janet-bubble   { background: #0a3d20; border: 1px solid #22c55e; }
[data-state="stale_warning"] .janet-bubble,
[data-state="provider_offline"] .janet-bubble { background: #3d2000; border: 1px solid #f59e0b; }

/* ─── Search section upgrades ─────────────────────────────────────────────── */
#fs-error {
  color: #ef4444; font-size: .82rem; margin-top: 8px; padding: 8px 12px;
  background: rgba(239,68,68,.08); border-radius: 8px;
  border: 1px solid rgba(239,68,68,.3);
}
#fs-history-list {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-top: 10px; font-size: .8rem;
}
.fs-hist-label { color: var(--ink-soft, #7a8ba0); }
.fs-hist-btn {
  background: rgba(46,155,239,.12); border: 1px solid rgba(46,155,239,.3);
  color: var(--sky, #2E9BEF); border-radius: 20px; padding: 4px 12px;
  font-size: .78rem; cursor: pointer; transition: background .15s;
}
.fs-hist-btn:hover { background: rgba(46,155,239,.22); }
.fs-hist-clear { background: none; border: none; color: var(--ink-soft, #7a8ba0);
  font-size: .75rem; cursor: pointer; padding: 4px 8px; }
.fs-hist-clear:hover { color: #ef4444; }

/* ─── Flexible dates / Price calendar ────────────────────────────────────── */
.cal-section { padding: 48px 0; }
.cal-dest-row { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; flex-wrap: wrap; }
.cal-dest-select {
  background: var(--bg-card, #0e1f38); border: 1.5px solid rgba(46,155,239,.3);
  color: var(--ink, #e8f0f8); border-radius: 10px; padding: 10px 14px; font-size: .95rem;
}
.cal-header { margin-bottom: 20px; }
.cal-title  { font-size: 1.2rem; font-weight: 700; color: var(--ink, #e8f0f8); margin-bottom: 4px; }
.cal-subtitle { font-size: .78rem; color: var(--ink-soft, #7a8ba0); }
.cal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 12px; }
.cal-card {
  background: var(--bg-card, #0e1f38); border-radius: 14px;
  border: 1.5px solid rgba(255,255,255,.08); padding: 18px 16px;
  display: flex; flex-direction: column; gap: 8px; transition: border-color .2s;
}
.cal-card:hover { border-color: rgba(46,155,239,.4); }
.cal-card-best { border-color: #F4C77B !important; background: rgba(244,199,123,.06) !important; }
.cal-month  { font-size: .78rem; color: var(--ink-soft, #7a8ba0); text-transform: capitalize; }
.cal-best-badge { font-size: .72rem; color: #F4C77B; font-weight: 700; }
.cal-bar-wrap { background: rgba(255,255,255,.06); border-radius: 4px; height: 6px; overflow: hidden; }
.cal-bar {
  height: 6px; background: var(--sky, #2E9BEF); border-radius: 4px;
  transform-origin: right center; transform: scaleX(var(--bar-scale, 1));
  transition: transform .4s ease;
}
.cal-card-best .cal-bar { background: #F4C77B; }
.cal-price { font-size: 1.4rem; font-weight: 800; color: var(--ink, #e8f0f8); }
.cal-price-usd { font-size: .75rem; color: var(--ink-soft, #7a8ba0); margin-inline-start: 6px; }
.cal-meta  { font-size: .75rem; color: var(--ink-soft, #7a8ba0); }
.cal-stale { color: #f59e0b; }
.cal-date  { font-size: .75rem; color: var(--ink-soft, #7a8ba0); }
.cal-btn {
  display: block; text-align: center; padding: 9px; border-radius: 9px; margin-top: 4px;
  background: rgba(46,155,239,.15); color: var(--sky, #2E9BEF);
  border: 1.5px solid rgba(46,155,239,.3); font-size: .83rem; text-decoration: none;
  transition: background .15s;
}
.cal-btn:hover { background: rgba(46,155,239,.28); }
.cal-btn-best { background: #F4C77B !important; color: #0D2145 !important; border-color: #F4C77B !important; font-weight: 700; }
.cal-btn-best:hover { background: #f8d98e !important; }
.cal-disclaimer { font-size: .72rem; color: var(--ink-soft, #7a8ba0); text-align: center; }
.cal-empty { color: var(--ink-soft, #7a8ba0); font-size: .9rem; text-align: center; padding: 24px; }

/* ─── Wishlist ────────────────────────────────────────────────────────────── */
.wl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.wl-empty { color: var(--ink-soft, #7a8ba0); font-size: .9rem; text-align: center; padding: 32px; }
.wl-card {
  background: var(--bg-card, #0e1f38); border-radius: 14px;
  border: 1.5px solid rgba(255,255,255,.08); padding: 18px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.wl-card-hit { border-color: #22c55e !important; background: rgba(34,197,94,.05) !important; }
.wl-card-head { display: flex; align-items: center; gap: 8px; }
.wl-dest { font-size: 1rem; font-weight: 700; flex: 1; color: var(--ink, #e8f0f8); }
.wl-badge-hit { font-size: .72rem; color: #22c55e; font-weight: 700; }
.wl-remove {
  background: none; border: none; color: var(--ink-soft, #7a8ba0);
  font-size: .9rem; cursor: pointer; padding: 2px 6px; border-radius: 6px;
  transition: background .15s;
}
.wl-remove:hover { background: rgba(239,68,68,.15); color: #ef4444; }
.wl-prices { display: flex; flex-direction: column; gap: 4px; }
.wl-price-row { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--ink-soft, #7a8ba0); }
.wl-price-row strong { color: var(--ink, #e8f0f8); font-weight: 700; }
.wl-gap { font-size: .75rem; color: #f59e0b; }
.wl-provider { font-size: .72rem; color: var(--ink-soft, #7a8ba0); border-top: 1px solid rgba(255,255,255,.06); padding-top: 6px; }
.wl-note { font-size: .78rem; color: var(--ink-soft, #7a8ba0); font-style: italic; }
.wl-actions { display: flex; gap: 8px; }
.wl-search-btn {
  flex: 1; background: rgba(46,155,239,.15); color: var(--sky, #2E9BEF);
  border: 1.5px solid rgba(46,155,239,.3); border-radius: 9px; padding: 8px;
  font-size: .8rem; cursor: pointer; text-align: center; transition: background .15s;
}
.wl-search-btn:hover { background: rgba(46,155,239,.28); }
.wl-book-btn {
  background: rgba(244,199,123,.15); color: #F4C77B; border: 1.5px solid rgba(244,199,123,.3);
  border-radius: 9px; padding: 8px 12px; font-size: .8rem; text-decoration: none;
  transition: background .15s;
}
.wl-book-btn:hover { background: rgba(244,199,123,.28); }

/* Wishlist add form */
.wl-add-form {
  background: var(--bg-card, #0e1f38); border-radius: 14px; padding: 20px;
  border: 1.5px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 12px;
}
.wl-add-form h4 { font-size: .9rem; font-weight: 700; color: var(--ink, #e8f0f8); margin: 0; }
.wl-add-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.wl-add-field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 140px; }
.wl-add-field label { font-size: .75rem; font-weight: 700; color: var(--ink-soft, #7a8ba0); text-transform: uppercase; }
.wl-add-field select, .wl-add-field input {
  background: rgba(255,255,255,.05); border: 1.5px solid rgba(255,255,255,.12);
  color: var(--ink, #e8f0f8); border-radius: 9px; padding: 9px 12px; font-size: .9rem;
}
.wl-add-btn {
  background: var(--sky, #2E9BEF); color: #fff; border: none;
  border-radius: 9px; padding: 10px 20px; font-size: .88rem; font-weight: 700;
  cursor: pointer; align-self: flex-end; transition: background .15s;
}
.wl-add-btn:hover { background: #1d89d6; }

/* ─── Recommendations ─────────────────────────────────────────────────────── */
.rec-head { margin-bottom: 20px; }
.rec-title { font-size: 1.1rem; font-weight: 700; color: var(--ink, #e8f0f8); margin-bottom: 4px; }
.rec-sub   { font-size: .75rem; color: var(--ink-soft, #7a8ba0); }
.rec-grid  { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.rec-card {
  background: var(--bg-card, #0e1f38); border-radius: 12px;
  border: 1.5px solid rgba(255,255,255,.08); padding: 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.rec-dest  { font-size: .85rem; font-weight: 700; color: var(--ink, #e8f0f8); }
.rec-price { font-size: 1.3rem; font-weight: 800; color: var(--sky, #2E9BEF); }
.rec-reason{ font-size: .75rem; color: var(--ink-soft, #7a8ba0); }
.rec-btn   {
  margin-top: auto; background: rgba(46,155,239,.15); color: var(--sky, #2E9BEF);
  border: 1.5px solid rgba(46,155,239,.3); border-radius: 8px; padding: 8px;
  font-size: .78rem; cursor: pointer; transition: background .15s;
}
.rec-btn:hover { background: rgba(46,155,239,.28); }

/* ─── Sticky search bar ───────────────────────────────────────────────────── */
#sticky-search {
  position: fixed; top: 0; right: 0; left: 0; z-index: 900;
  background: rgba(7,18,35,.95); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(46,155,239,.2);
  padding: 10px 20px; display: flex; align-items: center; gap: 12px;
  transform: translateY(-100%); transition: transform .25s ease;
}
#sticky-search:not([hidden]) { transform: translateY(0); }
.sticky-dest { flex: 1; min-width: 0; font-size: .85rem; color: #fff;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px; padding: 8px 12px; }
.sticky-btn  {
  background: var(--sky, #2E9BEF); color: #fff; border: none;
  border-radius: 8px; padding: 9px 16px; font-size: .85rem; cursor: pointer;
  white-space: nowrap;
}
/* The sticky bar's own form controls carry no class, so they rendered at the
   browser default 21px — under the 44px touch target on a 390px viewport. */
.sticky-form { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.sticky-form select,
.sticky-form input[type="date"] {
  min-height: 44px; flex: 1; min-width: 0; font-size: .85rem; color: #fff;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px; padding: 8px 12px;
}
.sticky-form button {
  min-height: 44px; background: var(--sky, #2E9BEF); color: #fff; border: none;
  border-radius: 8px; padding: 9px 18px; font-size: .85rem; font-weight: 800;
  cursor: pointer; white-space: nowrap;
}
.sticky-form button:hover { background: var(--sky-deep, #1272C4); }

@media (prefers-reduced-motion: reduce) { #sticky-search { transition: none; } }

/* ─── Bottom navigation (mobile only) ────────────────────────────────────── */
#bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 890;
  background: rgba(7,18,35,.97); backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
}
@media (max-width: 640px) { #bottom-nav { display: flex; justify-content: space-around; } }
.bnav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 3px; padding: 6px 0; text-decoration: none;
  color: var(--ink-soft, #7a8ba0); font-size: .65rem; transition: color .15s;
}
.bnav-item.bnav-active, .bnav-item:hover { color: var(--sky, #2E9BEF); }
.bnav-icon { font-size: 1.2rem; line-height: 1; }

/* bottom nav offset for mobile content */
@media (max-width: 640px) {
  body { padding-bottom: 60px; }
  #janet-toast { bottom: 72px; }
}

/* ─── Skeleton loading ────────────────────────────────────────────────────── */
.skel {
  background: linear-gradient(90deg, rgba(255,255,255,.06) 25%, rgba(255,255,255,.1) 50%, rgba(255,255,255,.06) 75%);
  background-size: 200% 100%; border-radius: 8px; animation: skelShimmer 1.5s infinite;
}
@keyframes skelShimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; background: rgba(255,255,255,.06); } }

/* ─── Value score badge ───────────────────────────────────────────────────── */
.val-score { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; }
.val-score-bar { width: 50px; height: 4px; background: rgba(255,255,255,.12); border-radius: 2px; overflow: hidden; }
.val-score-fill { height: 4px; border-radius: 2px;
  background: linear-gradient(to right, #ef4444, #f59e0b, #22c55e); }

/* ─── Accessibility improvements ──────────────────────────────────────────── */
:focus-visible { outline: 2px solid #2E9BEF; outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Disabled affiliate CTA — used when a partner endpoint is verifiably unreachable
   (Hotellook, 2026-08-04). It must not read as a live button. */
.cmp-book-disabled,
.jce-btn-disabled,
.link-unavailable {
  opacity: .55; cursor: not-allowed; text-decoration: none; font-weight: 600;
  background: transparent !important; color: #7E90A3 !important;
  border: 1px dashed rgba(126,144,163,.5) !important; box-shadow: none !important;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 8px 16px; border-radius: 10px;
}
