/* ═══════════════════════════════════════════════════════════════
   Melbet Ethiopia — Base Styles
   Dark theme: black + yellow Melbet branding
   ═══════════════════════════════════════════════════════════════ */

/* --- CSS Variables --- */
:root {
  --color-dark: #0D0E12;
  --color-bg: #14161C;
  --color-surface: #1E2029;
  --color-primary: #FFD100;
  --color-accent: #FFC400;
  --color-odds: #14161C;
  --color-live: #27C93F;
  --color-text: #F2F3F5;
  --color-muted: #9AA0AC;
  --color-border: #2A2D38;
  --color-danger: #E53935;
  --color-surface-light: #2E3140;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,.5);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.6);

  --header-h: 48px;
  --nav-h: 44px;
  --bottom-bar-h: 56px;
  --sidebar-w: 240px;
  --right-sidebar-w: 280px;

  --transition: .2s ease;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--color-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-accent); }
img, svg, video { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.25; color: var(--color-text); }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; border: none; background: none; }
table { border-collapse: collapse; width: 100%; }

/* --- Typography --- */
h1 { font-size: clamp(1.5rem, 3vw, 2.25rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); margin-bottom: .75rem; color: var(--color-primary); }
h3 { font-size: clamp(1.05rem, 2vw, 1.35rem); margin-bottom: .5rem; color: var(--color-text); }
h4 { font-size: 1.1rem; margin-bottom: .5rem; color: var(--color-text); }
p { margin-bottom: 1rem; }
strong, b { font-weight: 700; }
em, i { font-style: italic; }

/* --- Container --- */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* --- Table Responsive (MANDATORY) --- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1.5rem;
  border-radius: var(--radius-md);
}
.table-responsive table {
  width: 100%;
  min-width: 540px;
}
.table-responsive table th,
.table-responsive table td {
  padding: .65rem .75rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  font-size: .9rem;
  white-space: nowrap;
}
.table-responsive table th {
  background: var(--color-surface);
  color: var(--color-primary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: .78rem;
  letter-spacing: .04em;
}
.table-responsive table tr:hover td {
  background: rgba(255,209,0,.04);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .6rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  transition: all var(--transition);
  min-height: 44px;
  white-space: nowrap;
}
.btn-primary {
  background: var(--color-primary);
  color: var(--color-dark);
}
.btn-primary:hover {
  background: var(--color-accent);
  color: var(--color-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255,209,0,.3);
}
.btn-outline {
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
  background: transparent;
}
.btn-outline:hover {
  background: var(--color-primary);
  color: var(--color-dark);
}
.btn-ghost {
  color: var(--color-text);
  background: var(--color-surface);
}
.btn-ghost:hover {
  background: var(--color-surface-light);
}
.btn-sm { padding: .4rem .9rem; font-size: .8rem; min-height: 36px; }
.btn-lg { padding: .8rem 2rem; font-size: 1rem; min-height: 52px; }
.btn-block { width: 100%; }

/* --- Badge / Tag --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .55rem;
  border-radius: var(--radius-sm);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge-live {
  background: var(--color-live);
  color: #fff;
}
.badge-yellow {
  background: var(--color-primary);
  color: var(--color-dark);
}
.badge-outline {
  border: 1px solid var(--color-muted);
  color: var(--color-muted);
}

/* --- Cards --- */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: box-shadow var(--transition);
}
.card:hover {
  box-shadow: var(--shadow-md);
}

/* --- Odds Chip --- */
.odds-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: .35rem .5rem;
  background: var(--color-surface-light);
  color: var(--color-text);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: .85rem;
  cursor: pointer;
  transition: background var(--transition);
}
.odds-chip:hover {
  background: var(--color-primary);
  color: var(--color-dark);
}
.odds-chip.boosted {
  background: var(--color-primary);
  color: var(--color-dark);
}

/* --- Section Spacing --- */
.section {
  padding: 2rem 0;
}
.section + .section {
  border-top: 1px solid var(--color-border);
}

/* --- Content Prose --- */
.prose h2 { margin-top: 2.5rem; margin-bottom: 1rem; }
.prose h3 { margin-top: 1.75rem; margin-bottom: .75rem; }
.prose p { color: var(--color-text); font-size: .95rem; line-height: 1.7; }
.prose ul, .prose ol { margin-bottom: 1rem; padding-left: 1.5rem; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: .4rem; font-size: .95rem; line-height: 1.6; color: var(--color-text); }
.prose blockquote {
  border-left: 3px solid var(--color-primary);
  padding: .75rem 1rem;
  margin: 1.25rem 0;
  background: var(--color-surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--color-muted);
  font-style: italic;
}

/* --- Disclaimer Bar --- */
.disclaimer-bar {
  background: rgba(255,209,0,.08);
  border: 1px solid rgba(255,209,0,.15);
  border-radius: var(--radius-md);
  padding: .75rem 1rem;
  font-size: .82rem;
  color: var(--color-muted);
  margin-bottom: 1.5rem;
}

/* --- Author Box --- */
.author-box {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-top: 2.5rem;
  border: 1px solid var(--color-border);
}
.author-box .author-photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--color-primary);
}
.author-box .author-info h4 {
  margin-bottom: .25rem;
  color: var(--color-primary);
}
.author-box .author-info .role {
  font-size: .82rem;
  color: var(--color-muted);
  margin-bottom: .5rem;
}
.author-box .author-info p {
  font-size: .88rem;
  color: var(--color-text);
  margin-bottom: 0;
}

/* --- Age Badge --- */
.age-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-danger);
  color: #fff;
  font-weight: 800;
  font-size: .85rem;
  flex-shrink: 0;
}

/* --- Cookie Banner --- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-dark);
  border-top: 2px solid var(--color-primary);
  padding: 1rem;
  z-index: 9000;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transform: translateY(100%);
  transition: transform .4s ease;
}
.cookie-banner.visible { transform: translateY(0); }
.cookie-banner p { font-size: .82rem; color: var(--color-muted); margin-bottom: 0; flex: 1; min-width: 200px; }

/* --- FAQ Accordion --- */
.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: .5rem;
  overflow: hidden;
}
.faq-question {
  width: 100%;
  padding: 1rem 1.25rem;
  background: var(--color-surface);
  color: var(--color-text);
  font-weight: 600;
  font-size: .95rem;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background var(--transition);
}
.faq-question:hover { background: var(--color-surface-light); }
.faq-question .icon { transition: transform .3s ease; font-size: 1.2rem; color: var(--color-primary); }
.faq-item.open .faq-question .icon { transform: rotate(45deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s ease, padding .3s ease;
}
.faq-item.open .faq-answer {
  max-height: 600px;
  padding: 1rem 1.25rem;
}
.faq-answer p { font-size: .9rem; color: var(--color-muted); margin-bottom: .5rem; }
.faq-answer p:last-child { margin-bottom: 0; }

/* --- Utility Classes --- */
.text-yellow { color: var(--color-primary); }
.text-muted { color: var(--color-muted); }
.text-live { color: var(--color-live); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* --- 21+ Label inline --- */
.age-label {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .82rem;
  font-weight: 700;
  color: var(--color-danger);
}

/* --- Ethiopian flag stripe (decorative) --- */
.eth-stripe {
  width: 4px;
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
}
.eth-stripe .green { height: 33.3%; background: #078930; }
.eth-stripe .yellow { height: 33.3%; background: #FCDD09; }
.eth-stripe .red { height: 33.3%; background: #DA121A; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--color-dark); }
::-webkit-scrollbar-thumb { background: var(--color-surface-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-muted); }


/* --- Cross-device hardening --- */
html, body { max-width: 100%; overflow-x: hidden; }
*, *::before, *::after { min-width: 0; }
img, video, iframe { max-width: 100%; }
pre, code { overflow-x: auto; max-width: 100%; }
button, a, input, select, textarea { touch-action: manipulation; }

@media (max-width: 600px) {
  html { font-size: 15px; }
  .container { padding-left: .75rem; padding-right: .75rem; }
  .section { padding: 1.35rem 0; }
  .prose p, .prose li { font-size: .9rem; line-height: 1.65; overflow-wrap: anywhere; }
  .prose h2 { margin-top: 1.75rem; }
  .disclaimer-bar { font-size: .76rem; padding: .65rem .75rem; }
  .author-box { flex-direction: column; padding: 1rem; }
  .author-box .author-photo { width: 64px; height: 64px; }
  .cookie-banner { padding: .75rem; gap: .65rem; padding-bottom: calc(.75rem + env(safe-area-inset-bottom)); }
  .cookie-banner p { font-size: .74rem; min-width: 0; }
  .cookie-banner .btn { flex: 0 0 auto; }
  .table-responsive table { min-width: 480px; }
}

@media (min-width: 601px) and (max-width: 1100px) {
  .container { padding-left: 1.25rem; padding-right: 1.25rem; }
}


/* --- Shared mobile bottom navigation (all pages) --- */
.mobile-bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: var(--bottom-bar-h);
  display: none;
  align-items: center;
  justify-content: space-around;
  padding: .25rem 0 env(safe-area-inset-bottom);
  background: var(--color-dark);
  border-top: 1px solid var(--color-border);
  z-index: 80;
}
.mobile-bottom-bar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
  min-width: 56px;
  padding: .25rem;
  color: var(--color-muted);
  font-size: .62rem;
  font-weight: 600;
  text-align: center;
}
.mobile-bottom-bar a svg { width: 22px; height: 22px; }
.mobile-bottom-bar a.active { color: var(--color-primary); }
@media (max-width: 1024px) {
  .mobile-bottom-bar { display: flex; }
  body { padding-bottom: calc(var(--bottom-bar-h) + env(safe-area-inset-bottom) + 8px); }
}
@media (min-width: 1025px) {
  .mobile-bottom-bar { display: none; }
}
