/* ============================================
   CrickTips — style.css
   Global styles, CSS variables, layout
   ============================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img, video, svg { max-width: 100%; height: auto; display: block; }

/* ---- Design Tokens ---- */
:root {
  --bg: #0d1117;
  --bg2: #161b22;
  --bg3: #21262d;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #f5a623;
  --accent2: #00c9a7;
  --red: #f85149;
  --green: #3fb950;
  --blue: #58a6ff;
  --purple: #bc8cff;
  --font-heading: 'Rajdhani', sans-serif;
  --font-body: 'Inter', sans-serif;
  --radius: 10px;
  --radius-sm: 6px;
}

/* ---- Base ---- */
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button { font-family: var(--font-body); cursor: pointer; }
h1, h2, h3 { font-family: var(--font-heading); }

/* ---- Top Bar ---- */
.top-bar {
  background: #010409;
  padding: 5px 0;
  text-align: center;
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.5px;
}

/* ---- Header ---- */
header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
}

/* Logo */
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { width: 34px; height: 34px; background: linear-gradient(135deg, var(--accent), #e8860a); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.logo-text { font-family: var(--font-heading); font-size: 22px; font-weight: 700; letter-spacing: 1px; }
.logo-text span { color: var(--accent); }

/* Nav */
nav { display: flex; gap: 2px; }
nav a { color: var(--muted); padding: 6px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; transition: all 0.15s; }
nav a:hover, nav a.active { color: var(--text); background: var(--bg3); }
nav a.active { color: var(--accent); }

.header-right { display: flex; align-items: center; gap: 12px; }

.live-badge { background: var(--red); color: #fff; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 4px; letter-spacing: 1px; animation: pulse 1.5s infinite; }

.btn-premium { background: linear-gradient(135deg, var(--accent), #e8860a); color: #000; font-weight: 700; font-size: 12px; padding: 7px 18px; border-radius: var(--radius-sm); letter-spacing: 0.5px; border: none; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

/* ---- Score Ticker ---- */
.ticker { background: var(--bg2); border-bottom: 1px solid var(--border); overflow: hidden; padding: 8px 0; position: relative; width: 100%; }
.ticker-inner { display: flex; animation: tickerScroll 35s linear infinite; white-space: nowrap; will-change: transform; }
@keyframes tickerScroll { 0% { transform: translateX(100vw); } 100% { transform: translateX(-200%); } }
.ticker-item { display: inline-flex; align-items: center; gap: 10px; padding: 0 30px; border-right: 1px solid var(--border); font-size: 12px; flex-shrink: 0; }
.ticker-teams { font-weight: 600; }
.ticker-score { color: var(--accent); font-weight: 700; }
.ticker-status { color: var(--green); font-size: 11px; }

/* ---- Page Layout ---- */
.main { max-width: 1280px; margin: 0 auto; padding: 20px; display: grid; grid-template-columns: 1fr 320px; gap: 20px; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* ---- Section Header ---- */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title { font-family: var(--font-heading); font-size: 18px; font-weight: 700; letter-spacing: 0.5px; display: flex; align-items: center; gap: 8px; }
.section-title::before { content: ''; display: block; width: 3px; height: 18px; background: var(--accent); border-radius: 2px; }
.see-all { color: var(--accent); font-size: 12px; font-weight: 500; }
.see-all:hover { text-decoration: underline; }

/* ---- Stats Banner ---- */
.stats-banner { background: linear-gradient(135deg, #1a1f2e, #161b22); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 24px; text-align: center; }
.stat-num { font-family: var(--font-heading); font-size: 26px; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ---- Filter Tabs ---- */
.filter-tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-tab { padding: 5px 14px; border-radius: 20px; font-size: 12px; font-weight: 500; border: 1px solid var(--border); color: var(--muted); background: transparent; transition: all 0.15s; }
.filter-tab:hover { border-color: var(--accent); color: var(--text); }
.filter-tab.active { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 700; }

/* ---- Footer ---- */
footer { background: var(--bg2); border-top: 1px solid var(--border); margin-top: 40px; padding: 30px 20px; text-align: center; color: var(--muted); font-size: 12px; line-height: 1.8; }
footer a { color: var(--accent); }
footer a:hover { text-decoration: underline; }
.footer-links { display: flex; justify-content: center; gap: 20px; margin-bottom: 16px; flex-wrap: wrap; }
.disclaimer { max-width: 700px; margin: 0 auto; font-size: 11px; color: #555; }

/* ---- Modal ---- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 999; }
.modal-overlay[hidden] { display: none; }
.modal { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; max-width: 700px; width: 95%; position: relative; }
.modal-close { position: absolute; top: 16px; right: 16px; background: transparent; border: none; color: var(--muted); font-size: 20px; cursor: pointer; }
.modal-close:hover { color: var(--text); }

/* ---- Responsive / Overflow Prevention ---- */
html {
  overflow-x: hidden;
}
body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

/* Flex/grid children need min-width:0 to shrink below content size */
main, aside, .main > *, .admin-main { min-width: 0; }

@media (max-width: 900px) {
  .main { grid-template-columns: 1fr; padding: 14px; }
  .stats-banner { grid-template-columns: repeat(2, 1fr); }
  nav { display: none; }
  .header-inner { padding: 0 14px; }
  .filter-tabs { width: 100%; }
}

@media (max-width: 600px) {
  .header-inner { gap: 8px; }
  .btn-premium { font-size: 11px; padding: 6px 10px; letter-spacing: 0; }
  .logo-text { font-size: 19px; }
  .modal { padding: 20px 16px; }
  footer { padding: 20px 14px; }
  .footer-links { gap: 12px; font-size: 12px; }
  .container { padding: 0 16px; }
}

@media (max-width: 400px) {
  .btn-premium { display: none; }
  .live-badge { display: none; }
  .logo-text { font-size: 18px; }
  .stats-banner { grid-template-columns: 1fr 1fr; gap: 6px; padding: 12px; }
  .stat-num { font-size: 20px; }
}
