:root {
  --header-bg-color: #e60000;
  --header-text-color: #ffffff;
  --body-bg-color: #f4f4f4;
  --tab-active-bg-color: #990000;
  --button-bg-color: #e60000;
  --button-text-color: #ffffff;
  --button-hover-bg-color: #990000;
  --loading-spinner-color: #e60000;
  --table-bg-color: #ffffff;
  --light-divider-color: #dddddd;
  --table-border-color: #cccccc;
  --table-header-color: #eeeeee;
  --table-stripe-color: #f8f8f8;
  --modal-bg-color: #ffffff;
  --info-link-color: #ff6666;
  --text-color: #000000;
  --select-bg-color: #ffffff;
  --select-text-color: #000000;
  --select-border-color: #cccccc;
  --prediction-section-header-color: rgba(255, 77, 77, 0.9);
  --link-color: #e60000;
}

html {
  box-sizing: border-box;
}

*,
*:before,
*:after {
  box-sizing: inherit;
}

a {
  color: var(--link-color);
  text-decoration: none;
}

input,
button,
select {
  font-family: inherit;
  font-size: inherit;
}

body {
  margin: 0;
  font-family: Helvetica Neue, Roboto, sans-serif;
  color: var(--text-color);
  background-color: var(--body-bg-color);
  font-weight: 200;
}

.header-container {
  position: sticky;
  top: 0;
  background-color: var(--header-bg-color);
  color: #fff;
  z-index: 10000;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
}

header h1, header h2 {
  margin: 0;
  font-weight: light;
}

#header-initials-circle {
  border-radius: 50%;
  background-color: var(--tab-active-bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: medium;
  font-weight: normal;
  text-transform: uppercase;
  padding: 13px;
  cursor: pointer;
  min-width: 1px;
  min-height: 1px;
  aspect-ratio: 1 / 1;
}

.header-icon {
  width: 40px;
  height: 40px;
  margin-right: 10px;
}

h1 {
  margin: 0; 
}

nav {
  display: flex;
  justify-content: space-around;
}

.tab {
  flex: 1;
  padding: 10px;
  cursor: pointer;
  text-align: center;
  font-weight: 300;
}

.tab.active {
  border-bottom: 5px solid var(--tab-active-bg-color);
  font-weight: 800;
  font-size: larger;
}

#main-container {
  padding-bottom: 100px;
  overflow-y: auto;
  overflow-x: auto;
}

.section {
  padding: 20px;
}

#auth-container {
  padding: 20px;
}

button {
  background-color: var(--button-bg-color);
  color: #fff;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 5px;
  margin-top: 10px;
}

button:hover {
  background-color: var(--button-hover-bg-color);
}

input {
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  border-radius: 5px;
  border: 1px solid #ccc;
}

select {
  padding: 5px;
  border-radius: 5px;
  margin: 5px;
  width: 100%;
  background-color: var(--select-bg-color);
  color: var(--select-text-color);
  border: 1px solid var(--select-border-color);
}

select:disabled {
  opacity: 0.3;
}

.hidden {
  display: none !important;
}

.calendar-card {
  margin-bottom: 20px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 0px;
}

.calendar-card span {
  display: block;
  font-size: small;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: smaller;
}

.result-table th,
.result-table td {
  border: 1px solid #ddd;
  padding: 8px;
}

.result-table th {
  background-color: #f2f2f2;
  text-align: left;
}

#race-details span {
  display: block;
  font-size: small;
}

#race-details {
  margin-bottom: 20px;
  margin-left: 30px;
  margin-right: 30px;
  padding: 5px;
  border: 1px dashed #cccccc;
  text-align: center;
  border-radius: 5px;
}

#race-location {
  font-size: x-large;
  font-weight: bold;
}

#race-location-container {
  margin-bottom: 20px;
}

.loader {
  margin-top: 10px;
  border: 4px solid #f3f3f3;
  border-radius: 50%;
  border-top: 4px solid var(--loading-spinner-color);
  width: 30px;
  height: 30px;
  -webkit-animation: spin 0.5s linear infinite; /* Safari */
  animation: spin 0.5s linear infinite;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black */
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1rem;
  border-bottom: 1px solid #dee2e6;
  font-size: x-large;
  font-weight: bold;
}

.modal-body {
  padding: 1rem 1rem;
}

.modal-content {
  background-color: white;
  border-radius: 5px;
  box-shadow: 0 0px 20px 10px rgba(0, 0, 0, 0.4);
  z-index: 1001;
  max-width: 500px;
  width: 90%;
  color: #000000;
  position: relative;
}

.modal-close {
  cursor: pointer;
  font-size: xx-large;
  font-weight: normal;
  color: #888;
}

#point-system-modal .modal-body {
  font-size: x-small;
  font-weight: normal;
}

#loading-spinner {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  margin-top: -10px;
  line-height: 20px;
  text-align: center;
}

#page-loader {
  display: inline-block;
}

.scores-divider-title {
  margin-block-start: 0.5em;
  margin-block-end: 0.5em;
}

#leaderboard-table,
#round-results-table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--table-bg-color);
  margin-bottom: 20px;
  margin-top: 20px;
}

#leaderboard-table th,
#leaderboard-table td,
#round-results-table th,
#round-results-table td {
  text-align: left;
  border: 1px solid var(--table-border-color);
  padding: 8px;
}

#leaderboard-table th,
#round-results-table th {
  font-weight: bold;
  background-color: var(--table-header-color) !important;
}

#leaderboard-table > tr:nth-child(odd),
#round-results-table > tr:nth-child(odd) {
  background-color: var(--table-stripe-color);
}

#leaderboard-table > tr:nth-child(even),
#round-results-table > tr:nth-child(even) {
  background-color: var(--table-bg-color);
}

#error-modal-content,
#error-modal-content .modal-close {
  background-color: #cc3300;
  color: white;
}

#success-modal-content,
#success-modal-content .modal-close {
  background-color: #99cc33;
  color: black;
}

#auth-header h3 {
  margin: 10px;
}

#auth-header span {
  font-size: small;
}

.small-text {
  font-size: 0.7em;
}

.form-select {
  font-size: 0.8em;
}

.medium-text {
  font-size: 0.8em;
}

.legend {
  float: none;
  width: auto;
  margin: 0em;
  font-size: 0.9em;
  padding-left: 0.35em;
  padding-right: 0.35em;
  /* color: rgba(0,0,0, .55); */
  color: rgba(137, 168, 255, 0.9);
}

.prediction-divider-title {
  margin-block-start: 0.5em;
  margin-block-end: 0.5em;
}

.prediction-table {
  width: 100%;
  border-collapse: collapse;
}

.prediction-table-row-title {
  width: 25%;
}

.prediction-table-row-selection {
  width: 75%;
  padding-right: 1em;
}

.prediction-table-row-result {
  max-width: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  padding: 0px 16px;
  font-weight: bold;
}

.prediction-table-row-result-race {
  border-bottom: 1px solid var(--light-divider-color);
}

#pole-position-result,
#race-first-result,
#race-second-result,
#race-third-result,
#race-fastest-lap-result {
  padding-bottom: 6px;
}

#post-predictions-button {
  margin-top: 26px;
}

.green {
  color: green;
}

.red {
  color: red;
}

.info-link {
  border: none;
  background: none;
  color: var(--info-link-color);
  text-decoration: none;
  cursor: pointer;
}

.info-link:hover {
  border: none;
  background: none;
}

.scores-table-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-border-bottom {
  border-bottom: 1px solid rgba(137, 168, 255, 0.4);
}

.center {
  display: flex;
  flex-direction: column;
  text-align: center;
  align-items: center;
}

.flex-container {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.full-width {
  width: 100%;
}

.divider {
  flex: 1;
  margin-left: 10px;
}

.clickable {
  cursor: pointer;
}

@media (max-width: 600px) {
  nav {
    overflow-x: auto;
  }

  .tab {
    flex: 1;
  }

  #race-details {
    margin-bottom: 20px;
    margin-left: 0px;
    margin-right: 0px;
    padding: 5px;
    border-top: 1px dashed #cccccc;
    border-bottom: 1px dashed #cccccc;
    text-align: left;
  }
}

/* Safari */
@-webkit-keyframes spin {
  0% { -webkit-transform: rotate(0deg); }
  100% { -webkit-transform: rotate(360deg); }
}

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