/* General Styling */
body {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  background-color: #f0f4f8;
  color: #2c3e50;
}

/* Hero Body Styling */
.hero .hero-body {
  padding: 1.5rem; /* Reduce padding for a smaller appearance */
  height: 200px; /* Adjust height as needed */
  display: flex;
  align-items: center; /* Center the content vertically */
  justify-content: center; /* Center the content horizontally */
}

/* Hero Section */
.hero.is-dark {
  background: linear-gradient(135deg, #283c86, #45a247);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.hero .title {
  font-weight: 900;
  color: #fff;
}

.hero .subtitle {
  color: #f5f5f5;
  font-size: 1.3rem;
}

/* Navbar Styling */
.navbar {
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
  background-color: #ffffff;
}

.navbar-item:hover {
  background-color: #f0f4f8;
  color: #4a90e2;
  transition: background 0.3s ease;
}

/* Podium Container */
.podium-container {
  display: flex; /* Use flexbox to arrange items in a row */
  justify-content: center; /* Center the podiums horizontally */
  align-items: flex-end; /* Align items to the bottom for staggered heights */
  gap: 15px; /* Add spacing between podiums */
  margin-top: 20px; /* Add some spacing above the podiums */
}

/* Podium Place */
.podium-place {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  width: 120px; /* Adjusted width for better spacing */
  padding: 10px;
  border-radius: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  text-align: center;
  word-wrap: break-word;
  overflow: hidden;
  box-sizing: border-box;
}

/* Gold, Silver, and Bronze Heights */
.gold {
  background: linear-gradient(135deg, #ffd700, #ffb400);
  height: 200px;
}

.silver {
  background: linear-gradient(135deg, #c0c0c0, #d4d4d4);
  height: 180px;
}

.bronze {
  background: linear-gradient(135deg, #cd7f32, #d5a076);
  height: 160px;
}

/* Podium Text */
.podium-position {
  font-size: 1.2em;
  font-weight: bold;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.driver-name {
  font-size: 1em;
  margin-top: 5px;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.constructor-name {
  font-size: 0.9em;
  margin-top: 3px;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 2px 4px;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.1);
}

/* Hover Effect for Podium Places */
.podium-place:hover {
  transform: translateY(-12px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

/* Podium Base */
.podium-base {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 20px;
  background: #4a90e2;
  border-radius: 0 0 12px 12px;
}

/* Results Container Styling */
#results-container {
  padding: 20px;
}

#results-container .columns {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

#results-container .column {
  flex: 1 1 calc(50% - 10px);
  max-width: 48%;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.1);
  padding: 15px;
  overflow-x: auto;
}

/* Table Styling */
#results-container table {
  background: #fefefe;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.1);
  width: 100%;
  table-layout: auto;
  font-size: 0.8rem;
}

#results-container th,
#results-container td {
  padding: 8px;
  text-align: center;
  font-size: 0.8rem;
  border-bottom: 1px solid #f0f0f0;
  white-space: nowrap;
}

#results-container th {
  background: #4a90e2;
  color: white;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

#results-container th:hover {
  background: #357abf;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#results-container td {
  text-overflow: ellipsis;
  overflow: hidden;
}

#results-container .column table {
  margin-bottom: 15px;
}

/* Modal Styling */
.modal .box {
  background-color: #1e1e2f; /* Dark background for the modal */
  border-radius: 12px;
  padding: 25px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.5);
  color: #e0e0e0; /* Light text color for readability */
}

/* Text Styling in Modals */
.modal .box p{
  color: #ffffff; /* White text for readability */
}
.modal .box h3,
.modal .box h4,
.modal .box span {
  color: #ffffff; /* White text for readability */
}

/* Table Styling in Modals */
.modal .box table {
  width: 100%; /* Full width */
  background-color: #2c2c3c; /* Dark table background */
  color: #ffffff; /* White text for table content */
  border-collapse: collapse; /* Remove gaps between table cells */
  border: 1px solid #444; /* Subtle border for table */
  border-radius: 8px; /* Rounded corners for table */
  margin-top: 20px; /* Add spacing above the table */
}

.modal .box table th,
.modal .box table td {
  padding: 12px; /* Add padding inside table cells */
  text-align: center; /* Center align text */
  border: 1px solid #444; /* Border for table cells */
}

.modal .box table th {
  background-color: #eaf3ef; /* Slightly darker header background */
  font-weight: bold; /* Bold font for headers */
  text-transform: uppercase; /* Uppercase headers */
}

.modal .box table td {
  background-color: #2c2c3c; /* Same as table background for consistency */
}

.modal .box table tr:nth-child(even) td {
  background-color: #343446; /* Slightly lighter background for alternating rows */
}

/* Button Styling in Modals */
.modal .box button {
  background-color: #4a90e2; /* Primary button color */
  color: #ffffff; /* White text */
  border: none;
  border-radius: 6px;
  padding: 10px 15px;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.modal .box button:hover {
  background-color: #357abf; /* Darker shade for hover effect */
  transform: translateY(-2px);
}

/* Responsive Design for Podiums */
@media screen and (max-width: 768px) {
  .podium-container {
    flex-direction: column;
    gap: 10px;
  }

  .podium-place {
    width: 80%;
    height: auto;
  }
}

#race-view {
  display: none;
}

.visible {
  display: block !important;
}

.hidden {
  display: none !important;
}

/* Loading Spinner */
#loading-spinner {
  display: none;
  border: 8px solid #f3f3f3;
  border-top: 8px solid #4a90e2;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

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

#racedetails {
  max-height: 300px; /* Set a maximum height for the content */
  overflow-y: auto; /* Enable vertical scrolling */
  scrollbar-width: thin; /* For Firefox: thin scrollbar */
  scrollbar-color: #4a90e2 #f0f4f8; /* For Firefox: scrollbar color */
}

/* Optional: Styling for WebKit-based browsers (Chrome, Edge, Safari) */
#racedetails::-webkit-scrollbar {
  width: 8px; /* Set width of the scrollbar */
}

#racedetails::-webkit-scrollbar-thumb {
  background-color: #4a90e2; /* Scrollbar thumb color */
  border-radius: 4px; /* Rounded edges for the scrollbar thumb */
}

#racedetails::-webkit-scrollbar-track {
  background: #f0f4f8; /* Scrollbar track color */
}

/* Circuit Modal Styling */
#circuit-modal .box {
  background-color: #1e1e2f; /* Dark background for the modal */
  border-radius: 12px;
  padding: 20px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.5);
  color: #e0e0e0; /* Light text for readability */
}

/* Modal Header Styling */
#circuit-modal .title {
  color: #ffffff; /* White text for the circuit name */
  margin-bottom: 10px;
}

/* Circuit Image Styling */
#circuit-modal figure.image {
  margin: 0 auto; /* Center the image */
  width: 70%; /* Reduce image size */
  max-width: 300px; /* Set a max width for larger screens */
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5); /* Add shadow for better aesthetics */
}

/* Circuit Details Styling */
#circuit-details {
  margin-top: 20px;
  padding: 10px;
  background-color: #2a2a3a; /* Slightly lighter dark background for contrast */
  border-radius: 8px;
}

#circuit-details p {
  color: #ffffff; /* White text for readability */
  margin-bottom: 10px;
  font-size: 1rem;
}

#circuit-details p strong {
  color: #4a90e2; /* Highlight key labels */
  font-weight: bold;
}

/* Circuit Website Link Styling */
#circuit-details span a {
  color: #4a90e2; /* Blue link color */
  text-decoration: underline;
}

#circuit-details span a:hover {
  color: #357abf; /* Slightly darker blue on hover */
}

/* Close Button Styling */
#close-circuit-modal {
  color: #ffffff; /* White close icon */
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.3s ease;
}

#close-circuit-modal:hover {
  color: #4a90e2; /* Change color on hover */
}

/* Responsive Design for Circuit Modal */
@media screen and (max-width: 768px) {
  #circuit-modal figure.image {
    width: 90%; /* Increase size for smaller screens */
  }

  #circuit-details {
    font-size: 0.9rem; /* Reduce font size slightly */
  }
}
