/* app.css
   Formula18 Golf — Mobile / Android
   Shared styles across all mobile pages */

:root {
  --green:       #1a5c2e;
  --green-light: rgba(26, 92, 46, 0.10);
  --green-mid:   rgba(26, 92, 46, 0.20);
  --gold:        #b8952a;
  /* Scoring green is LOCKED in every theme (Owen 10/9, iOS 264): birdie-or-better green is
     information, not decoration. --green is the brand tint and follows the theme. */
  --score-green:       #1a5c2e;
  --score-green-light: rgba(26, 92, 46, 0.10);
  --gray-bg:     #f5f5f5;
  --gray-border: #e5e5e5;
  --gray-text:   #888;
  --text:        #1a1a1a;
}

/* App themes (☰ → Theme). Fairway Green = the defaults above. */
:root[data-f18-theme="rock"]  { --green: #7E5A2E; --green-light: rgba(126, 90, 46, 0.10); --green-mid: rgba(126, 90, 46, 0.20); }
:root[data-f18-theme="water"] { --green: #1F5C8B; --green-light: rgba(31, 92, 139, 0.10); --green-mid: rgba(31, 92, 139, 0.20); }
:root[data-f18-theme="fire"]  { --green: #B4452A; --green-light: rgba(180, 69, 42, 0.10); --green-mid: rgba(180, 69, 42, 0.20); }

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #fff;
  color: var(--text);
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
}

/* ── Top bar ─────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-border);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 10;
}
.topbar-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--green-light);
  color: var(--green);
  border: none;
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
  margin-right: 10px;
  padding: 0;
  line-height: 1;
  text-decoration: none;
}
.topbar-back:active { background: var(--green-mid); }
.topbar-title {
  font-size: 17px;
  font-weight: 600;
  flex: 1;
}
.topbar-action {
  background: none;
  border: none;
  font-size: 14px;
  color: var(--green);
  cursor: pointer;
}

/* ── Page wrapper ────────────────────────────────── */
.page {
  padding: 0 0 80px;
}

/* ── Full-width primary button ───────────────────── */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 56px;
  background: var(--green);
  color: #fff;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-primary:disabled { background: #9ca3af; cursor: not-allowed; }
.btn-primary:active   { opacity: 0.85; }

/* ── Outline button ──────────────────────────────── */
.btn-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 56px;
  background: #fff;
  color: var(--green);
  border-radius: 12px;
  font-size: 18px;
  font-weight: 600;
  border: 2px solid var(--green);
  cursor: pointer;
}

/* ── Link button ─────────────────────────────────── */
.btn-link {
  background: none;
  border: none;
  color: var(--green);
  font-size: 15px;
  text-decoration: underline;
  cursor: pointer;
  padding: 8px 0;
  display: block;
  text-align: center;
}

/* ── Input group ─────────────────────────────────── */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.input-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-text);
}
.input-group input,
.input-group select {
  width: 100%;
  padding: 12px;
  background: var(--gray-bg);
  border: none;
  border-radius: 8px;
  font-size: 15px;
  color: var(--text);
  outline: none;
}
.input-group input:focus {
  box-shadow: 0 0 0 2px var(--green);
}
.input-group .hint {
  font-size: 11px;
  color: var(--gray-text);
}

/* ── Error message ───────────────────────────────── */
.error-msg {
  color: #dc2626;
  font-size: 14px;
  text-align: center;
  padding: 0 24px;
  display: none;
}
.error-msg.visible { display: block; }

/* ── Card ────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--gray-border);
  padding: 16px;
}

/* ── Event card ──────────────────────────────────── */
.event-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--gray-border);
  padding: 16px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.event-card:active { opacity: 0.85; }
.event-card-icon {
  width: 44px;
  height: 44px;
  background: var(--green-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.event-card-body { flex: 1; min-width: 0; }
.event-card-name { font-size: 15px; font-weight: 600; }
.event-card-date { font-size: 13px; color: var(--gray-text); margin-top: 2px; }
.event-card-badges { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
}
.badge-green  { background: var(--green-light); color: var(--green); }
.badge-gray   { background: var(--gray-bg); color: var(--gray-text); }
.badge-black  { background: #111; color: #fff; }
.badge-white  { background: #fff; color: #111; border: 1px solid var(--gray-border); }

/* ── State badge ─────────────────────────────────── */
.state-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
}

/* ── Stat card ───────────────────────────────────── */
.stat-card {
  flex: 1;
  background: var(--green-light);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}
.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--green);
}
.stat-card .stat-label {
  font-size: 13px;
  color: var(--gray-text);
}

/* ── Section header ──────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--green);
}
.section-link {
  font-size: 14px;
  color: var(--green);
  text-decoration: none;
}

/* ── Filter chips ────────────────────────────────── */
.filter-row {
  display: flex;
  gap: 8px;
  padding: 12px 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-chip {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.filter-chip.active   { background: var(--green); color: #fff; font-weight: 600; }
.filter-chip.inactive { background: var(--green-light); color: var(--green); }

/* ── Empty state ─────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 24px;
  color: var(--gray-text);
  text-align: center;
}
.empty-icon { font-size: 40px; }
.empty-title { font-size: 16px; }
.empty-sub   { font-size: 13px; }

/* ── Quick action grid ───────────────────────────── */
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 24px;
}
.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--gray-border);
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
}
.action-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.action-icon {
  width: 56px;
  height: 56px;
  background: var(--green-light);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}
.action-label { font-size: 13px; color: var(--gray-text); }

/* ── 3-button quick row ──────────────────────────── */
.quick-row {
  display: flex;
  gap: 12px;
  padding: 0 24px;
}
.quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  background: none;
  border: none;
  cursor: pointer;
}
.quick-icon {
  width: 52px;
  height: 52px;
  background: var(--green-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.quick-icon.disabled { background: var(--gray-bg); }
.quick-label { font-size: 12px; color: var(--gray-text); }

/* ── Loading spinner ─────────────────────────────── */
.spinner-wrap {
  display: flex;
  justify-content: center;
  padding: 40px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--green-light);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── Progress bar ────────────────────────────────── */
.progress-bar-track {
  background: var(--gray-bg);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
}
.progress-bar-fill {
  background: var(--green);
  border-radius: 4px;
  height: 8px;
  transition: width 0.3s;
}

/* ── Tab bar ─────────────────────────────────────── */
.tab-row {
  display: flex;
  gap: 8px;
  padding: 12px 24px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--gray-border);
}
.tab-btn {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.tab-btn.active   { background: var(--green); color: #fff; font-weight: 600; }
.tab-btn.inactive { background: var(--green-light); color: var(--green); }

/* ── Trial banner ────────────────────────────────── */
.trial-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--green-light);
  border-radius: 12px;
  margin: 0 24px;
}
.trial-banner-title { font-size: 14px; font-weight: 600; color: var(--green); }
.trial-banner-sub   { font-size: 12px; color: var(--gray-text); margin-top: 2px; }

/* ── Player row ──────────────────────────────────── */
.player-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--gray-border);
}
.player-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.player-info { flex: 1; }
.player-name { font-size: 15px; font-weight: 500; }
.player-hcp  { font-size: 13px; color: var(--gray-text); margin-top: 3px; }
