/* =============================================
   FOOTYIQLAB — STYLESHEET
   ============================================= */

/* --- TOKENS --- */
:root {
  --bg-base:     #07090f;
  --bg-surface:  #0d1018;
  --bg-raised:   #131720;
  --bg-hover:    #181d29;

  --border:      rgba(255,255,255,0.06);
  --border-md:   rgba(255,255,255,0.10);
  --border-strong: rgba(255,255,255,0.16);

  --green:       #22c55e;
  --green-dim:   rgba(34,197,94,0.12);
  --green-glow:  rgba(34,197,94,0.25);
  --red:         #ef4444;
  --red-dim:     rgba(239,68,68,0.12);
  --amber:       #f59e0b;
  --amber-dim:   rgba(245,158,11,0.12);
  --blue:        #60a5fa;
  --blue-dim:    rgba(96,165,250,0.10);

  --text-1:  #f1f3f7;
  --text-2:  #8b93a6;
  --text-3:  #4a5266;

  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;

  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  24px;

  --shadow-card: 0 1px 3px rgba(0,0,0,0.4), 0 0 0 1px var(--border);
}

/* --- RESET --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg-base);
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* --- NOISE TEXTURE --- */
.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 160px 160px;
}

/* --- PAGE WRAP --- */
.page-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* --- CONTAINER --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* =============================================
   HEADER
   ============================================= */
.header {
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7,9,15,0.85);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  height: 44px;
  width: auto;
  display: block;
  border-radius: var(--radius-sm);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -0.3px;
}

.brand-name em {
  font-style: normal;
  color: var(--green);
}

.brand-tagline {
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  font-weight: 500;
}

/* Date nav */
.date-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-md);
  background: var(--bg-raised);
  color: var(--text-2);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}

.nav-btn:hover:not(:disabled) {
  background: var(--green-dim);
  border-color: var(--green-glow);
  color: var(--green);
  transform: translateY(-1px);
}

.nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.date-pill {
  padding: 8px 22px;
  border-radius: var(--radius-md);
  background: var(--bg-raised);
  border: 1px solid var(--border-md);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  min-width: 172px;
  text-align: center;
  letter-spacing: 0.3px;
}

/* =============================================
   MAIN
   ============================================= */
.main {
  flex: 1;
  padding: 36px 0 48px;
}

/* =============================================
   STATS GRID
   ============================================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
  animation: fadeUp 0.4s ease both;
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--border-md);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  transition: background 0.2s;
}

.stat-card:hover { border-color: var(--border-md); }

.stat-card--win::before   { background: var(--green); }
.stat-card--loss::before  { background: var(--red); }
.stat-card--pending::before { background: var(--amber); }
.stat-card--rate::before  { background: var(--blue); }

.stat-icon {
  font-size: 20px;
  color: var(--text-3);
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-raised);
  border-radius: var(--radius-sm);
}

.stat-card--win   .stat-icon { color: var(--green); background: var(--green-dim); }
.stat-card--loss  .stat-icon { color: var(--red);   background: var(--red-dim); }
.stat-card--pending .stat-icon { color: var(--amber); background: var(--amber-dim); }
.stat-card--rate  .stat-icon { color: var(--blue);  background: var(--blue-dim); }

.stat-label {
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
  margin-bottom: 4px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  color: var(--text-1);
}

/* Win rate bar */
.stat-card--rate {
  flex-direction: column;
  align-items: flex-start;
}

.stat-card--rate > * { width: 100%; }

.stat-card--rate > .stat-icon {
  width: 36px;
  margin-bottom: 0;
}

.stat-card--rate {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
}

.rate-bar-wrap {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border);
}

.rate-bar {
  height: 100%;
  background: var(--blue);
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
  border-radius: 0 2px 2px 0;
}

/* =============================================
   TABLE SECTION
   ============================================= */
.table-section {
  animation: fadeUp 0.4s ease 0.15s both;
}

.table-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.table-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-1);
}

.table-badge {
  background: var(--bg-raised);
  border: 1px solid var(--border-md);
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}

.table-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

/* State messages */
.state-msg {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 56px 24px;
  color: var(--text-3);
  font-size: 15px;
}

.state-msg i { font-size: 20px; }

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
}

thead tr {
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
}

th {
  padding: 13px 20px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
}

td {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr {
  transition: background 0.1s;
  animation: rowIn 0.3s ease both;
}

tbody tr:hover { background: var(--bg-hover); }

/* Row stagger */
tbody tr:nth-child(1)  { animation-delay: 0.03s; }
tbody tr:nth-child(2)  { animation-delay: 0.06s; }
tbody tr:nth-child(3)  { animation-delay: 0.09s; }
tbody tr:nth-child(4)  { animation-delay: 0.12s; }
tbody tr:nth-child(5)  { animation-delay: 0.15s; }
tbody tr:nth-child(6)  { animation-delay: 0.18s; }
tbody tr:nth-child(7)  { animation-delay: 0.21s; }
tbody tr:nth-child(8)  { animation-delay: 0.24s; }
tbody tr:nth-child(9)  { animation-delay: 0.27s; }
tbody tr:nth-child(10) { animation-delay: 0.30s; }

.td-league { color: var(--text-2); font-size: 13px; }
.td-match  { font-weight: 500; color: var(--text-1); }
.td-odds   { font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.badge-pred {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(34,197,94,0.2);
}

.badge-won {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(34,197,94,0.2);
}

.badge-lost {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.2);
}

.badge-pending {
  background: var(--amber-dim);
  color: var(--amber);
  border: 1px solid rgba(245,158,11,0.2);
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes rowIn {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 700px) {
  .container { padding: 0 16px; }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .date-nav { align-self: stretch; justify-content: center; }

  .date-pill { flex: 1; min-width: unset; }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  th, td { padding: 12px 14px; }

  .td-match { font-size: 13px; }

  .table-wrap { border-radius: var(--radius-lg); overflow-x: auto; }

  table { min-width: 520px; }
}

/* =============================================
   VOID & TOTAL ODDS additions
   ============================================= */

/* Void stat card */
--purple:     #a78bfa;
--purple-dim: rgba(167,139,250,0.12);

.stat-card--void::before  { background: #a78bfa; }
.stat-card--void .stat-icon { color: #a78bfa; background: rgba(167,139,250,0.12); }

/* Make stats grid fit 6 cards nicely */
.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}

/* Void badge */
.badge-void {
  background: rgba(167,139,250,0.12);
  color: #a78bfa;
  border: 1px solid rgba(167,139,250,0.25);
}

/* Odds cell */
.td-odds {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text-1);
  font-size: 13px;
}
.td-odds.muted { color: var(--text-3); font-weight: 400; }

/* Total odds footer row */
tfoot { border-top: 1px solid var(--border-strong); }

.total-odds-row td {
  padding: 14px 20px;
  background: var(--bg-raised);
  border-bottom: none;
}

.total-odds-label {
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.total-odds-label i {
  color: var(--blue);
  font-size: 12px;
}

.total-odds-note {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 400;
}

.total-odds-value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}
