@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* Base styles */
.event-card {
  background: #1a1a1a;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  position: relative;
  border: 1px solid #333;
  /*      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); */
  transition: all 0.3s ease;
  min-height: auto;
  /* Remove fixed height */
  opacity: 1 !important;
  display: block;
}

.event-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #3b82f6, transparent);
  transform: translateX(-100%);
  opacity: 0;
}

.event-card.loading::before {
  animation: loading 1.5s ease infinite;
}

@keyframes loading {
  0% {
    transform: translateX(-100%);
    opacity: 1;
  }

  100% {
    transform: translateX(100%);
    opacity: 0;
  }
}

.event-card.inactive {
  height: 0;
  margin: 0;
  padding: 0;
  opacity: 0;
  overflow: hidden;
  display: none;
  transition: all 0.3s ease;
}

.event-card:hover {
  z-index: 50;
  /*	border-color: #2563eb; */
}

.event-card.hidden-event {
  max-height: 0;
  opacity: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Event Header */
.event-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  background: rgba(26, 26, 26, 0.95);
  border-bottom: 1px solid #333;
  backdrop-filter: blur(8px);
}

.event-content {
  padding: 1rem;
  display: none;
  transition: opacity 0.3s ease;

}

.event-content.active {
  display: block;
}

/* Links and Buttons */
.event-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.event-link:hover h3 {
  color: #60a5fa;
}

.btn {
  height: 38px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  transition: all 0.2s;
}

.btn-primary {
  background: #2563eb;
  color: white;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-secondary {
  background: #1f2937;
  border: 1px solid #374151;
  color: white;
}

.btn-secondary:hover {
  background: #374151;
}

.btn.is-active {
  background-color: #2563eb;
  color: white;
}

/* Update Select Container styles */
.select-container {
  display: flex;
  gap: 1rem;
  position: relative;
  z-index: 100;
  /* Ensure dropdowns appear above other content */
}

.select-wrapper {
  position: relative;
  min-width: 200px;
  z-index: 50;
}

.select-wrapper.loading .custom-select {
  pointer-events: none;
  animation: pulse 1.5s ease-in-out infinite;
}

.custom-select-placeholder {
  height: 40px;
  background: #1f2937;
  border-radius: 8px;
  animation: pulse 1.5s ease-in-out infinite;
}

/* Create invisible bridge between select and menu */
.select-wrapper::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 10px;
  /* Bridge the gap */
  bottom: -10px;
  z-index: 99;
}

/* Custom Select styling */
.custom-select {
  width: 100%;
  height: 40px;
  padding: 0 16px;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  position: relative;
  z-index: 20;
}

/* Add smooth rotation to dropdown arrow */
.custom-select svg,
.season-button svg {
  transition: transform 0.2s ease;
}

.select-wrapper.active .custom-select svg,
.select-wrapper:hover .custom-select svg,
.season-dropdown:hover .season-button svg {
  transform: rotate(180deg);
}

.select-wrapper.active {
  z-index: 150;
}

.select-wrapper.active .custom-select {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.custom-select:hover {
  border-color: #4b5563;
  background: #262f3f;
}

.custom-select:focus-visible {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.select-option:focus-visible {
  outline: none;
  background: #374151;
  color: white;
}

/* Active state for select wrapper */
.select-wrapper.active .select-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

/* Update Select Menu styling */
.select-menu {
  position: absolute;
  /*    top: calc(100% + 8px); */
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  max-height: 400px;
  /* Increased max-height */
  overflow-y: auto;
  z-index: 30;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Smooth scrollbar for select menu */
.select-menu::-webkit-scrollbar {
  width: 8px;
}

.select-menu::-webkit-scrollbar-track {
  background: #1f2937;
}

.select-menu::-webkit-scrollbar-thumb {
  background: #4b5563;
  border-radius: 4px;
}


/* Add a small delay to prevent accidental closing */
/* .select-wrapper:hover .select-menu, */
.select-wrapper.active .select-menu {
  transition-delay: 0.2s;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);

}

.custom-select:focus-visible,
.select-option:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

/* Enhanced Select Option styling */
.select-option {
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.875rem;
  position: relative;
}

.select-option::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 0;
  background: #3b82f6;
  transition: height 0.2s ease;
}

.select-option:hover::after {
  height: 100%;
}

.select-option[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: #1f2937;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.select-option:hover {
  background: #374151;
  color: white;
}

/* Group Label styling */
.select-group-label {
  padding: 12px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
  background: #111827;
  border-bottom: 1px solid #374151;
}

/* Table Styles */
.lineup-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1rem 0;
  border: 1px solid #333;
  border-radius: 0.5rem;
  overflow: hidden;
}

.lineup-table th {
  background: linear-gradient(180deg, #374151, #1f2937);
  color: white;
  font-weight: 500;
  padding: 0.75rem 1rem;
  text-align: left;
}

.lineup-table td {
  padding: 0.75rem 1rem;
  border-top: 1px solid #333;
  background: #1a1a1a;
}

.lineup-table tr:hover td {
  background: #222;
}

/* Quick Links & Side Panel */
.side-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background: #1a1a1a;
  border-left: 1px solid #333;
  box-shadow: -4px 0 15px rgba(0, 0, 0, 0.3);
  transition: right 0.3s ease-in-out;
  z-index: 1000;
  overflow-y: auto;
}

.side-panel.active {
  right: 0;
}

.side-panel-header {
  position: sticky;
  top: 0;
  padding: 1.25rem;
  background: #1a1a1a;
  border-bottom: 1px solid #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.side-panel-content {
  padding: 1rem;
}

.quick-links-group {
  margin-bottom: 2rem;
}

.quick-links-group-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: #9ca3af;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #333;
}

.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.quick-link-button {
  padding: 0.75rem;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  color: #e5e7eb;
  transition: all 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quick-link-button:hover {
  background: #374151;
  border-color: #4b5563;
}

.panel-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease-in-out;
  z-index: 999;
}

.panel-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.custom-select.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #1a1a1a;
  pointer-events: none;
}

.custom-select.disabled .selected-text {
  color: #666;
}

.event-content {
  transition: opacity 0.3s ease;
}

.event-content.loading {
  opacity: 0.5;
}

/* Season Dropdown */
.season-dropdown {
  position: relative;
  display: inline-block;
  margin-bottom: 0rem;
}

.season-button {
  background: transparent;
  color: white;
  font-size: 2rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  margin-bottom: 0px;
  transition: color 0.2s ease;
}

.season-list {
  display: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  max-height: 400px;
  overflow-y: auto;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 0.5rem;
  z-index: 50;
  padding: 0.5rem 0;
}

.season-dropdown:hover .season-list {
  display: block;
  z-index: 90;
}

.season-dropdown:hover .season-button {
  color: #60a5fa;
}

.season-list a {
  padding: 0.5rem 1rem;
  color: #d1d5db;
  display: block;
  text-decoration: none;
}

.season-list a:hover {
  background: #333;
}

.season-list a.active {
  background: #2563eb;
  color: white;
}

/* Hero Section */
.hero {
  background: #101010;
  padding: 2rem 0;
  border-bottom: 1px solid #333;
}

.hero_title {
  position: relative;
  text-align: center;
}

.event-cards-container {
  transition: height 0.3s ease;
}

.sled-logo {
  width: 80px;
  height: 32px;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.sled-logo:hover {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.sled-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0) invert(1) opacity(75%);
  transition: all 0.2s ease;
}

.sled-logo-img:hover {
  filter: brightness(1) invert(0) opacity(100%);
}

.sled-logo-fallback {
  background: #1f2937;
  color: #9ca3af;
  font-size: 0.875rem;
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
}

/* Enhanced breadcrumb handling */
.nav_breadcrumbs {
  position: relative;
  background: #101010;
  border-bottom: 1px solid #333;
  width: 100%;
  overflow: hidden;
  /* Contains the scrolling container */
}

.nav_breadcrumbs .container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0.75rem 1rem;
  /* Add padding to container instead of ul */
}

.nav_breadcrumbs .container::-webkit-scrollbar {
  display: none;
}

.nav_breadcrumbs ul {
  display: inline-flex;
  /* Keep items in line */
  white-space: nowrap;
  gap: 0.5rem;
  padding: 0;
  /* Remove padding from ul */
  margin: 0;
  width: auto;
  /* Allow natural width */
}

/* Mobile-specific improvements */
@media (max-width: 768px) {

  /* Fixed header spacing */
  .hero {
    margin-top: 120px;
    /* Adjust based on your header height */
    padding: 1rem;
  }

  /* Season dropdown improvements */
  .season-dropdown {
    width: 100%;
    position: relative;
  }

  .season-button {
    font-size: 1.25rem;
    padding: 0.5rem 0;
    width: 100%;
    justify-content: space-between;
  }

  /* Force season list to show on click for mobile */
  .season-list {
    display: none;
    position: absolute;
    width: 100%;
    left: 0;
    transform: none;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 0.5rem;
    z-index: 1000;
    max-height: 50vh;
    overflow-y: auto;
  }

  .season-list.active {
    display: block;
  }

  /* Improved breadcrumbs */
  .nav_breadcrumbs {
    position: relative;
    background: #101010;
    border-bottom: 1px solid #333;
    width: 100%;
    overflow: hidden;
  }

  .nav_breadcrumbs .container {
    padding: 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    padding: 0.75rem 1rem;
    /* IE and Edge */
  }

  .nav_breadcrumbs .container::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
  }

  .nav_breadcrumbs ul {
    padding: 0.75rem 1rem;
    white-space: nowrap;
    display: inline-flex;
    gap: 0.5rem;
    padding: 0;
    margin: 0;
    width: auto;
  }

  /* Event card improvements */
  .event-card {
    margin: 0 0 1rem 0;
    border-radius: 0;
  }

  /* Reorganize event header for better hierarchy */
  .event-header {
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
  }

  .lineup-info-header {
    margin: 0rem 1rem;
    align-items: start;
  }

  .lineup-info-header h2 {
    margin-top: 0px;
  }

  /* Move event info to top */
  .event-header .flex.items-center {
    order: -1;
    width: 100%;
    margin-bottom: 0.5rem;
  }

  .event-header .text-right {
    text-align: left;
  }

  /* Control group spacing */
  .event-header .flex-shrink-0 {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* Maximize space usage */
  .container {
    padding: 0;
  }

  .event-content {
    padding: 1rem 0;
  }

  /* Table improvements for mobile */
  .lineup-table-wrapper {
    position: relative;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .lineup-table {
    margin: 0.5rem 0;
    min-width: 100%;
    width: auto;
    border-radius: 0;
  }

  /* Optimize table columns for mobile */
  .lineup-table th,
  .lineup-table td {
    padding: 0.75rem;
    white-space: nowrap;
  }

  .lineup-table th:first-child,
  .lineup-table td:first-child {
    position: sticky;
    left: 0;
    background: #1a1a1a;
    z-index: 1;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
  }

  .lineup-table th:first-child {
    background: linear-gradient(180deg, #374151, #1f2937);
  }

  /* Fade indicator for scrollable table */
  .lineup-table-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(to right, transparent, rgba(26, 26, 26, 0.9));
    pointer-events: none;
  }

  /* Quick links panel improvements */
  .side-panel {
    width: 100%;
    right: -100%;
  }

  .quick-links-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  /* Selection controls */
  .select-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    width: 100%;
  }

  .select-wrapper {
    width: 100%;
  }

  .select-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
      0 2px 4px -1px rgba(0, 0, 0, 0.06);
    max-height: 40vh;
    overflow-y: auto;
    z-index: 160;
    /* Higher than active wrapper */
  }

  /* Ensure first select's menu appears above second select */
  .select-wrapper:first-child.active .select-menu {
    z-index: 165;
  }

  /* Force breadcrumb container to full width */
  .nav_breadcrumbs .container {
    width: 100vw;
    margin: 0;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Add fade indicators for breadcrumb scrolling */
  .nav_breadcrumbs::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 24px;
    background: linear-gradient(to right, transparent, #101010);
    pointer-events: none;
  }

  .nav_breadcrumbs::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 24px;
    background: linear-gradient(to left, transparent, #101010);
    pointer-events: none;
    z-index: 10;
  }

  .hero_title h1 {
    text-align: left;
  }

  .season-button {
    width: fit-content;
  }
}

/* Very small screen optimizations */
@media (max-width: 375px) {
  .select-container {
    width: 160px !important;
    max-width: 160px !important;
    border: 2px solid blue !important;
    /* Debugging visibility */
  }

  .hero_title h1 {
    font-size: 1.25rem;
  }

  .event-header h3 {
    font-size: 1.125rem;
  }

  .btn {
    height: 36px;
    font-size: 0.875rem;
  }

  .select-wrapper {
    min-width: 160px;
  }

  .lineup-info-header {
    margin: 0rem 1rem;
    align-items: start;
  }

  .lineup-info-header h2 {
    margin-top: 0px;
  }
}

/* Apply to select-wrapper and buttons */
.select-wrapper,
.btn {
  width: 160px;
  /* Match the desired fixed width for mobile */
  max-width: 160px;
  flex: 0 0 160px;
  /* Prevent flex items from stretching */
}

.custom-select {
  width: 160px;
  /* Match the desired fixed width for mobile */
  max-width: 160px;
  flex: 0 0 160px;

}

a.event-link-image {
  margin-left: auto;
}

@media (min-width: 768px) {

  .select-wrapper,
  .btn {
    width: 200px;
    /* Match the desired fixed width for mobile */
    max-width: 200px;
    flex: 0 0 200px;
    /* Prevent flex items from stretching */
  }

  .custom-select {
    width: 200px;
    /* Match the desired fixed width for mobile */
    max-width: 200px;
    flex: 0 0 200px;

  }

  .custom-select,
  .select-wrapper,
  .btn {
    width: 100%;
    /* Allow items to grow evenly */
  }
}

/* Hover state for non-touch devices only */
@media (hover: hover) {
  .select-wrapper:hover .select-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }
}


/* Add to style.css */
.results-table tr.podium-1 {
  background: rgba(255, 215, 0, 0.1);
}

.results-table tr.podium-2 {
  background: rgba(192, 192, 192, 0.1);
}

.results-table tr.podium-3 {
  background: rgba(205, 127, 50, 0.1);
}

.results-table tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

.podium-1 td {
  background-color: rgba(255, 215, 0, 0.1);
}

.podium-2 td {
  background-color: rgba(192, 192, 192, 0.1);
}

.podium-3 td {
  background-color: rgba(205, 127, 50, 0.1);
}

.gap-cell {
  font-style: italic;
  color: #666;
}

.results-table td {
  padding: 0.75rem 1rem;
  border-top: 1px solid #333;
}

/* Add to style.css */
.points-grid,
.points-standings {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeSlideUp 0.3s ease forwards;
}

@keyframes fadeSlideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Shimmer effect for loading state */
.loading-shimmer {
  background: linear-gradient(90deg,
      rgba(255, 255, 255, 0.02),
      rgba(255, 255, 255, 0.1),
      rgba(255, 255, 255, 0.02));
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}


/* More refined table styling */
.points-grid table,
.points-standings table {
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid #1f2937;
}

.points-standings table {
  width: 100%;
}

.points-standings th {
  text-align: left;
  font-weight: bold;
}

.points-grid th,
.points-standings th {
  background: linear-gradient(to bottom, #1f2937, #111827);
  color: #d1d5db;
  font-weight: 800;
  padding: 1rem 1rem;
}

table th,
table td {
  padding: 0.5rem 0.625rem;
  text-align: left;
  vertical-align: middle;
}

table td {
  font-weight: 600;
}

.points-grid th:first-child {
  border-top-left-radius: 0.5rem;
}

.points-grid th:last-child {
  border-top-right-radius: 0.5rem;
}

/* Alternating row colors with hover */
.points-grid tr:nth-child(even),
.points-standings tr:nth-child(even) {
  background-color: rgba(17, 24, 39, 0.5);
}

.points-grid tr:hover,
.points-standings tr:hover {
  background-color: rgba(30, 58, 138, 0.2);
  transition: colors 150ms ease;
}

/* Better mobile table handling */
@media (max-width: 768px) {

  .points-grid,
  .points-standings {
    margin-left: -1rem;
    margin-right: -1rem;
  }

  .points-grid td,
  .points-standings td {
    white-space: nowrap;
  }

  .points-grid td:first-child,
  .points-standings td:first-child {
    position: sticky;
    left: 0;
    background-color: #111827;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 10;
  }
}

/* Add subtle animations */
.points-grid td,
.points-standings td {
  transition: colors 150ms ease;
}

/* Podium highlighting */
tr[data-position="1"] td {
  background-color: rgba(161, 98, 7, 0.2);
}

tr[data-position="2"] td {
  background-color: rgba(156, 163, 175, 0.1);
}

tr[data-position="3"] td {
  background-color: rgba(154, 52, 18, 0.2);
}

/* Add tooltips for truncated content */
td[data-full-text] {
  position: relative;
  cursor: help;
}

td[data-full-text]:hover::after {
  content: attr(data-full-text);
  position: absolute;
  left: 0;
  top: -3rem;
  background-color: #111827;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  z-index: 50;
  white-space: normal;
  max-width: 20rem;
}

.timing-details {
  transition: all 0.2s ease-in-out;
}

.timing-details:not(.hidden) {
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Ensure hover state remains when hovering details */
.has-timing:hover+.timing-details:not(.hidden),
.timing-details:not(.hidden):hover {
  background-color: rgba(31, 41, 55, 0.5);
}

.loading-state .skeleton-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
}

.loading-state .existing-content {
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.animate-spin {
  animation: spin 1s linear infinite;
}


@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Enhance the loading spinner */

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 0;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(59, 130, 246, 0.1);
  border-radius: 50%;
  border-left-color: #3b82f6;
  animation: spin 1s linear infinite;
}

.points-content-transition {
  transition: opacity 0.3s ease;
}

.points-grid td.numeric,
.points-standings td.numeric {
  text-align: right;
}

.fade-in {
  opacity: 0;
  animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Replace the existing scrollbar CSS with this improved version */

/* Make the points-grid scroll horizontally */
.points-grid {
  overflow-x: auto;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE and Edge */
  position: relative;
  padding-bottom: 16px;
  /* Increased space for the custom scrollbar */
  margin-bottom: 30px;
  /* Add space below the grid for the scrollbar */
}

/* Hide the default scrollbar */
.points-grid::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari, Opera */
}

/* Custom sticky scrollbar container */
.sticky-scroll-container {
  position: fixed;
  /* Changed to fixed to ensure it stays at the bottom */
  bottom: 20px;
  /* Distance from bottom of viewport */
  left: 50%;
  /* Center horizontally */
  transform: translateX(-50%);
  /* Center adjustment */
  width: 80%;
  /* Not full width to avoid edges */
  max-width: 1000px;
  /* Maximum width */
  height: 20px;
  background: rgba(26, 26, 26, 0.9);
  /* Semi-transparent background */
  z-index: 50;
  padding: 8px 15px;
  border-radius: 20px;
  /* Rounded corners */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  /* Add blur effect for modern browsers */
  transition: opacity 0.3s ease;
}

/* Scrollbar track */
.sticky-scroll-track {
  position: relative;
  height: 8px;
  background: rgba(44, 44, 44, 0.6);
  border-radius: 4px;
  cursor: pointer;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  /* Subtle border */
}

/* Scrollbar thumb */
.sticky-scroll-thumb {
  position: absolute;
  height: 100%;
  background: #3b82f6;
  /* Blue color that matches your theme */
  border-radius: 4px;
  cursor: grab;
  transition: background-color 0.2s;
  box-shadow: 0 0 5px rgba(59, 130, 246, 0.5);
  /* Glow effect */
}

.sticky-scroll-thumb:hover,
.sticky-scroll-thumb:active {
  background: #60a5fa;
  /* Lighter blue on hover/active */
}

.sticky-scroll-thumb:active {
  cursor: grabbing;
  background: #93c5fd;
  /* Even lighter when actively dragging */
}

/* Prevent text selection during scrollbar drag */
body.no-select {
  user-select: none;
  cursor: grabbing;
}

/* Ensure the grid container has proper positioning */
#points-content {
  position: relative;
}

/* Add fade indicators on the sides to indicate scrollable content */
.points-grid.is-scrollable::before,
.points-grid.is-scrollable::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 20px;
  /* Leave space for scrollbar */
  width: 30px;
  pointer-events: none;
  z-index: 10;
  opacity: 0.8;
}

/* .points-grid.is-scrollable::before {
	left: 0;
	background: linear-gradient(to right, #1a1a1a, transparent);
} */

.points-grid.is-scrollable::after {
  right: 0;
  background: linear-gradient(to left, #1a1a1a, transparent);
}

/* Mobile optimization */
@media (max-width: 768px) {
  .sticky-scroll-container {
    width: 90%;
    /* Wider on mobile */
    bottom: 15px;
    /* Closer to bottom on mobile */
    padding: 6px 10px;
    /* Smaller padding */
  }

  /* Add padding to prevent content from being hidden behind fixed scrollbar */
  body {
    padding-bottom: 40px;
  }

  /* Make thumb easier to grab on mobile */
  .sticky-scroll-thumb {
    min-height: 12px;
    /* Taller for easier touch */
    top: -2px;
    /* Offset to center it */
  }
}

/* Add these styles to your style.css file */

/* Fix for mobile content being cut off on the left */
@media (max-width: 768px) {

  /* Add padding to container to prevent content from being cut off */
  #points-content {
    padding-left: 16px;
    padding-right: 16px;
    width: 100%;
    box-sizing: border-box;
  }

  /* Adjust the points grid container for mobile */
  .points-grid {
    margin-left: 0;
    margin-right: 0;
    padding-left: 8px;
    /* Give content some breathing room */
    box-sizing: border-box;
    width: 100%;
  }

  /* Ensure the content inside the grid isn't cut off */
  .points-grid table {
    min-width: calc(100% - 8px);
  }


  /* Ensure grid rows aren't truncated */
  .points-grid tr,
  .points-standings tr {
    width: 100%;
    display: table-row;
  }

  /* Prevent horizontal jumping when scrolling */
  .points-grid,
  .points-standings {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
  }

  /* Add an extra indicator for scrollable content */
  .points-grid::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0;
    width: 20px;
    height: 40px;
    background: linear-gradient(to left, rgba(26, 26, 26, 0.8), transparent);
    border-radius: 20px 0 0 20px;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 20;
    opacity: 0.8;
  }
}

/* Additional fix for very small screens */
@media (max-width: 375px) {
  #points-content {
    padding-left: 8px;
    overflow-x: hidden;
    /* Prevent horizontal page scroll */
  }

  .points-grid {
    margin-left: -8px;
    padding-left: 16px;
    /* Extra padding for very small screens */
  }

}

/* Fix for content snap-back after scrolling */
.points-grid {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* Prevent the elastic bounce effect in Safari */
  overscroll-behavior-x: none;
}

/* For Firefox and other browsers */
@supports (scrollbar-width: none) {
  .points-grid {
    scrollbar-width: none;
    overscroll-behavior-x: none;
    scroll-snap-type: none;
  }
}

/* For older iOS versions */
@supports (-webkit-overflow-scrolling: touch) {
  .points-grid {
    -webkit-overflow-scrolling: auto;
  }
}
