/* static/css/index.css - Dedicated Styles for Home Page */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

html {
    scroll-behavior: smooth;
}

:root {
  /* Brand Palette */
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --accent: #ec4899;
  --live-color: #ef4444;

  /* Light Theme Variables */
  --bg-body: #f3f4f6;
  --bg-surface: #ffffff;
  --bg-header: #ffffff;
  --text-main: #111827;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --score-color: #111827;
}

/* Dark Theme Variables */
[data-theme="dark"] {
  --bg-body: #0f172a;
  --bg-surface: #1e293b;
  --bg-header: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border: #334155;
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --score-color: #ffffff;
}

/* --- 1. RESET & BASE --- */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; transition: color 0.2s; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* --- 2. HEADER --- */
.site-header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}
.header-left { display: flex; align-items: center; gap: 30px; }
.brand {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}
.nav-links { display: flex; gap: 20px; font-size: 0.95rem; font-weight: 600; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.theme-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .header-left { gap: 10px; }
}

/* --- 3. LAYOUT & GRID (FIXED FOR SCROLLING) --- */
.container {
  max-width: 1150px;
  margin: 0 auto;
  padding: 20px;
}

.main-grid {
  display: grid;
  grid-template-columns: 2.5fr 1fr;
  gap: 24px;
  margin-top: 20px;
  /* CRITICAL: Prevents the grid from forcing the page wide */
  max-width: 100%; 
}

/* CRITICAL FIX: 'min-width: 0' forces flex/grid children to shrink/scroll 
   instead of expanding the parent container */
.left-col {
  min-width: 0; 
  width: 100%;
}

.right-col {
  /* Sidebar styles */
}

@media (max-width: 900px) {
  .main-grid {
    grid-template-columns: 1fr; /* Stack vertically on mobile */
  }
}

/* --- 4. HORIZONTAL SLIDERS (CRICBUZZ STYLE) --- */
.section-heading {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 30px 0 15px 0;
  padding-left: 12px;
  border-left: 4px solid var(--primary);
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.scroll-wrapper {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 15px; 
  /* FIX: Add top padding so the hover effect (-3px) doesn't get cut off */
  padding-top: 10px;
  margin-bottom: 20px;
  
  /* Smooth Scrolling behavior */
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch; 
  
  /* Ensure it fits within .left-col */
  width: 100%;
  max-width: 100%;
  
  scrollbar-width: thin;
}

/* Scrollbar Styling - Better Dark Mode support */
.scroll-wrapper::-webkit-scrollbar { height: 8px; }
.scroll-wrapper::-webkit-scrollbar-track { 
  background: transparent; /* Transparent track so it blends in */
}
.scroll-wrapper::-webkit-scrollbar-thumb { 
  background: var(--border); /* Matches theme border color */
  border-radius: 10px; 
  border: 2px solid var(--bg-body); /* Adds a small gap around thumb */
}
.scroll-wrapper::-webkit-scrollbar-thumb:hover { 
  background: var(--text-muted); 
}

/* Match Card Styles */
.match-card {
  flex: 0 0 310px; /* FIXED WIDTH: Cards won't shrink or grow */
  background: var(--bg-surface);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none; 
  color: var(--text-main);
  transition: transform 0.2s, box-shadow 0.2s;
}

@media (max-width: 480px) {
  .match-card {
    flex: 0 0 280px; /* Slightly narrower for phones */
  }
}

.match-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.league-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.score-val {
  font-family: monospace;
  color: var(--score-color);
  font-weight: 800;
}

.status-line {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-live { color: var(--live-color); }
.status-upcoming { color: var(--text-muted); }
.status-finished { color: var(--primary); }

.empty-msg {
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  width: 100%;
  background: var(--bg-surface);
  border-radius: 12px;
  border: 1px dashed var(--border);
  min-width: 100%; /* Ensures empty state fills width */
}

/* --- 5. SIDEBAR --- */
.sidebar-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

/* --- 6. FOOTER --- */
footer {
  margin-top: 50px;
  padding: 30px;
  background: var(--bg-surface);
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}