/* views.css — shared styling for the alternative TeeHunter experiences
   (quick / map / list). Reuses the colour tokens + .slot/.src-badge/.rating
   styles from styles.css (linked alongside this file). Mobile-first. */

/* ---- prototype switcher bar (top of every page) -------------------------- */
.exp-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 6px 14px; background: var(--ink-green); color: #cfe6d6;
  font-size: 12px; position: relative; z-index: 3000;
}
.exp-bar-label { display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; }
.exp-bar-label b { color: #fff; font-style: italic; }
.exp-bar-label em { color: #8fb89c; font-style: normal; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; }
.exp-switch { display: flex; gap: 2px; background: rgba(255,255,255,.1); padding: 3px; border-radius: 999px; flex: none; }
.exp-switch a {
  text-decoration: none; color: #cfe6d6; font-size: 12px; font-weight: 600;
  padding: 4px 12px; border-radius: 999px; line-height: 1.2;
}
.exp-switch a.active { background: var(--green-bright); color: #08230f; }
@media (max-width: 520px) {
  .exp-bar-label em { display: none; }
  .exp-switch a { padding: 4px 10px; }
}

/* ---- view header --------------------------------------------------------- */
.vh { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--line); }
.vh-brand { display: flex; align-items: center; gap: 9px; }
.vh-brand svg { width: 34px; height: 34px; flex: none; }
.vh-brand b { font-size: 18px; font-weight: 800; font-style: italic; letter-spacing: -.4px; }
.vh-brand b .tee { color: var(--green-bright); }
.vh-brand b .hunter { color: var(--ink-green); }
.vh-meta { font-size: 11px; color: var(--muted); text-align: right; }

/* Map: logo + filter pills share one top row */
.map-topbar { display: flex; align-items: center; gap: 10px; padding: 7px 12px; background: #fff; border-bottom: 1px solid var(--line); }
.map-topbar .vh-brand { flex: none; }
.map-topbar .vh-brand b { white-space: nowrap; }
.map-topbar .map-chipbar { flex: 1 1 auto; min-width: 0; padding: 0; border: none; background: none; flex-wrap: wrap; overflow: visible; }
/* Progressive logo: collapse to just the pin mark on phones so the mark + all
   pills sit on one line. The pills wrap to a second line only on the smallest
   screens where they genuinely don't fit. Full wordmark on larger screens. */
@media (max-width: 560px) {
  .map-topbar .vh-brand b { display: none; }
  .map-topbar { align-items: flex-start; } /* mark aligns with the first pill row when pills wrap */
  .map-topbar .vh-brand { padding-top: 1px; }
}
/* When JS detects the pills can't fit one line, force a balanced 2-up layout:
   the break drops Price + More onto a second line (2 pills per line). */
.pill-break { display: none; }
.map-chipbar.twocol .pill-break { display: block; flex-basis: 100%; width: 100%; height: 0; }
.sheet-note { font-size: 12px; color: var(--muted); text-align: center; margin: 6px 0 14px; }

/* ---- generic layout container -------------------------------------------- */
.wrap { max-width: 680px; margin: 0 auto; padding: 14px 14px 60px; }

/* ---- chip rows / segmented controls (big touch targets) ------------------ */
.chiprow { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  appearance: none; border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 9px 15px; border-radius: 999px; font-size: 14px; cursor: pointer; font-weight: 500;
}
.chip.active { background: var(--green); color: #fff; border-color: var(--green); }
.chip.sub { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.15; gap: 1px; padding: 7px 14px; }
.chip.sub small { font-size: 9px; opacity: .7; font-weight: 400; }
.chip.active.sub small { opacity: .85; }

.seg2 { display: flex; gap: 6px; }
.seg2 button {
  flex: 1; min-width: 44px; padding: 11px 0; border: 1px solid var(--line); background: #fff;
  border-radius: 10px; cursor: pointer; font-size: 15px; font-weight: 600; color: var(--ink);
}
.seg2 button.active { background: var(--green); color: #fff; border-color: var(--green); }

/* ---- the planner card (Quick) -------------------------------------------- */
.planner { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 15px; margin-bottom: 14px; }
.plan-row { margin-bottom: 13px; }
.plan-row:last-of-type { margin-bottom: 0; }
.plan-q { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-bottom: 8px; }
.plan-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.ghost-btn { background: var(--green-soft); color: var(--green-dark); border: none; border-radius: 9px; padding: 9px 13px; font-size: 13px; font-weight: 600; cursor: pointer; }
.ghost-btn:hover { background: #d6ebdd; }
.fcount { background: var(--green); color: #fff; border-radius: 999px; font-size: 10px; padding: 1px 6px; margin-left: 2px; }
.fcount:empty { display: none; }
.sortmini { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.sortmini select { font-size: 13px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); cursor: pointer; }

.vcount { font-size: 13px; font-weight: 600; color: var(--ink); margin: 4px 2px 12px; }
.vcount span { color: var(--muted); font-weight: 400; }

/* ---- Quick: course feed card --------------------------------------------- */
.qfeed { display: flex; flex-direction: column; gap: 12px; }
.qcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 13px 14px; }
.qcard-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.qcard h3 { margin: 0; font-size: 16px; line-height: 1.25; }
.qcard .q-rating { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; color: #b07700; background: #fff7e8; border: 1px solid #f0dcae; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.qcard .q-where { font-size: 12px; color: var(--muted); margin: 4px 0 0; }
.qcard .q-price { text-align: right; flex: none; }
.qcard .q-price b { font-size: 16px; color: var(--green-dark); }
.qcard .q-price small { display: block; font-size: 10px; color: var(--muted); }
.q-times { display: flex; gap: 7px; overflow-x: auto; padding: 11px 0 3px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.q-times::-webkit-scrollbar { height: 5px; }
.q-times::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.q-more { font-size: 12px; color: var(--green-dark); margin-top: 7px; cursor: pointer; font-weight: 600; display: inline-block; }
.q-daynote { font-size: 11px; color: var(--muted); margin-top: 8px; }

/* a slot pill sized for touch + horizontal scroll (extends styles.css .slot) */
.q-times .slot, .ttlist .slot { padding: 8px 11px; flex: none; }
.q-times .slot .t { font-size: 15px; }

/* ---- List: flat ranked tee-time rows ------------------------------------- */
.ttlist { display: flex; flex-direction: column; gap: 8px; }
.ttrow {
  display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 11px 13px;
}
.ttrow:hover { border-color: var(--green); box-shadow: 0 0 0 2px var(--green-soft); }
.tt-time { flex: none; text-align: center; min-width: 58px; }
.tt-time b { font-size: 19px; font-weight: 800; letter-spacing: -.5px; }
.tt-time small { display: block; font-size: 10px; color: var(--muted); margin-top: 1px; }
.tt-main { flex: 1 1 auto; min-width: 0; }
.tt-main h4 { margin: 0; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-sub { font-size: 11px; color: var(--muted); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.tt-sub .r { color: #b07700; font-weight: 700; }
.tt-right { flex: none; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.tt-right .p { font-size: 15px; font-weight: 800; color: var(--green-dark); }
.tt-right .p.na { color: var(--muted); font-weight: 600; font-size: 12px; }
.tt-right .go { font-size: 11px; color: var(--muted); }
.tt-spots { font-size: 10px; font-weight: 600; color: var(--muted); background: #eef1f0; padding: 1px 6px; border-radius: 4px; }
.tag9 { font-size: 9px; background: var(--green-soft); color: var(--green-dark); padding: 1px 4px; border-radius: 4px; font-weight: 700; }
/* "Par 3" short-course indicator — a distinct slate pill so it reads as a
   course-type label, not availability (green) or rating (amber). */
.par3-tag { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; color: #fff; background: #5b6b7b; padding: 1px 6px; border-radius: 5px; vertical-align: middle; white-space: nowrap; }
.d-name .par3-tag { font-size: 11px; vertical-align: 3px; }
.tt-daysep { font-size: 12px; font-weight: 800; color: var(--ink); margin: 14px 2px 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.tt-daysep:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.show-more { width: 100%; padding: 12px; margin-top: 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--green-dark); cursor: pointer; }
.show-more:hover { background: var(--green-soft); }

/* ---- filter bottom sheet (Quick / List / Map share this) ----------------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(8,20,12,.4); z-index: 4000; display: flex; align-items: flex-end; }
.sheet-backdrop.center { align-items: center; justify-content: center; }
.sheet-panel {
  background: #fff; width: 100%; max-width: 680px; margin: 0 auto;
  border-radius: 18px 18px 0 0; padding: 8px 18px 22px; max-height: 86vh; overflow-y: auto;
  box-shadow: 0 -8px 30px rgba(0,0,0,.18); animation: sheetUp .22s ease;
}
.sheet-backdrop.center .sheet-panel { border-radius: 16px; max-height: 86vh; animation: none; }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-grip { width: 40px; height: 4px; background: var(--line); border-radius: 2px; margin: 4px auto 12px; }
.sheet-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-h h3 { margin: 0; font-size: 17px; }
.sheet-x { border: none; background: #eef1f0; width: 30px; height: 30px; border-radius: 50%; font-size: 17px; cursor: pointer; color: var(--ink); }
.sheet-sec { margin-bottom: 18px; }
.sheet-sec > label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-bottom: 9px; }
.sheet-foot { display: flex; gap: 10px; position: sticky; bottom: 0; background: #fff; padding-top: 12px; }
.sheet-foot button { flex: 1; padding: 13px; border-radius: 10px; font-size: 15px; font-weight: 700; cursor: pointer; }
.sheet-apply { background: var(--green); color: #fff; border: none; }
.sheet-apply:hover { background: var(--green-dark); }
.sheet-reset { background: #fff; color: var(--muted); border: 1px solid var(--line); }

.vempty { text-align: center; color: var(--muted); padding: 50px 20px; }
.vempty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 6px; }

/* ---- Map experience ------------------------------------------------------ */
html.mapview, html.mapview body { height: 100%; margin: 0; overflow: hidden; }
.mapview body { display: flex; flex-direction: column; }
.map-shell { flex: 1; display: flex; flex-direction: column; position: relative; min-height: 0; }
.map-chipbar { display: flex; gap: 7px; padding: 10px 12px; background: #fff; border-bottom: 1px solid var(--line); overflow-x: auto; -webkit-overflow-scrolling: touch; z-index: 600; }
.map-chipbar::-webkit-scrollbar { display: none; }
.map-chipbar > * { flex: none; } /* don't shrink children — let the bar scroll horizontally */
.map-chipbar #when { display: flex; gap: 7px; }
.map-chipbar .chip { flex: none; padding: 7px 11px; font-size: 13px; white-space: nowrap; }
.map-chipbar .pill-more { padding: 7px 10px; font-size: 15px; line-height: 1; }
.map-chipbar .pill.active { background: var(--green); color: #fff; border-color: var(--green); }
.map-chipbar .pill .caret { opacity: .65; font-size: 10px; margin-left: 1px; }

/* per-pill picker option lists */
.opt-list { display: flex; flex-direction: column; gap: 8px; }
.opt-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.opt { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 12px 14px; font-size: 15px; font-weight: 500; color: var(--ink); cursor: pointer; }
.opt:hover { border-color: var(--green); }
.opt.sel { background: var(--green); color: #fff; border-color: var(--green); }
.opt.sub { display: flex; flex-direction: column; gap: 2px; }
.opt.sub small { font-size: 11px; opacity: .7; font-weight: 400; }
.opt-sub { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 16px 0 9px; }
.daymode { margin-bottom: 14px; }
.opt.anyday { width: 100%; margin-bottom: 10px; }

/* slider pickers (time range + max price) */
.picker-val { font-size: 19px; font-weight: 800; color: var(--ink); text-align: center; margin: 2px 0 14px; }
.range-dual { margin: 0 4px 4px; }
.solo-range { width: 100%; accent-color: var(--green); margin: 4px 0 0; }
#vmap { flex: 1; min-height: 0; z-index: 0; isolation: isolate; }

/* draggable results sheet over the map */
.mapsheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 900;
  background: #fff; border-radius: 18px 18px 0 0; box-shadow: 0 -6px 26px rgba(0,0,0,.18);
  display: flex; flex-direction: column;
  height: 42%; transition: height .25s ease; max-height: 88%;
}
.mapsheet.peek { height: 120px; }
.mapsheet.full { height: 90%; }
.mapsheet-handle { padding: 8px 0 6px; cursor: grab; flex: none; touch-action: none; }
.mapsheet-handle .sheet-grip { margin: 0 auto 8px; }
#sheetBody { flex: 1; overflow-y: auto; padding: 0 14px 22px; }
.ms-head { position: sticky; top: 0; background: #fff; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 2px 10px; z-index: 2; }
.ms-head b { font-size: 15px; }
.ms-rows { display: flex; flex-direction: column; }
.msrow { display: flex; gap: 11px; align-items: center; padding: 11px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.msrow:last-child { border-bottom: none; }
.msrow.sel { background: var(--green-soft); border-radius: 10px; padding: 11px 8px; }
.msrow .ms-main { flex: 1; min-width: 0; }
.msrow .ms-main h4 { margin: 0; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msrow .ms-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.msrow .ms-sub .r { color: #b07700; font-weight: 700; }
.msrow .ms-sub .ms-dist { color: var(--green-dark); font-weight: 700; white-space: nowrap; }
.msrow .ms-price { flex: none; text-align: right; }
.msrow .ms-price b { font-size: 15px; color: var(--green-dark); white-space: nowrap; }
.msrow .ms-price small { display: block; font-size: 10px; color: var(--muted); }
.msrow .ms-go { flex: none; color: var(--muted); font-size: 20px; }

/* course detail panel (inside the sheet) */
.d-back { background: none; border: none; color: var(--green-dark); font-size: 14px; font-weight: 700; cursor: pointer; padding: 4px 0 8px; }
.d-name { margin: 0; font-size: 19px; line-height: 1.22; }
.d-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.d-rating { color: #b07700; font-weight: 700; }
.d-rating small { color: var(--muted); font-weight: 400; }
.d-dist { color: var(--green-dark); font-weight: 600; }
.d-addr { font-size: 12px; color: var(--muted); margin-top: 6px; }
.d-acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 13px 0 2px; }
.d-act { text-decoration: none; background: var(--green-soft); color: var(--green-dark); border-radius: 9px; padding: 9px 13px; font-size: 13px; font-weight: 600; }
.d-act:hover { background: #d6ebdd; }
.d-tip { font-size: 12px; color: var(--warn); margin: 13px 0 0; }
.d-times { margin-top: 6px; }
.d-day { font-size: 13px; font-weight: 800; color: var(--ink); margin: 16px 0 9px; display: flex; align-items: baseline; gap: 9px; padding-top: 12px; border-top: 1px solid var(--line); }
.d-day:first-of-type { border-top: none; padding-top: 4px; }
.d-day span { font-size: 12px; font-weight: 400; color: var(--muted); }

/* user marker + map controls */
.user-dot { width: 16px; height: 16px; background: #1a73e8; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 4px rgba(26,115,232,.3); transform: translate(-50%, -50%); }
.map-ctrl-btn { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: none; border-radius: 8px; background: #fff; box-shadow: 0 1px 5px rgba(0,0,0,.3); cursor: pointer; color: var(--ink); }
.map-ctrl-btn:hover { background: var(--green-soft); color: var(--green-dark); }
.map-ctrl-btn.busy { opacity: .45; }
/* "Near me" floats bottom-right, just above the sheet; positionLocate() sets
   `bottom` to track the sheet. The % is only a pre-JS fallback. */
.locate-fab { position: absolute; right: 12px; bottom: 46%; z-index: 950; transition: bottom .25s ease, opacity .2s ease; }
/* Zoom buttons are redundant on touch (pinch-to-zoom); keep them on desktop. */
@media (max-width: 560px) { .leaflet-control-zoom { display: none; } }
.map-toast { position: absolute; left: 50%; bottom: 140px; transform: translateX(-50%); background: rgba(8,20,12,.92); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 13px; z-index: 1500; opacity: 0; pointer-events: none; transition: opacity .2s; white-space: nowrap; max-width: 90%; }
.map-toast.show { opacity: 1; }
.map-pin {
  background: var(--green); color: #fff; font-size: 12px; font-weight: 800; line-height: 1;
  padding: 5px 8px; border-radius: 999px; border: 2px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.35);
  white-space: nowrap; transform: translate(-50%, -50%);
}
.map-pin.off { background: #8b95a5; }
.map-pin .pin-flag { width: 9px; height: 11px; margin-right: 3px; vertical-align: -1px; }
.map-pin.sel { background: var(--warn); transform: translate(-50%, -50%) scale(1.12); z-index: 1000; }
