/* =========================================
   1. GLOBAL VARIABLES & BASE
========================================= */
:root {
  color-scheme: light;
  
  /* Color Palette */
  --bg-dark: #2c3e50;
  --bg-blue-grey: #7b8b9e;
  --bg-light: #f8f9fa;
  --text-main: #333333;
  --text-muted: #6c7a89;
  
  /* Highlight Colors */
  --color-green: #2ca02c;
  --bg-green-soft: rgba(44, 160, 44, 0.08);
  --color-blue: #1967d2;
  --bg-blue-soft: #e8f0fe;
  
  /* Typography */
  --font-headers: 'Lato', sans-serif;
  --font-body: 'Roboto', sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box; /* Prevents padding from breaking layouts */
}

/* Scrollbar Styling */
html {
  scrollbar-width: thin; 
  scrollbar-color: #888888 #f1f1f1; 
}
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
::-webkit-scrollbar-thumb { background: #888; border-radius: 4px; }

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 11pt;
  line-height: 1.5;
  color: var(--text-main);
  overflow-x: hidden;
}

main {
  display: block;
  width: 100%;
}

h1, h2, h3 {
  font-family: var(--font-headers);
  margin-top: 0;
}

h1 { font-weight: 700; color: var(--bg-blue-grey); font-size: 1.5rem; }
h2 { font-weight: 700; color: var(--bg-blue-grey); font-size: 1.25rem; }

/* =========================================
   2. NAVIGATION BAR
========================================= */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #efefef;
  padding: 0.75rem 2rem;
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 1000;
}

.navbar .logo { display: flex; align-items: center; text-decoration: none; margin-right: 20px; }
.navbar .logo-img { height: 35px; width: auto; display: block; }

.nav-links { list-style: none; display: flex; gap: 1.5rem; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; color: #333; transition: color 0.2s; }
.nav-links a.active { font-weight: bold; }
.nav-links a:hover { color: #000; }

.menu-toggle { display: none; font-size: 2rem; background: none; border: none; cursor: pointer; }

/* =========================================
   3. LAYOUT CONTAINERS
========================================= */
/* Home Page Flex Grid */
.layout-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 30px;
}
.col-left { flex: 1 1 35%; min-width: 300px; }
.col-right { flex: 1 1 55%; min-width: 300px; }

/* Text Pages (Rules, Docs) */
.text-container {
  width: 100%;
  max-width: 900px;
  margin: 40px auto;
  padding: 0 20px;
  text-align: justify;
}

/* Data Pages (Events, Standings) */
.data-container {
  max-width: 1000px;
  margin: 40px auto;
  padding: 0 20px;
}

/* Home Page Specifics */
.hero-logo { margin-top: 2rem; max-width: 250px; }
.fluid-img { width: 100%; height: auto; display: block; }
.event-section { background-color: var(--bg-blue-grey); color: #ffffff; }
.event-section h2 { color: #fff; font-size: 2.5rem; margin-bottom: 1.5rem; }
.event-section h3 { font-size: 1.2rem; margin-bottom: 1rem; color: #fff; }
.event-section p { font-size: 1rem; }
.event-section .bold-time { font-weight: 700; margin-bottom: 2rem; }

/* =========================================
   4. COMPONENTS (Headers, Videos, Tables)
========================================= */

/* Event Header (E1 Badge) */
.event-header { display: flex; align-items: center; gap: 20px; margin-bottom: 40px; }
.event-badge { font-family: var(--font-headers); font-size: 4.5rem; font-weight: 900; color: var(--bg-blue-grey); line-height: 1; border-right: 3px solid #ddd; padding-right: 20px; }
.event-info { display: flex; flex-direction: column; justify-content: center; }
.event-info h1 { font-size: 2.2rem; color: var(--text-main); margin: 0 0 5px 0; line-height: 1; letter-spacing: 1px; text-transform: uppercase; }
.event-info p { margin: 0; color: var(--text-muted); font-size: 1.1rem; font-weight: 500; letter-spacing: 0.5px; }

/* Standard Page Header */
.page-header { margin-bottom: 30px; }
.page-header h1 { font-size: 2.5rem; color: var(--text-main); margin-bottom: 5px; letter-spacing: 2px; }
.page-header p { color: var(--text-muted); margin: 0; font-size: 1.1rem; text-transform: uppercase; letter-spacing: 1px; }

/* Video Wrapper */
.video-wrapper { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); margin-bottom: 40px; }
.video-wrapper iframe, .video-wrapper img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* Universal Data Tables */
.table-responsive { width: 100%; overflow-x: auto; box-shadow: 0 4px 15px rgba(0,0,0,0.05); border-radius: 8px; }
.data-table { width: 100%; border-collapse: collapse; text-align: right; font-size: 0.95rem; background-color: #ffffff; }

/* Align first two/three columns left */
.data-table th:nth-child(1), .data-table td:nth-child(1),
.data-table th:nth-child(2), .data-table td:nth-child(2) { text-align: left; }

.data-table th { background-color: var(--bg-light); color: var(--text-muted); font-weight: 700; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.05rem; padding: 16px 12px; border-bottom: 2px solid #ddd; }
.data-table td { padding: 14px 12px; border-bottom: 1px solid #f1f1f1; color: #444; }
.data-table tbody tr:hover { background-color: #fcfcfc; transition: background-color 0.2s ease; }

/* Modifier for centered tables (like Standings) */
.data-table.table-center { text-align: center; }
.data-table.table-center th { background-color: var(--bg-dark); color: #ffffff; }
.data-table.table-center th:nth-child(3), .data-table.table-center td:nth-child(3) { text-align: left; }

/* Table Highlights */
.fastest { background-color: var(--bg-green-soft); color: var(--color-green); font-weight: 700; border-radius: 4px; }
.win { background-color: var(--bg-blue-soft) !important; color: var(--color-blue); font-weight: bold; }
.podium { background-color: #f1f3f4 !important; font-weight: bold; }
.total-col { background-color: #fafafa; font-weight: 900; font-size: 1.1rem; color: var(--bg-dark); border-left: 2px solid #eee; }

/* =========================================
   5. MOBILE RESPONSIVE
========================================= */
@media (max-width: 600px) {
  .navbar { padding: 0.2rem 1rem; }
  .navbar .nav-links { display: none; flex-direction: column; position: absolute; top: 60px; right: 0; background: #fff; padding: 1rem; box-shadow: -2px 5px 10px rgba(0, 0, 0, 0.1); width: 200px; }
  .navbar .nav-links.show { display: flex; gap: 1rem; }
  .menu-toggle { display: block; transform: translateY(1px); }
  
  .event-badge { font-size: 3rem; padding-right: 15px; }
  .event-info h1 { font-size: 1.8rem; }
}