/* Results + search pieces for the Tee Time Advisor, on top of base.css. */

body.golf-page {
  --good: #2f7d3a;
  --bad: #b3261e;
  --warn: #a8610a;
  --chip: #f1eee3;
  --row-alt: #eef3ea;
  --plot-grid: rgba(27, 42, 31, 0.12);
  --flag: #d9412b;
}

/* ---------- Home hero ---------- */

.golf-hero { padding-top: 5vh; }

.golf-hero .flag-mark {
  display: inline-block;
  width: 46px;
  height: 46px;
  margin-bottom: 6px;
  filter: drop-shadow(0 2px 6px rgba(0, 40, 80, 0.35));
}

.golf-search {
  max-width: 680px;
  border-radius: 22px;
  flex-wrap: wrap;
}

.golf-search .opts {
  display: flex;
  gap: 6px;
  align-items: center;
  padding-right: 4px;
}

.golf-search select {
  border: 1px solid rgba(31, 51, 70, 0.18);
  background: #fff;
  color: #1f3346;
  border-radius: 999px;
  padding: 9px 10px;
  font: inherit;
  font-size: 0.88rem;
}

.quick-links {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 0.85rem;
}

.quick-links span { opacity: 0.9; text-shadow: 0 1px 4px rgba(0, 40, 80, 0.5); }

.quick-links a {
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  padding: 3px 12px;
  background: rgba(255, 255, 255, 0.14);
  text-shadow: 0 1px 4px rgba(0, 40, 80, 0.5);
}
.quick-links a:hover { background: rgba(255, 255, 255, 0.3); }

.course-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }

.course-link {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--chip);
  color: var(--ink);
  text-decoration: none;
  border: 1px solid transparent;
}
.course-link:hover { border-color: var(--accent); }
.course-link strong { font-size: 0.98rem; }
.course-link span { font-size: 0.8rem; color: var(--ink-muted); }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.step { display: flex; gap: 12px; align-items: flex-start; }
.step-num {
  flex: 0 0 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
}
.step strong { display: block; margin-bottom: 2px; }
.step p { margin: 0; font-size: 0.86rem; color: var(--ink-muted); line-height: 1.5; }

/* ---------- Course header ---------- */

.course-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.course-head h1 {
  font-family: 'Spectral', serif;
  font-weight: 600;
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  margin: 0;
  line-height: 1.15;
}

.course-meta { color: var(--ink-muted); font-size: 0.9rem; margin-top: 4px; }
.course-meta a { color: var(--accent); }

.seg { display: inline-flex; border-radius: 999px; background: var(--chip); padding: 3px; gap: 2px; }
.seg a {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--ink-muted);
  text-decoration: none;
  white-space: nowrap;
}
.seg a.on { background: var(--accent); color: #fff; }
.seg-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.seg-label { font-size: 0.75rem; color: var(--ink-muted); margin-right: 2px; }

.notice {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(242, 179, 92, 0.18);
  border-left: 3px solid var(--warn);
  font-size: 0.9rem;
}

.fee-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; font-size: 0.9rem; }
.fee-form input {
  width: 110px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(31, 51, 70, 0.2);
  font: inherit;
}
.fee-form button {
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* ---------- Pick cards ---------- */

.picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }

.pick {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--chip);
  border: 1px solid var(--card-line);
}

.pick.lead { border: 2px solid var(--accent); }

.pick-kind {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.pick-time { font-family: 'Spectral', serif; font-weight: 600; font-size: 1.35rem; line-height: 1.15; }

.pick-price { display: flex; align-items: baseline; gap: 8px; }
.pick-price strong { white-space: nowrap; font-size: 1.9rem; font-family: 'Spectral', serif; line-height: 1; }
.pick-price span { font-size: 0.8rem; color: var(--ink-muted); }
.pick-price strong small { font-size: 0.8rem; font-family: inherit; font-weight: 500; color: var(--ink-muted); margin-left: 2px; }
.pick-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.cal-link { font-size: 0.8rem; color: var(--ink-muted); }

.pick-wx { font-size: 0.86rem; color: var(--ink-muted); }

.pick-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  margin: 4px 0 2px;
  font-size: 0.8rem;
}
.pick-facts div { display: flex; flex-direction: column; }
.pick-facts span { color: var(--ink-muted); font-size: 0.72rem; }
.pick-facts strong { font-size: 0.95rem; }

.pick-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; padding-top: 6px; }

.book {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}
.book:hover { background: var(--accent-hover); }

.val { font-weight: 600; white-space: nowrap; }
.val.pos { color: var(--good); }
.val.neg { color: var(--bad); }

.tradeoff {
  margin: 16px 0 0;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--chip);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* Condition meter: 0-100 bar with a GO tick at 75 */
.meter { display: flex; align-items: center; gap: 8px; }
.meter-bar {
  position: relative;
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: rgba(127, 127, 127, 0.22);
  overflow: visible;
}
.meter-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--accent); }
.meter-bar::after {
  content: "";
  position: absolute;
  left: 75%;
  top: -3px;
  bottom: -3px;
  width: 2px;
  background: var(--ink-muted);
  opacity: 0.6;
}
.meter-num { font-weight: 600; font-size: 0.85rem; min-width: 26px; text-align: right; }

.rating {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.rating.GO { color: var(--good); }
.rating.MARGINAL { color: var(--warn); }
.rating.NO-GO { color: var(--bad); }

/* ---------- Tables ---------- */

.table-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }

table.golf-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.golf-table th {
  text-align: left;
  font-weight: 500;
  font-size: 0.74rem;
  color: var(--ink-muted);
  padding: 6px 8px;
  border-bottom: 1px solid var(--plot-grid);
  white-space: nowrap;
}
.golf-table td { padding: 8px; border-bottom: 1px solid var(--plot-grid); vertical-align: middle; }
.golf-table td.num, .golf-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.golf-table tr.gated td { opacity: 0.55; }
.golf-table tr.top td { background: var(--row-alt); }
.golf-table .meter { min-width: 110px; }
.golf-table a { color: var(--accent); }
.sub-note { font-size: 0.72rem; color: var(--ink-muted); }

details.day { border-top: 1px solid var(--plot-grid); }
details.day:first-of-type { border-top: none; }
details.day > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  font-weight: 600;
}
details.day > summary::-webkit-details-marker { display: none; }
details.day > summary::before { content: "▸"; margin-right: 8px; color: var(--ink-muted); transition: transform 0.15s; }
details.day[open] > summary::before { transform: rotate(90deg); }
details.day > summary .day-title { flex: 1; }
details.day > summary .sub-note { font-weight: 400; }

/* ---------- Chart ---------- */

.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-wrap .axis text { fill: var(--ink-muted); font-size: 11px; }
.chart-wrap .grid line { stroke: var(--plot-grid); }
.chart-wrap .go-line { stroke: var(--ink-muted); stroke-dasharray: 3 4; opacity: 0.7; }
.chart-wrap .even-line { stroke: var(--good); stroke-width: 2; stroke-dasharray: 6 5; fill: none; }
.chart-wrap .even-zone { fill: var(--good); opacity: 0.07; }
.chart-wrap .dot { fill: var(--accent); stroke: var(--card); stroke-width: 2; }
.chart-wrap .dot.gated { fill: none; stroke: var(--bad); stroke-width: 1.5; }
.chart-wrap .dot.pick { fill: var(--flag); stroke: #fff; stroke-width: 2.5; }
.chart-wrap .lbl { fill: var(--ink); font-size: 12px; font-weight: 600; }
.chart-wrap .lbl-muted { fill: var(--ink-muted); font-size: 11px; }
.chart-wrap .hit { fill: transparent; cursor: pointer; }

.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.78rem; color: var(--ink-muted); margin-top: 8px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.chart-legend i.a { background: var(--accent); }
.chart-legend i.p { background: var(--flag); }
.chart-legend i.g { border: 1.5px solid var(--bad); }
.chart-legend i.l { width: 18px; height: 0; border-top: 2px dashed var(--good); border-radius: 0; vertical-align: 3px; }

.tip {
  position: absolute;
  pointer-events: none;
  background: rgba(20, 32, 48, 0.94);
  color: #fff;
  font-size: 0.78rem;
  line-height: 1.45;
  padding: 8px 10px;
  border-radius: 8px;
  white-space: nowrap;
  transform: translate(-50%, calc(-100% - 12px));
  opacity: 0;
  transition: opacity 0.1s;
  z-index: 3;
}
.tip.show { opacity: 1; }

.method { font-size: 0.86rem; line-height: 1.6; color: var(--ink-muted); }
.method strong { color: var(--ink); }
.method ul { padding-left: 1.1rem; margin: 8px 0; }

@media (max-width: 560px) {
  .golf-search .opts { width: 100%; justify-content: center; padding: 0 0 4px; }
  .card { padding: 18px 16px; }
  .pick-time { font-size: 1.2rem; }
}

/* Fixes from screenshot review */
.golf-search.compact { flex-wrap: nowrap; max-width: 560px; }
details.day > summary { text-align: left; }
.golf-table td strong { white-space: nowrap; }
@media (max-width: 560px) {
  .golf-search.compact { flex-direction: row; border-radius: 999px; }
  .golf-search.compact button { width: auto; }
}

/* Where the tee times came from */
.source-badge {
  display: inline-block;
  margin-top: 10px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
}
.source-badge.direct { background: rgba(47, 125, 58, 0.12); color: #1f5d2c; }
.source-badge.fallback { background: rgba(168, 97, 10, 0.12); color: #7a4708; }
.source-badge a { color: inherit; }

details.checks { margin-top: 8px; font-size: 0.82rem; color: var(--ink-muted); }
details.checks summary { cursor: pointer; }
details.checks ul { margin: 6px 0 0; padding-left: 1.1rem; }

.golf-search select { background: #f6f4ec; }

/* Date picker (2026-09-29): pick a day up to 10 days out */
.golf-search input[type="date"],
.date-form input[type="date"] {
  border: 1px solid rgba(31, 51, 70, 0.18);
  background: #f6f4ec;
  color: #1f3346;
  border-radius: 999px;
  padding: 7px 10px;
  font: inherit;
  font-size: 0.88rem;
}
.golf-search .opts { flex-wrap: wrap; }
.date-form { display: inline-flex; align-items: center; gap: 4px; margin: 0; }
.date-form input[type="date"] { padding: 4px 10px; font-size: 0.82rem; background: var(--chip); border-color: transparent; }

.day-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 10px;
  margin-bottom: 6px;
  scrollbar-width: thin;
}
.day-strip a {
  flex: 0 0 auto;
  min-width: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 4px;
  border-radius: 12px;
  background: var(--chip);
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.72rem;
  line-height: 1.2;
  opacity: 0.6;
}
.day-strip a.has { opacity: 1; }
.day-strip a strong { font-size: 1.05rem; color: var(--ink); }
.day-strip a.on { background: var(--accent); color: #fff; opacity: 1; }
.day-strip a.on strong { color: #fff; }
.your-day .notice { margin-top: 4px; margin-bottom: 12px; }
.golf-search:not(.compact) { max-width: 780px; }
.golf-search:not(.compact) #q { flex: 1 1 220px; }
.golf-search .opts input[type="date"] { flex: 0 0 auto; }

/* ---------- Clickable tee times (2026-09-29): a click opens the booking page on that day ---------- */

.day-strip a { flex: 1 0 48px; }
.tee-link { color: inherit; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.tee-link:hover { color: var(--accent); }
tr.clickable, .pick.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--chip); }
.pick.clickable:hover { border-color: var(--accent); }
.day-picks { margin: 4px 0 10px; }
.click-hint { margin: 0 0 6px; }

.other-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.other-day {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--chip);
  border: 1px solid var(--card-line);
  color: var(--ink);
  text-decoration: none;
}
.other-day:hover { border-color: var(--accent); }
.od-day { font-size: 0.75rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.od-time { font-family: 'Spectral', serif; font-size: 1.3rem; line-height: 1.1; }
.od-price { font-weight: 600; }
.od-wx { font-size: 0.8rem; color: var(--ink-muted); }
.od-go { font-size: 0.8rem; color: var(--accent); font-weight: 600; margin-top: auto; }
