/* public/golf/style.css — Golf scorecard creator styles */

/* ------------------------------------------------------------------ */
/* Row helper                                                           */
/* ------------------------------------------------------------------ */

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-start;
}

/* ------------------------------------------------------------------ */
/* Course autocomplete                                                  */
/* ------------------------------------------------------------------ */

.course-autocomplete-wrap {
  position: relative;
}

.course-suggestions {
  position: absolute;
  z-index: 100;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--card, #fff);
  border: 1.5px solid var(--border, #E5E7EB);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  list-style: none;
  margin: 0;
  padding: 4px 0;
  max-height: 260px;
  overflow-y: auto;
}

.course-suggestion-item {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.course-suggestion-item:hover,
.course-suggestion-item[aria-selected="true"] {
  background: var(--bg-soft, #f1f5f9);
}

.course-suggestion-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg, #111);
}

.course-suggestion-meta {
  font-size: 0.78rem;
  color: var(--muted, #6B7280);
}

.course-search-status {
  font-size: 0.8rem;
  margin-top: 4px;
}

/* Holes mismatch warning */
.course-holes-warn {
  font-size: 0.82rem;
  color: #B45309;
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  border-radius: 8px;
  padding: 6px 10px;
  margin-top: 6px;
}

.course-holes-warn button {
  border: none;
  background: none;
  color: #B45309;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-size: inherit;
}

/* ------------------------------------------------------------------ */
/* Tee banner                                                           */
/* ------------------------------------------------------------------ */

.tee-banner.hidden { display: none; }

.tee-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: var(--bg-soft, #f8fafc);
  border: 1.5px solid var(--border, #E5E7EB);
  border-radius: 10px;
  font-size: 0.82rem;
  line-height: 1.4;
}

.tee-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1.5px solid rgba(0, 0, 0, 0.18);
  display: inline-block;
}

.tee-banner-name {
  font-weight: 700;
  color: var(--fg, #111);
}

.tee-banner-sep {
  color: var(--muted, #9CA3AF);
  flex-shrink: 0;
}

.tee-banner-stat {
  color: var(--muted, #6B7280);
  white-space: nowrap;
}

.tee-banner-stat strong {
  color: var(--fg, #111);
  font-weight: 700;
  margin-left: 2px;
}

/* ------------------------------------------------------------------ */
/* Scorecard table                                                      */
/* ------------------------------------------------------------------ */

.scorecard-wrap {
  margin-top: 4px;
}

.scorecard-section {
  margin-bottom: 12px;
}

.scorecard-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted, #6B7280);
  margin-bottom: 4px;
}

.scorecard-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  border: 1.5px solid var(--border, #D1D5DB);
  /* Prevent border-radius clipping on scrollable child */
  isolation: isolate;
}

.scorecard-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

/* Label (row-header) column */
.sc-label-cell {
  width: 44px;
  min-width: 44px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-align: left;
  padding: 0 6px;
  position: sticky;
  left: 0;
  z-index: 2;
  white-space: nowrap;
}

/* Total (OUT / IN / TOT) column */
.sc-total-cell {
  width: 46px;
  min-width: 46px;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  padding: 3px 4px;
  white-space: nowrap;
}

/* All body cells */
.scorecard-table td {
  text-align: center;
  padding: 0;
  border-left: 1px solid var(--border, #E5E7EB);
}

/* Row dividers */
.scorecard-table tbody tr + tr td,
.scorecard-table tbody tr + tr th {
  border-top: 1px solid var(--border, #E5E7EB);
}
.scorecard-table thead tr th,
.scorecard-table thead tr td {
  border-top: none;
}
.scorecard-table tbody tr:first-child td,
.scorecard-table tbody tr:first-child th {
  border-top: 1px solid rgba(255,255,255,0.15);
}

/* ---- HOLE header row ---- */
.sc-row-hole th,
.sc-row-hole td {
  background: #1B5E20;
  color: #fff;
  font-weight: 700;
  font-size: 0.76rem;
  padding: 6px 2px;
  border-left-color: rgba(255,255,255,0.12);
}

.sc-row-hole .sc-label-cell {
  background: #1B5E20;
  color: rgba(255,255,255,0.85);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
}

.sc-row-hole .sc-total-cell {
  background: #154a19;
  color: #a5d6a7;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}

/* ---- YDS row ---- */
.sc-row-yds th,
.sc-row-yds td {
  background: #f1f5f9;
}

.sc-row-yds .sc-label-cell {
  background: #e2e8f0;
  color: #64748b;
}

.sc-row-yds .sc-total-cell {
  background: #dde4ed;
  color: #374151;
}

/* ---- HCP row ---- */
.sc-row-hcp th,
.sc-row-hcp td {
  background: #fafafa;
}

.sc-row-hcp .sc-label-cell {
  background: #f3f4f6;
  color: #9CA3AF;
}

.sc-row-hcp .sc-total-cell {
  background: #f3f4f6;
  color: #9CA3AF;
  font-weight: 500;
  font-size: 0.75rem;
}

/* ---- PAR row ---- */
.sc-row-par th,
.sc-row-par td {
  background: #fff;
}

.sc-row-par .sc-label-cell {
  background: #f0fdf4;
  color: #16A34A;
}

.sc-row-par .sc-total-cell {
  background: #dcfce7;
  color: #15803D;
}

/* ---- Scorecard inputs ---- */
.sc-input {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--fg, #111);
  padding: 6px 2px;
  -moz-appearance: textfield;
  line-height: 1;
  cursor: text;
}

.sc-input::-webkit-inner-spin-button,
.sc-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.sc-input::placeholder {
  color: #CBD5E1;
  font-weight: 400;
}

.sc-input:focus {
  outline: none;
  background: rgba(22, 163, 74, 0.09);
  box-shadow: inset 0 0 0 1.5px #16A34A;
}

/* Yardage — slightly smaller, secondary feel */
.sc-yds-input {
  font-size: 0.76rem;
  color: #374151;
  font-weight: 500;
}
.sc-yds-input:focus { box-shadow: inset 0 0 0 1.5px #1565C0; background: rgba(21,101,192,0.06); }

/* HCP — muted, tertiary feel */
.sc-hcp-input {
  font-size: 0.74rem;
  color: #9CA3AF;
  font-weight: 500;
}
.sc-hcp-input:focus { box-shadow: inset 0 0 0 1.5px #9CA3AF; background: rgba(156,163,175,0.08); }

/* ---- Scorecard totals strip (18-hole) ---- */
.scorecard-totals {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 7px 10px;
  background: var(--bg-soft, #f8fafc);
  border: 1.5px solid var(--border, #E5E7EB);
  border-radius: 8px;
  font-size: 0.8rem;
  margin-top: 2px;
}

.scorecard-totals-item {
  color: var(--muted, #6B7280);
  white-space: nowrap;
}

.scorecard-totals-item strong {
  color: var(--fg, #111);
  font-weight: 700;
  margin-left: 2px;
}

/* ------------------------------------------------------------------ */
/* Player rows with handicap index                                      */
/* ------------------------------------------------------------------ */

.player-row {
  display: grid;
  grid-template-columns: 1fr 72px auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.player-hcp-input {
  width: 72px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.player-remove-btn {
  width: auto !important;
  padding-inline: 12px;
}

/* OG Mode Toggle (mirrors participant page) */
.gl-og-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  flex-wrap: wrap;
}
.gl-og-toggle-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted, #6B7280);
}
.gl-og-toggle-btn {
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border, #E5E7EB);
  background: var(--bg-card, #fff);
  color: var(--muted, #6B7280);
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.2;
}
.gl-og-toggle-btn:first-of-type {
  border-radius: 8px 0 0 8px;
}
.gl-og-toggle-btn:last-of-type {
  border-radius: 0 8px 8px 0;
  border-left: 0;
}
.gl-og-toggle-btn.active {
  background: #16A34A;
  color: #fff;
  border-color: #16A34A;
}
.gl-og-toggle-btn:not(.active):hover {
  background: var(--bg-muted, #F9FAFB);
}
