/* ============================================================================
   Golf Tournament Platform — Custom Theme
   A forest-green palette with warm accents, inspired by course-side leaderboards.
   ============================================================================ */

:root {
  --golf-green-900: #1b4332;
  --golf-green-800: #1f4d38;
  --golf-green-700: #2d6a4f;
  --golf-green-600: #40916c;
  --golf-green-500: #52b788;
  --golf-green-400: #74c69d;
  --golf-green-300: #95d5b2;
  --golf-green-200: #b7e4c7;
  --golf-green-100: #d8f3dc;

  --golf-sand: #d4a373;
  --golf-sand-light: #e9d8b5;
  --golf-cream: #fefae0;
  --golf-bg: #f0f2f0;

  --birdie-red: #d92b2b;
  --bogey-blue: #2f6fed;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ── Base ────────────────────────────────────────────────────────────────── */

body {
  font-family: var(--font-sans);
  background-color: var(--golf-bg);
  color: #1a1a2e;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: 0;
}

main.container {
  flex: 1;
  padding-top: 0.5rem;
}

/* ── Navbar ──────────────────────────────────────────────────────────────── */

.navbar-golf {
  background: linear-gradient(135deg, var(--golf-green-900) 0%, var(--golf-green-800) 100%);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.navbar-golf .navbar-brand {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: #fff;
}

.navbar-golf .navbar-brand .brand-icon {
  font-size: 1.3rem;
  margin-right: 0.35rem;
}

.navbar-golf .nav-link {
  color: rgba(255, 255, 255, 0.8) !important;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.4rem 0.75rem !important;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.navbar-golf .nav-link:hover,
.navbar-golf .nav-link:focus {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.1);
}

.navbar-golf .dropdown-menu {
  border: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  margin-top: 0.4rem;
}

.navbar-golf .dropdown-item {
  font-size: 0.9rem;
  padding: 0.45rem 1rem;
}

.navbar-golf .dropdown-item:hover {
  background: var(--golf-green-100);
  color: var(--golf-green-900);
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

.footer-golf {
  background: var(--golf-green-900);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  padding: 1.2rem 0;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */

.card {
  border: none;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
}

.card-header {
  border-radius: 10px 10px 0 0 !important;
  background: var(--golf-green-100);
  border-bottom: 1px solid var(--golf-green-200);
  font-weight: 600;
  padding: 0.75rem 1.25rem;
}

.card-header h5 {
  font-weight: 600;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn-primary {
  background-color: var(--golf-green-700);
  border-color: var(--golf-green-700);
  font-weight: 600;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--golf-green-900);
  border-color: var(--golf-green-900);
}

.btn-outline-primary {
  color: var(--golf-green-700);
  border-color: var(--golf-green-700);
}

.btn-outline-primary:hover {
  background-color: var(--golf-green-700);
  border-color: var(--golf-green-700);
  color: #fff;
}

.btn-success {
  background-color: var(--golf-green-600);
  border-color: var(--golf-green-600);
}

.btn-success:hover {
  background-color: var(--golf-green-700);
  border-color: var(--golf-green-700);
}

.btn-golf {
  background-color: var(--golf-green-700);
  border-color: var(--golf-green-700);
  color: #fff;
  font-weight: 600;
}

.btn-golf:hover {
  background-color: var(--golf-green-900);
  border-color: var(--golf-green-900);
  color: #fff;
}

/* ── Stat Cards (Dashboard) ──────────────────────────────────────────────── */

.stat-card {
  border-radius: 12px;
  padding: 1.25rem;
}

.stat-card .stat-number {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: 0.85rem;
  opacity: 0.85;
  font-weight: 500;
}

.stat-card-green {
  background: linear-gradient(135deg, var(--golf-green-700), var(--golf-green-600));
  color: #fff;
}

.stat-card-sand {
  background: linear-gradient(135deg, #d4a373, #e6c7a0);
  color: #fff;
}

.stat-card-forest {
  background: linear-gradient(135deg, var(--golf-green-900), var(--golf-green-800));
  color: #fff;
}

/* ── Tables ──────────────────────────────────────────────────────────────── */

.table > thead {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.table > thead > tr > th {
  border-bottom-width: 2px;
  border-color: var(--golf-green-200);
  color: var(--golf-green-900);
  font-weight: 700;
}

.table-hover > tbody > tr:hover {
  background-color: rgba(45, 106, 79, 0.04);
}

/* ── Badges ──────────────────────────────────────────────────────────────── */

.badge-golf-draft {
  background-color: #e0e0e0;
  color: #555;
}

.badge-golf-open {
  background-color: var(--golf-green-500);
  color: #fff;
}

.badge-golf-progress {
  background-color: var(--golf-sand);
  color: #fff;
}

.badge-golf-completed {
  background-color: var(--golf-green-700);
  color: #fff;
}

.badge-golf-forest {
  background-color: var(--golf-green-900);
  color: #fff;
}

/* ── Flash Messages ──────────────────────────────────────────────────────── */

.alert {
  border-radius: 10px;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ── Breadcrumbs ─────────────────────────────────────────────────────────── */

.breadcrumb {
  font-size: 0.85rem;
}

.breadcrumb a {
  color: var(--golf-green-700);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* ── Setup Stepper (refreshed) ──────────────────────────────────────────── */

.setup-stepper {
  padding: 0.75rem 10px;
  margin-bottom: 2rem;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.setup-stepper .stepper-row {
  position: relative;
  z-index: 1;
}

.stepper-step {
  flex: 1;
  position: relative;
  z-index: 1;
  text-align: center;
}

.setup-stepper .stepper-line {
  position: absolute;
  top: 20px;
  left: 5%;
  right: 5%;
  height: 2px;
  background: var(--golf-green-200);
  z-index: 0;
}

.stepper-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--golf-green-300);
  color: var(--golf-green-700);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.15s;
}

a.stepper-dot:hover {
  border-color: var(--golf-green-600);
  color: var(--golf-green-900);
  transform: scale(1.05);
}

.stepper-dot.done {
  background: var(--golf-green-600);
  border-color: var(--golf-green-600);
  color: #fff;
}

.stepper-dot.current {
  border-color: var(--golf-green-900);
  box-shadow: 0 0 0 3px rgba(27, 67, 50, 0.2);
}

.stepper-dot.done.current {
  box-shadow: 0 0 0 3px rgba(27, 67, 50, 0.3);
}

span.stepper-dot.disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.stepper-label {
  margin-top: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* ============================================================================
   LEADERBOARD / STANDINGS
   ============================================================================ */

.leaderboard {
  font-size: 0.9rem;
}

.leaderboard th {
  border-bottom-width: 2px !important;
  border-color: var(--golf-green-300) !important;
  color: var(--golf-green-900);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  font-weight: 700;
  white-space: nowrap;
}

.leaderboard td {
  vertical-align: middle;
  padding: 0.6rem 0.5rem;
}

.leaderboard .rank-cell {
  font-weight: 700;
  width: 2.5rem;
  text-align: center;
  font-size: 0.85rem;
}

.leaderboard .leader-row {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.06), transparent);
}

.leaderboard .leader-row td:first-child {
  position: relative;
}

.leader-crown {
  font-size: 1.1rem;
  vertical-align: middle;
}

.leader-name {
  font-weight: 700;
  font-size: 1.05rem;
}

.leader-score {
  font-weight: 800;
  font-size: 1.15rem;
}

/* To-par coloring on leaderboard rows */
.to-par-negative {
  color: var(--birdie-red);
  font-weight: 700;
}

.to-par-positive {
  color: var(--bogey-blue);
  font-weight: 700;
}

.to-par-even {
  color: #555;
  font-weight: 600;
}

/* ── Scorecard Hole Grid ──────────────────────────────────────────────────── */

.hole-grid {
  --birdie-color: var(--birdie-red);
  --bogey-color: var(--bogey-blue);
}

.hole-grid td,
.hole-grid th {
  padding: 0.35rem 0.5rem;
  font-size: 0.82rem;
}

.hole-grid td.subtotal,
.hole-grid th.subtotal {
  background-color: rgba(27, 67, 50, 0.04);
  border-left-width: 2px;
  border-right-width: 2px;
  font-weight: 700;
}

.hole-grid .subtotal-header {
  background-color: rgba(27, 67, 50, 0.06);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.hole-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85em;
  height: 1.85em;
  line-height: 1;
  font-weight: 700;
  font-size: 0.82rem;
}

.hole-mark.under-par {
  border-radius: 50%;
  background-color: var(--birdie-red);
  color: #fff;
}

.hole-mark.over-par {
  border-radius: 3px;
  background-color: var(--bogey-blue);
  color: #fff;
}

.hole-grid .text-under-par {
  color: var(--birdie-red);
  font-weight: 700;
}

.hole-grid .text-over-par {
  color: var(--bogey-blue);
  font-weight: 700;
}

/* ── Course Context Banner ────────────────────────────────────────────────── */

.course-context {
  background: #fff;
  border: 1px solid var(--golf-green-200);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
}

.course-context .course-name {
  font-weight: 700;
  color: var(--golf-green-900);
}

.course-context .course-meta {
  color: #555;
}

/* ── Timestamp ───────────────────────────────────────────────────────────── */

.last-updated {
  font-size: 0.78rem;
  color: #888;
}

/* ── Live Scoring ─────────────────────────────────────────────────────────── */

.live-scoring-card {
  border: 2px solid var(--golf-green-300);
}

.live-scoring-card .card-header {
  background: var(--golf-green-700);
  color: #fff;
  font-weight: 700;
}

.live-scoring-input {
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
  padding: 0.5rem;
  border: 2px solid var(--golf-green-300);
  border-radius: 8px;
  width: 5rem;
}

.live-scoring-input:focus {
  border-color: var(--golf-green-600);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.15);
}

/* ── Animations ──────────────────────────────────────────────────────────── */

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(27, 67, 50, 0); }
  50% { box-shadow: 0 0 0 6px rgba(27, 67, 50, 0.25); }
}

.highlight-pulse {
  animation: pulse-glow 1s ease-in-out 2;
}

/* ── Misc Utilities ──────────────────────────────────────────────────────── */

.text-golf {
  color: var(--golf-green-700);
}

.bg-golf-subtle {
  background-color: var(--golf-green-100);
}

.list-group-item {
  border-color: var(--golf-green-200);
}

.list-group-item:first-child {
  border-radius: 10px 10px 0 0;
}

.list-group-item:last-child {
  border-radius: 0 0 10px 10px;
}

/* Small screen adjustments */
@media (max-width: 768px) {
  .stat-card .stat-number {
    font-size: 1.5rem;
  }
  .leaderboard {
    font-size: 0.82rem;
  }
  .hole-grid td,
  .hole-grid th {
    padding: 0.2rem 0.3rem;
    font-size: 0.72rem;
  }
}