
/* ============================================================
   RhythmBets Fantasy Dashboard — Main Stylesheet
   Design: Forest green header, warm off-white bg, DM fonts
   ============================================================ */


/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }


:root {
  --green-dark:   #1a472a;
  --green-mid:    #2d6a42;
  --green-light:  #4a8c5c;
  --gold:         #c9a84c;
  --gold-light:   #e8c97a;
  --bg:           #f5f2ed;
  --bg-card:      #ffffff;
  --bg-hover:     #f0ece4;
  --text:         #2c2c2c;
  --text-muted:   #6b6b6b;
  --text-light:   #9a9a9a;
  --border:       #e0dbd0;
  --shadow:       0 2px 8px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
  --radius:       8px;
  --radius-sm:    4px;


  /* Rank colors */
  --rank-great:   #1a5c1a;
  --rank-good:    #4a7a1a;
  --rank-mid:     #8a6a00;
  --rank-poor:    #8a2000;


  /* Trend colors */
  --trend-up:     #1a5c1a;
  --trend-down:   #8a2000;
  --trend-stable: #555555;
}


html { font-size: 16px; }


body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}


a { color: inherit; text-decoration: none; }


/* ── Typography ── */
.page-title {
  font-family: 'DM Serif Display', serif;
  font-size: 2rem;
  color: var(--green-dark);
  margin-bottom: 0.25rem;
}


.page-subtitle {
  font-family: 'DM Mono', monospace;
  font-size: 0.875rem;
  color: var(--text-muted);
}


.section-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.25rem;
  color: var(--green-dark);
  margin-bottom: 1rem;
}


.section-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-family: 'DM Mono', monospace;
}


/* ── Header ── */
.site-header {
  background: var(--green-dark);
  color: white;
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}


.header-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
}


.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}


.logo-rb {
  background: var(--gold);
  color: var(--green-dark);
  font-family: 'DM Serif Display', serif;
  font-size: 1rem;
  font-weight: bold;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  line-height: 1.2;
}


.logo-text {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  letter-spacing: 0.02em;
}


.sport-nav {
  display: flex;
  gap: 0.5rem;
  flex: 1;
}


.sport-pill {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.7);
  transition: all 0.15s;
  cursor: pointer;
}


.sport-pill:hover:not(.disabled) {
  color: white;
  background: rgba(255,255,255,0.15);
}


.sport-pill.active {
  background: var(--gold);
  color: var(--green-dark);
}


.sport-pill.disabled {
  opacity: 0.35;
  cursor: not-allowed;
}


.header-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-left: auto;
}


.update-time {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.55);
}


.logout-link {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.65);
  transition: color 0.15s;
}


.logout-link:hover { color: white; }


/* ── Section nav (sport tabs) ── */
.section-nav {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
}


.section-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 0;
}


.section-tab {
  padding: 0.875rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
}


.section-tab:hover {
  color: var(--green-dark);
  border-bottom-color: var(--green-light);
}


.section-tab.active {
  color: var(--green-dark);
  border-bottom-color: var(--green-dark);
  font-weight: 600;
}


/* ── Main content ── */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}


.page-header {
  margin-bottom: 2rem;
}


/* ── Cards and sections ── */
.card-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}


.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}


@media (max-width: 768px) {
  .two-col { grid-template-columns: 1fr; }
}


/* ── Login page ── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--green-dark);
}


.login-container {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  text-align: center;
}


.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}


.login-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.5rem;
  color: var(--green-dark);
  margin-bottom: 1.5rem;
}


.login-error {
  background: #fee;
  color: #c00;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}


.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}


.login-input {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: 'DM Mono', monospace;
  outline: none;
  transition: border-color 0.15s;
}


.login-input:focus {
  border-color: var(--green-mid);
}


.login-btn {
  padding: 0.75rem;
  background: var(--green-dark);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}


.login-btn:hover { background: var(--green-mid); }


/* ── Home sport cards ── */
.sport-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}


.sport-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: relative;
}


.sport-card.active-sport {
  border-color: var(--green-mid);
  cursor: pointer;
}


.sport-card.active-sport:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}


.sport-card.coming-soon {
  opacity: 0.5;
}


.sport-card-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--green-mid);
  text-transform: uppercase;
}


.sport-card-name {
  font-family: 'DM Serif Display', serif;
  font-size: 1.1rem;
  color: var(--text);
}


.sport-card-status {
  font-family: 'DM Mono', monospace;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--green-dark);
}


.sport-card-meta {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-light);
}


.sport-card-arrow {
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.25rem;
  color: var(--gold);
}


/* ── Alerts ── */
.alerts-section { margin-bottom: 2rem; }


.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}


.alert-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--green-mid);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
  transition: all 0.15s;
  cursor: pointer;
}


.alert-card:hover {
  box-shadow: var(--shadow-hover);
  border-left-color: var(--gold);
}


.alert-card.alert-trade { border-left-color: var(--gold); }


.alert-icon { font-size: 1.25rem; flex-shrink: 0; }


.alert-body { flex: 1; }


.alert-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}


.alert-detail {
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}


.alert-arrow { color: var(--text-light); font-size: 1rem; }


.no-alerts {
  font-family: 'DM Mono', monospace;
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 1rem 0;
}


/* ── Category grid (overview) ── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}


@media (max-width: 768px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
}


.cat-card {
  border-radius: var(--radius);
  padding: 0.875rem;
  text-align: center;
  border: 1px solid var(--border);
  position: relative;
}


.cat-card.rank-great { background: #e8f5e8; border-color: #a8d8a8; }
.cat-card.rank-good  { background: #f0f5e8; border-color: #c0d8a0; }
.cat-card.rank-mid   { background: #f5f0e0; border-color: #d8c880; }
.cat-card.rank-poor  { background: #f5e8e8; border-color: #d8a8a8; }


.cat-name {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}


.cat-rank {
  font-family: 'DM Serif Display', serif;
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--text);
}


.cat-value {
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}


.cat-gap {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  margin-top: 0.3rem;
}


.leading { color: var(--rank-great); font-weight: 600; }
.gap-up  { color: var(--rank-poor); }


/* ── Tables ── */
.standings-table,
.data-table,
.needs-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
}


.standings-table th,
.data-table th,
.needs-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--border);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}


.standings-table td,
.data-table td,
.needs-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}


.standings-table tr:last-child td,
.data-table tr:last-child td,
.needs-table tr:last-child td {
  border-bottom: none;
}


.standings-table tr:hover td,
.data-table tr:hover td {
  background: var(--bg-hover);
}


.my-team-row td {
  background: #e8f0e8 !important;
  font-weight: 600;
}


.injured-row td { background: #fff0f0 !important; }


.rank-col  { width: 40px; text-align: center; color: var(--text-muted); }
.pts-col   { width: 70px; text-align: right; font-weight: 600; }
.stat-col  { text-align: right; }
.name-col  { font-family: 'DM Sans', sans-serif; font-weight: 500; }
.pos-col   { color: var(--text-muted); font-size: 0.75rem; }
.team-col  { font-family: 'DM Sans', sans-serif; font-size: 0.8rem; }
.detail-col { font-size: 0.75rem; color: var(--text-muted); }


/* Trend cells */
.traj-cell { text-align: center; }
.trend-up    { color: var(--trend-up); font-weight: 700; }
.trend-down  { color: var(--trend-down); font-weight: 700; }
.trend-stable { color: var(--trend-stable); }


.leverage-col {
  font-size: 0.75rem;
  color: var(--text-muted);
  max-width: 140px;
}


/* ── Health badges ── */
.health-badge {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
  line-height: 22px;
  font-family: 'DM Sans', sans-serif;
}


.health-badge-sm {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #888;
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  text-align: center;
  line-height: 18px;
  font-family: 'DM Sans', sans-serif;
}


/* ── Status ── */
.status-col { font-size: 0.75rem; }
.status-col.injured { color: var(--rank-poor); font-weight: 600; }


/* ── Roster toggle ── */
.roster-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}


.toggle-btn {
  padding: 0.4rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}


.toggle-btn.active {
  background: var(--green-dark);
  color: white;
  border-color: var(--green-dark);
}


/* ── Recommendation cards ── */
.recommendations-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}


.rec-card {
  display: flex;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
  align-items: flex-start;
}


.rec-card.mutual-card {
  border-color: var(--gold);
  background: #fffdf0;
}


.rec-rank {
  font-family: 'DM Mono', monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-light);
  min-width: 28px;
  text-align: center;
  padding-top: 2px;
}


.rec-body { flex: 1; }


.rec-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}


.rec-add {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}


.rec-pos {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
}


.rec-gain {
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--rank-great);
  margin-left: auto;
}


.rec-rank-change {
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
}


.rec-drop {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}


.rec-stats {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}


.rec-improves {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--trend-up);
}


.rec-costs {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--trend-down);
}


.rec-arrow { color: var(--text-muted); font-size: 1.1rem; }
.rec-team  { font-size: 0.8rem; color: var(--text-muted); }


.mutual-badge {
  background: var(--gold-light);
  color: var(--green-dark);
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}


/* ── Trade needs table ── */
.needs-grid { overflow-x: auto; }
.needs-table { min-width: 700px; }


/* ── Leverage cards ── */
.leverage-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}


.leverage-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.875rem;
}


.leverage-team {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--green-dark);
  margin-bottom: 0.4rem;
}


.leverage-sell,
.leverage-buy,
.leverage-desperate {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  margin-top: 0.2rem;
  color: var(--text-muted);
}


.leverage-desperate { color: var(--rank-poor); }


/* ── Loading / errors ── */
.loading-spinner {
  text-align: center;
  padding: 2rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-light);
}


.error {
  text-align: center;
  padding: 1rem;
  color: var(--rank-poor);
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
}


.no-data {
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.5rem 0;
}


/* ── Trends table ── */
.trends-table { min-width: 600px; }



