/* ==========================================================================
   LETSRACE.CC - Consolidated Styles
   ========================================================================== */

/* ==========================================================================
   BASE STYLES
   ========================================================================== */

body {
  font-family: Arial, sans-serif;
  background: #f5f5f5;
  margin: 0;
  padding: 2rem;
}

/* ==========================================================================
   HOMEPAGE STYLES
   ========================================================================== */

/* ==========================================================================
   ABOUT PAGE STYLES
   ========================================================================== */

.about-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  line-height: 1.6;
}

.about-content h1 {
  color: #0077cc;
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.about-content h2 {
  color: #0077cc;
  font-size: 1.8rem;
  margin: 2rem 0 1rem 0;
  border-bottom: 2px solid #0077cc;
  padding-bottom: 0.5rem;
}

.about-content p {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.about-content ul {
  margin: 1rem 0 1rem 2rem;
}

.about-content li {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.about-content a {
  color: #0077cc;
  text-decoration: none;
}

.about-content a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .about-content {
    padding: 1rem;
  }
  
  .about-content h1 {
    font-size: 2rem;
  }
  
  .about-content h2 {
    font-size: 1.5rem;
  }
  
  .about-content p,
  .about-content li {
    font-size: 1rem;
  }
}

/* Critical styles for instant loading */

/* Main container layout */
.main-container {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Region sidebar */
.region-sidebar {
  background: transparent;
  border-radius: 0;
  padding: 0;
  height: fit-content;
  position: sticky;
  top: 2rem;
  box-shadow: none;
  margin-top: 1rem;
}

.region-sidebar h3 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  color: #333;
  font-weight: bold;
}


.region-selector { 
  margin: 2rem 0; 
}

.region-selector label { 
  display: block; 
  margin-bottom: 0.5rem; 
  font-weight: bold; 
}

.region-selector select { 
  padding: 0.5rem; 
  font-size: 1rem; 
  border: 1px solid #ddd; 
  border-radius: 4px; 
}

.new-events-section {
  margin: 2rem 0;
}

.new-events-section h2 {
  text-align: center;
  color: #0077cc;
  font-size: 2rem;
  margin-bottom: 2rem;
  font-weight: bold;
}

.event-discipline {
  margin: 0.5rem 0 0 0;
  color: #0077cc;
  font-size: 0.8rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Events display */
.events-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.event {
  display: flex;
  background: #fff3cd;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 2px 5px rgba(255, 165, 0, 0.2);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.event:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(255, 165, 0, 0.3);
  text-decoration: none;
  color: inherit;
  background: #ffeaa7;
}

.event.newly-added {
  border-left: 4px solid #ff8c00;
}

.new-badge {
  background: #ff8c00;
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: bold;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  display: inline-block;
  width: fit-content;
}

.event-content {
  flex: 1;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.event-content h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.2rem;
  line-height: 1.3;
  color: #0077cc;
  font-weight: bold;
}

.event-content p {
  margin: 0;
  color: #666;
  font-size: 1rem;
}

.no-events {
  text-align: center;
  padding: 3rem 2rem;
  color: #666;
  font-style: italic;
  background: #ffffff;
  border-radius: 8px;
  margin: 2rem 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Desktop region filter */
.mobile-region-filter {
  display: none;
}


.category-link { 
  display: block; 
  padding: 1.5rem; 
  background: white; 
  border: 2px solid #0077cc; 
  border-radius: 8px; 
  text-decoration: none; 
  color: #0077cc; 
  font-weight: bold; 
  text-align: center; 
  transition: all 0.3s ease; 
}

.category-link:hover { 
  background: #0077cc; 
  color: white; 
  transform: translateY(-2px); 
  box-shadow: 0 4px 8px rgba(0,119,204,0.3); 
}

.loading-message { 
  text-align: center; 
  padding: 3rem; 
  background: white; 
  border-radius: 8px; 
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); 
  margin: 1rem 0; 
  color: #666;
  font-style: italic;
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */

header {
  background: #0077cc;
  color: white;
  padding: 1rem;
  text-align: center;
  position: relative;
  margin-left: -2rem;
  margin-right: -2rem;
}

header h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-family: 'Courier New', monospace;
}

header h1 a {
  color: white;
  text-decoration: none;
}

header nav {
  margin-top: 1rem;
}

nav a {
  color: white;
  margin: 0 0.5rem;
  text-decoration: none;
}

nav a:hover {
  text-decoration: underline;
}

nav a.current {
  font-weight: bold;
  text-decoration: none !important;
  border-bottom: 3px solid white;
  padding-bottom: 3px;
}

/* ==========================================================================
   EVENTS PAGE STYLES
   ========================================================================== */

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}



main h1 {
  font-size: 2rem;
  color: #333;
  margin-bottom: 0.5rem;
  text-align: left;
  margin-left: calc(300px + 2rem);
}



.update-time {
  font-size: 1rem;
  color: #666;
  margin-bottom: 0.5rem;
  margin-left: calc(300px + 2rem);
}

.event-count {
  font-size: 1rem;
  color: #666;
  margin-bottom: 2rem;
  margin-left: calc(300px + 2rem);
}

/* New event page system styles */
.events-page-container .update-time {
  margin-left: 0;
}

.events-page-container .event-count {
  margin-left: 0;
}

/* Main layout - two columns */
.events-page-container {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
}

/* Filters sidebar */
.filters {
  background: #ffffff;
  border-radius: 8px;
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  height: fit-content;
  position: sticky;
  top: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-top: 1rem;
}




.filters::before {
  content: "Filter by Region";
  display: block;
  font-weight: bold;
  font-size: 1rem;
  color: #333;
  margin-bottom: 0.5rem;
  margin-top: -0.5rem;
  position: relative;
}

.filter-group {
  margin-bottom: 1.5rem;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-group > label {
  font-weight: bold;
  font-size: 1rem;
  color: #333;
  margin-bottom: 0.75rem;
  display: block;
}

/* Region Checkboxes - Consolidated */
.region-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.region-checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 0.9rem;
  color: #495057;
  position: relative;
  padding: 0.25rem 0 0.25rem 2.25rem;
  font-weight: normal;
}

.region-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
  margin: 0;
}

.checkmark {
  position: absolute;
  left: 0;
  height: 18px;
  width: 18px;
  background-color: white;
  border: 2px solid #0077cc;
  border-radius: 3px;
  transition: all 0.2s ease;
  display: inline-block;
}

.region-checkbox:hover .checkmark {
  background-color: #e3f2fd;
}

.region-checkbox input:checked ~ .checkmark {
  background-color: #0077cc;
}

.checkmark:after {
  content: "✓";
  position: absolute;
  display: none;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-weight: 900;
  font-size: 16px;
}

.region-checkbox input:checked ~ .checkmark:after {
  display: block;
}

/* Filter toggle button */
.filter-toggle-btn {
  display: none;
  width: 100%;
  padding: 1rem 1rem;
  background: #0077cc;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  text-align: center;
  transition: background-color 0.2s ease;
}

.filter-toggle-btn:hover {
  background: #0056b3;
}

.filter-toggle-btn .filter-toggle-icon {
  float: right;
  transition: transform 0.2s ease;
}

.filter-toggle-btn.expanded .filter-toggle-icon {
  transform: rotate(180deg);
}

.filter-content {
  display: block;
  padding-top: 1rem;
}

/* Filter buttons */
.filter-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.apply-filter-btn,
.clear-regions-btn {
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.apply-filter-btn {
  background: #007bff;
  color: white;
}

.apply-filter-btn:hover {
  background: #0056b3;
}

.clear-regions-btn {
  background: #6c757d;
  color: white;
}

.clear-regions-btn:hover {
  background: #545b62;
}

/* Results area */
.results {
  min-height: 400px;
}

#result-count {
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: #333;
  font-size: 1.1rem;
}

#empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: #666;
  font-style: italic;
  background: #ffffff;
  border-radius: 8px;
  margin: 2rem 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#event-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

/* Event cards */
#event-list li {
  display: flex;
  background: white;
  border-radius: 8px;
  padding: 0;
  margin: 0.5rem 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

#event-list li:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  text-decoration: none;
  color: inherit;
  background: #ffffff;
}

/* Newly added events styling */
#event-list li.newly-added {
  background: #fff8e1;
  border-left: 4px solid #ff8c00;
}

/* Date square */
.date-square {
  background: #0077cc;
  color: white;
  padding: 0.8rem 0.8rem;
  text-align: center;
  min-width: 85px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.day-name {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 0.2rem;
}

.day-number {
  font-size: 2.4rem;
  font-weight: bold;
  line-height: 1;
  margin-bottom: 0.2rem;
}

.month {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Event content */
#event-list li article {
  flex: 1;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#event-list h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.2rem;
  line-height: 1.3;
  color: #0077cc;
  font-weight: bold;
}

#event-list h3 a {
  color: #0077cc;
  text-decoration: none;
}

#event-list h3 a:hover {
  text-decoration: underline;
}

#event-list p {
  margin: 0;
  color: #666;
  font-size: 1rem;
}

.event-location {
  margin: 0;
  color: #666;
  font-size: 0.9rem;
}

/* ==========================================================================
   LEGACY STYLES (for backward compatibility)
   ========================================================================== */

/* Button container for region sidebar */
.region-sidebar-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ==========================================================================
   ABOUT PAGE STYLES
   ========================================================================== */

.about-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
}

.about-content h1 {
  font-size: 2rem;
  color: #333;
  margin-bottom: 1rem;
}

.about-content h2 {
  font-size: 1.5rem;
  color: #333;
  margin: 2rem 0 1rem 0;
}

.about-content p {
  margin-bottom: 1rem;
  line-height: 1.6;
  color: #333;
}

.about-content ul {
  margin-bottom: 1rem;
  padding-left: 2rem;
}

.about-content li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.region-sidebar-buttons {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* Make single button take full width */
.region-sidebar-buttons .clear-regions-btn:only-child {
  flex: 1;
  width: 100%;
}

/* Main Content - no longer used, now uses .results like event pages */

/* ==========================================================================
   FOOTER
   ========================================================================== */

footer {
  margin-top: 1rem;
  margin-left: -2rem;
  margin-right: -2rem;
  padding: 1.5rem;
  background: #333;
  color: white;
  text-align: center;
}

footer a {
  color: white;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

footer a:visited {
  color: white;
}

#build-stamp {
  color: #666;
  font-size: 0.85rem;
}

/* ==========================================================================
   BURGER MENU
   ========================================================================== */

/* Burger icon styles */
#burger-menu {
  display: none;
  width: 35px;
  height: 30px;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  z-index: 1001;
  position: absolute;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#burger-menu span {
  display: block;
  height: 5px;
  background: #fff;
  border-radius: 3px;
  margin: 3px 0;
  transition: 0.3s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

#burger-menu:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

#burger-menu:hover span {
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

#burger-menu.open {
  display: none !important;
}

/* Mobile nav styles */
#mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  width: 200px;
  height: 100%;
  background: #fff;
  box-shadow: -2px 0 5px rgba(0,0,0,0.1);
  z-index: 1003;
  padding-top: 60px;
}

#mobile-nav.open {
  display: block;
}

#mobile-nav ul {
  list-style: none;
  padding: 0;
}

#mobile-nav li {
  margin: 8px 0;
}

#mobile-nav a {
  text-decoration: none;
  color: #333;
  font-size: 18px;
  padding: 8px 20px;
  display: block;
}

#mobile-nav a:hover {
  background: #f8f9fa;
}

#mobile-nav a.current {
  font-weight: bold;
  text-decoration: none !important;
}

/* Close menu button */
#close-menu {
  display: none;
  position: absolute;
  top: 15px;
  right: 15px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  z-index: 1004;
}

#close-menu::before,
#close-menu::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 3px;
  background-color: #333;
  top: 50%;
  left: 0;
}

#close-menu::before {
  transform: rotate(45deg);
}

#close-menu::after {
  transform: rotate(-45deg);
}

#mobile-nav.open #close-menu {
  display: block;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 768px) {
  body {
    padding: 0;
  }
  
  footer {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    padding: 1rem;
  }
  
  header {
    padding: 1rem;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
  }
  
  header h1 {
    font-size: 2rem;
    padding-right: 40px; /* Space for burger menu */
  }
  
  #burger-menu {
    display: flex;
  }
  
  header nav {
    display: none;
  }
  
  main h1 {
    margin-left: 0;
    margin-bottom: 0.5rem;
  }
  
  .update-time {
    margin-left: 0;
    margin-bottom: 0.5rem;
  }
  
  .event-count {
    margin-left: 0;
    margin-bottom: 1rem;
  }
  
  .filters::before {
    display: none;
  }
  
  /* Mobile layout */
  .main-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0;
  }
  
  .region-sidebar {
    position: static;
    order: 1;
    width: 100%;
    max-width: none;
    padding: 0.75rem;
    margin: 0;
  }
  
  .main-content {
    order: 2;
  }
  
  /* Mobile region filter */
  .mobile-region-filter {
    display: block;
    margin-bottom: 2rem;
  }
  
  .mobile-filter-btn {
    width: 100%;
    padding: 1rem;
    background: #0077cc;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
  }
  
  .mobile-filter-panel {
  display: none;
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 1rem;
  margin-top: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
  
  .mobile-filter-panel.active {
    display: block;
  }
  
  .mobile-region-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
  }
  
  .mobile-region-checkboxes .region-checkbox {
  padding: 0.5rem;
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin: 0;
  font-size: 0.9rem;
}
  
  .mobile-region-checkboxes .region-checkbox:hover {
    background: #e9ecef;
  }
  
  .mobile-region-checkboxes .region-checkbox input:checked ~ .checkmark {
    background-color: #0077cc;
  }
  
  /* Hide desktop region sidebar on mobile */
  .region-sidebar {
    display: none;
  }
}

/* Desktop-specific filter title positioning */
@media (min-width: 769px) {
  .filters::before {
    margin-top: -4rem;
  }
  
  .filters {
    margin-top: -4rem;
    padding-top: 5rem;
  }
}

@media (max-width: 768px) {
  /* Mobile grid layout */
  .events-page-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .filters {
    position: static;
    order: 1;
    width: 100%;
    max-width: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
  }
  
  .filter-toggle-btn {
    display: block;
    width: 100%;
    font-weight: normal;
    margin: 0 auto;
    max-width: none;
  }
  
  .filter-content {
    display: none;
  }
  
  .filter-content.expanded {
    display: block;
  }
  
  
  .results {
    order: 2;
  }
  
  .region-checkboxes {
    max-height: none;
    overflow-y: visible;
  }
  
  .filter-buttons {
    flex-direction: row;
  }
  
  .apply-filter-btn,
  .clear-regions-btn {
    flex: 1;
  }
  
  /* Mobile event cards */
  #event-list li {
    flex-direction: row;
  }
  
  .date-square {
    min-width: 80px;
    padding: 0.75rem;
  }
  
  #event-list li article {
    padding: 1rem;
  }
  
  /* Mobile region checkboxes */
  .mobile-region-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
  }
  
  .mobile-region-checkboxes .region-checkbox {
    width: 100%;
    padding: 0.75rem 0;
    background: transparent;
    border: none;
    border-radius: 0;
    margin: 0;
  }
  
  .mobile-region-checkboxes .region-checkbox:hover {
  background: #ffffff;
}
  
  .mobile-region-checkboxes .region-checkbox input:checked ~ .checkmark {
    background-color: #0077cc;
  }
  
}
