/* BetsightAI — Complete Stylesheet */

:root {
  --navy-950: #060c18;
  --navy-900: #0b1120;
  --navy-800: #111827;
  --navy-700: #1e2942;
  --navy-600: #253351;
  --electric-500: #3b82f6;
  --electric-600: #2563eb;
  --electric-400: #60a5fa;
  --emerald: #10b981;
  --amber: #f59e0b;
  --rose: #f43f5e;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #1e3a5f;
  --card-bg: #111827;
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  background: var(--navy-900);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── NAVBAR ─────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  background: var(--navy-950);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 100;
}

.navbar-brand { display: flex; align-items: center; }
.brand-main   { color: white; font-size: 1.4rem; font-weight: 700; }
.brand-ai     { color: var(--electric-500); font-size: 1.4rem; font-weight: 700; }

.navbar-center {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: var(--navy-700);
}

.navbar-right  { display: flex; align-items: center; gap: 1rem; }

.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--electric-600);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 0.9rem;
  flex-shrink: 0;
}
.user-name   { color: var(--text-secondary); font-size: 0.9rem; }
.btn-logout  {
  color: var(--text-muted); text-decoration: none;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  transition: color 0.2s, border-color 0.2s;
}
.btn-logout:hover { color: var(--rose); border-color: var(--rose); }

/* Live dot in nav */
.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--rose);
  animation: pulse 1.4s ease-in-out infinite;
  display: inline-block;
}

/* ── MAIN CONTENT ────────────────────────────────────────── */
.main-content {
  padding: 80px 2rem 3rem;
  max-width: 1000px;
  margin: 0 auto;
}

/* ── AUTH PAGES ──────────────────────────────────────────── */
body.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  min-height: 100vh;
}

.auth-card {
  background: var(--navy-800);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}
.auth-logo          { text-align: center; margin-bottom: 0.5rem; }
.auth-logo h1       { font-size: 2.5rem; line-height: 1; }
.auth-tagline       { color: var(--text-muted); font-size: 0.9rem; text-align: center; margin-bottom: 0; }
.auth-divider       { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
.error-msg {
  background: rgba(244,63,94,0.1);
  border: 1px solid rgba(244,63,94,0.3);
  color: #fb7185;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

/* ── FORMS ───────────────────────────────────────────────── */
.form-group         { margin-bottom: 1.2rem; }
.form-group label   {
  display: block;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  font-weight: 500;
}
.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--navy-700);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:focus {
  border-color: var(--electric-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.form-select { appearance: none; cursor: pointer; }

.input-wrapper      { position: relative; }
.toggle-password {
  position: absolute;
  right: 0.75rem; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.2rem 0.4rem;
  transition: color 0.2s;
}
.toggle-password:hover { color: var(--electric-400); }

.btn-primary {
  width: 100%;
  padding: 0.85rem;
  background: var(--electric-500);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}
.btn-primary:hover { background: var(--electric-600); }

.auth-link {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 1.5rem;
}
.auth-link a {
  color: var(--electric-400);
  text-decoration: none;
}
.auth-link a:hover { text-decoration: underline; }

/* ── FLASH MESSAGES ──────────────────────────────────────── */
.flash {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}
.flash-success {
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.3);
  color: #6ee7b7;
}
.flash-error {
  background: rgba(244,63,94,0.1);
  border: 1px solid rgba(244,63,94,0.3);
  color: #fda4af;
}

/* ── PAGE HEADER ─────────────────────────────────────────── */
.page-header        { margin-bottom: 2rem; }
.page-header h2     { font-size: 1.75rem; font-weight: 700; color: var(--text-primary); }
.page-header p      { color: var(--text-muted); margin-top: 0.2rem; }
.stats-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
  align-items: center;
}
.stat-pill {
  background: var(--navy-800);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 1rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.btn-refresh {
  background: transparent;
  border: 1px solid var(--electric-500);
  color: var(--electric-400);
  padding: 0.3rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s;
  font-family: inherit;
}
.btn-refresh:hover { background: rgba(59,130,246,0.1); }

/* ── LEAGUE SECTIONS ─────────────────────────────────────── */
.league-section     { margin-bottom: 1rem; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.league-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--navy-800);
  padding: 1rem 1.5rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  user-select: none;
}
.league-header:hover { background: var(--navy-700); }
.league-section.open .league-header { border-bottom: 1px solid var(--border); }
.league-info        { display: flex; align-items: center; gap: 1rem; }
.league-name        { font-weight: 600; font-size: 1rem; color: var(--text-primary); }
.match-count {
  background: var(--navy-700);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}
.chevron            { color: var(--text-muted); transition: transform 0.25s; font-size: 0.8rem; }
.league-section.open .chevron { transform: rotate(180deg); }
.league-matches     { display: none; }
.league-section.open .league-matches { display: block; }

/* ── MATCH CARDS ─────────────────────────────────────────── */
.match-card {
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--navy-900);
  transition: background 0.15s;
}
.match-card:last-child { border-bottom: none; }
.match-card:hover      { background: rgba(30,41,66,0.6); }

.match-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.5rem;
}
.team-home  { text-align: right; font-weight: 500; color: var(--text-primary); font-size: 0.95rem; }
.team-away  { text-align: left;  font-weight: 500; color: var(--text-primary); font-size: 0.95rem; }
.match-center {
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
}
.match-time    { font-size: 0.85rem; color: var(--text-muted); }
.status-badge  {
  font-size: 0.7rem; font-weight: 700; padding: 0.15rem 0.5rem;
  border-radius: 999px; text-transform: uppercase;
}
.status-1h, .status-2h, .status-live {
  background: rgba(244,63,94,0.15);
  color: #fb7185;
  border: 1px solid rgba(244,63,94,0.3);
}

.match-odds     { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.odd {
  background: var(--navy-700);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.match-actions  { text-align: right; }
.btn-analyse {
  display: inline-block;
  background: transparent;
  border: 1px solid rgba(59,130,246,0.4);
  color: var(--electric-400);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.83rem;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s;
}
.btn-analyse:hover {
  background: rgba(59,130,246,0.1);
  border-color: var(--electric-500);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}
.empty-state a   { color: var(--electric-400); }
.empty-icon      { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3  { font-size: 1.2rem; color: var(--text-secondary); margin-bottom: 0.5rem; }

/* ── MATCH DETAIL PAGE ───────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--electric-400);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  transition: color 0.2s;
}
.back-link:hover { color: white; }

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.card-title {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.25rem;
  font-weight: 600;
}

/* Match header */
.match-header-teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.team-name-lg { font-size: 1.4rem; font-weight: 700; color: var(--text-primary); text-align: center; }
.vs-text      { font-size: 1rem; color: var(--electric-500); font-weight: 700; flex-shrink: 0; }
.match-meta {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.match-meta span { color: var(--text-muted); font-size: 0.88rem; }
.odds-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}
.odd-lg {
  background: var(--navy-700);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.35rem 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Prediction bars */
.prediction-bars {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
}
.pred-col    { text-align: center; }
.pred-label  { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.pred-pct    { font-size: 1.6rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.5rem; }
.pred-bar-bg {
  height: 6px;
  background: var(--navy-700);
  border-radius: 999px;
  overflow: hidden;
}
.pred-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 1s ease-out;
  width: 0%;
}
.fill-blue    { background: var(--electric-500); }
.fill-gray    { background: #475569; }
.fill-rose    { background: var(--rose); }
.fill-emerald { background: var(--emerald); }
.fill-amber   { background: var(--amber); }

/* Top bet */
.top-bet-card {
  background: rgba(59,130,246,0.05);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.top-bet-name  { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.75rem; }
.bet-meta      { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.reasoning-text { color: var(--text-muted); font-size: 0.88rem; line-height: 1.6; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.badge-low        { background: rgba(16,185,129,0.15); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.3); }
.badge-medium     { background: rgba(245,158,11,0.15); color: #fcd34d; border: 1px solid rgba(245,158,11,0.3); }
.badge-high       { background: rgba(244,63,94,0.15);  color: #fda4af; border: 1px solid rgba(244,63,94,0.3); }
.badge-confidence { background: rgba(59,130,246,0.15); color: var(--electric-400); border: 1px solid rgba(59,130,246,0.3); }

/* Markets grid */
.markets-grid    { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.market-card {
  background: var(--navy-700);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  transition: border-color 0.2s;
}
.market-card.featured {
  border-color: rgba(59,130,246,0.5);
  background: rgba(59,130,246,0.05);
}
.market-bet-name   { font-weight: 600; color: var(--text-primary); margin-bottom: 0.4rem; font-size: 0.9rem; }
.market-confidence { font-size: 0.82rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

/* H2H */
.h2h-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.h2h-stat {
  background: var(--navy-700);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
}
.h2h-stat-value { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }
.h2h-stat-label { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.2rem; }

/* Data table */
.data-table          { width: 100%; border-collapse: collapse; }
.data-table th {
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.data-table td {
  padding: 0.5rem 0.75rem;
  font-size: 0.88rem;
  border-bottom: 1px solid rgba(30,58,95,0.4);
  color: var(--text-secondary);
}
.data-table tr:last-child td { border-bottom: none; }
.text-win  { color: var(--emerald); font-weight: 600; }
.text-loss { color: var(--rose); }
.text-draw { color: var(--text-muted); }

/* Form guide */
.form-pills  { display: flex; gap: 0.4rem; margin-bottom: 1rem; }
.form-pill {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700;
}
.pill-w { background: rgba(16,185,129,0.2); color: #6ee7b7; }
.pill-d { background: rgba(100,116,139,0.2); color: #94a3b8; }
.pill-l { background: rgba(244,63,94,0.2);   color: #fda4af; }

/* Form stats */
.form-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.form-stat {
  background: var(--navy-700);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  text-align: center;
}
.form-stat-val { font-size: 1.2rem; font-weight: 700; color: var(--text-primary); }
.form-stat-lbl { font-size: 0.68rem; color: var(--text-muted); }

/* Match detail grid */
.match-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

/* ── ADMIN PAGE ──────────────────────────────────────────── */
.admin-card    { max-width: 640px; }
.settings-form { max-width: 500px; }

/* ── LIVE PAGE ───────────────────────────────────────────── */
.live-pulse {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--rose);
  margin-right: 0.5rem;
  animation: pulse 1.4s ease-in-out infinite;
  vertical-align: middle;
}
.live-dot-sm {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--rose);
  animation: pulse 1.4s ease-in-out infinite;
  vertical-align: middle;
  margin-right: 3px;
}
.live-status-pill { background: rgba(244,63,94,0.1); border-color: rgba(244,63,94,0.3); color: #fda4af; }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(1.2); }
}

.live-match-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  transition: border-color 0.2s;
}
.live-match-card:hover { border-color: rgba(59,130,246,0.3); }

.live-match-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}
.live-league        { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.live-period-badge  {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
}
.badge-live { background: rgba(244,63,94,0.15); color: #fda4af; border: 1px solid rgba(244,63,94,0.3); }
.badge-ht   { background: rgba(245,158,11,0.15); color: #fcd34d; border: 1px solid rgba(245,158,11,0.3); }
.badge-ft   { background: rgba(100,116,139,0.15); color: #94a3b8; border: 1px solid rgba(100,116,139,0.3); }

.live-score-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.live-team         { display: flex; flex-direction: column; }
.live-team-away    { text-align: right; align-items: flex-end; }
.live-team-name    { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }

.live-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--navy-700);
  border-radius: var(--radius);
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--border);
  min-width: 90px;
}
.score-num { font-size: 2rem; font-weight: 800; color: var(--text-primary); line-height: 1; }
.score-sep { font-size: 1.5rem; color: var(--text-muted); }

.live-odds-row     { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }

.live-prediction   {
  background: var(--navy-700);
  border-radius: var(--radius-sm);
  padding: 1rem;
  border: 1px solid var(--border);
}
.live-pred-title   { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.75rem; font-weight: 600; }
.live-pred-bars    { display: flex; flex-direction: column; gap: 0.6rem; }
.live-pred-row     { display: flex; align-items: center; gap: 0.5rem; }
.live-pred-label   { font-size: 0.8rem; color: var(--text-secondary); width: 120px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-pred-pct     { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); width: 40px; text-align: right; flex-shrink: 0; }
.time-comment      { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.75rem; font-style: italic; }

/* ── FOOTER ──────────────────────────────────────────────── */
.app-footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.83rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

.btn-secondary {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover {
  border-color: var(--electric-500);
  color: var(--electric-400);
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .main-content        { padding: 72px 1rem 2rem; }
  .navbar              { padding: 0 1rem; }
  .navbar-center       { display: none; }
  .user-name           { display: none; }

  .match-teams {
    grid-template-columns: 1fr;
    gap: 0.3rem;
    text-align: left;
  }
  .team-home, .team-away { text-align: left; }
  .match-center          { flex-direction: row; justify-content: flex-start; gap: 0.5rem; }

  .prediction-bars   { grid-template-columns: 1fr; }
  .match-detail-grid { grid-template-columns: 1fr; }
  .h2h-summary       { grid-template-columns: repeat(2, 1fr); }
  .markets-grid      { grid-template-columns: 1fr; }
  .form-stats        { grid-template-columns: repeat(2, 1fr); }
  .stats-row         { gap: 0.5rem; }

  .team-name-lg { font-size: 1.1rem; }
  .live-pred-label { width: 90px; }
  .live-score-row { gap: 0.5rem; }
}
