
:root{
    --primary-color: #e9e9e9;
    --secondary-color: #333333;
    --red-color: #E30713;
    --item-background: #202125b3;
    --item-borderradius: 12px;
} 

.championship-section {
  background-image: url(../img/bg1.webp);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  color: var(--primary-color);
  padding: 3.5rem 0rem;
  font-family: "Formula1-Regular", sans-serif;
}

.championship-container {
  max-width: 1200px;
  margin: 0 auto;
}

.championship-container h2 {
    font-family: 'Formula1Bold', sans-serif;
    font-weight: 800;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.championship-container p {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 500;
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-bottom: 2rem;
}

/* Tablas */

.standings-container{
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}
.standings-wrapper {
  margin-bottom: 3rem;
  background: var(--item-background);
  border-radius: var(--item-borderradius);
  box-shadow: var(--item-shadow);
  padding-top: 1rem;
  height: fit-content;
}

.standings-wrapper h3 {
  font-family: 'Formula1Bold', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  text-transform: uppercase;
  padding-left: 1rem;
}

/* DRIVERS */
.pilots-standings{
  width: 55%;
}

.position{
  width: 3rem;
  
}

.driver{
  width: 15rem;
  display: flex;
  align-items: center;
}

.team{
  width: 12rem;
  display: flex;
  align-items: center;
}

.points{
  width: 5rem;
  text-align: center;
}

/* CONSTRUCTORS */
.constructors-standings{
  width: 40%;
}

.championship-position {
    width: 3rem;
} 

.championship-team {
  width: 55%;
  display: flex;
} 

.championship-points {
  width: 25%;
  text-align: center;
}

.flag-icon {
    width: 20px;
    height: auto;
    margin-right: 0.5rem;
    aspect-ratio: 1 / 1;
}

.team-icon {
  width: 22px;
  height: 22px;
  margin: 0 0.5rem;
  padding: 3px;
  border-radius: 100%;
  background: #333; /* por defecto */
}

.team-bg-ferrari {
  background-color: #ED1131;
}

.team-bg-mclaren {
  background-color: #FF8000;
}

.team-bg-alpine {
  background-color: #005081;
}

.team-bg-mercedes {
  background-color: #27F4D2;
}

.team-bg-redbull {
  background-color: #3671C6;
}

.team-bg-williams {
  background-color: #1868DB;
}

.team-bg-sauber {
  background-color: #01C00E;
}

.team-bg-astonmartin {
  background-color: #007A33;
}

.team-bg-haas {
  background-color: #ed1a3b;
}

.team-bg-rb {
  background-color: #4781D7;
}

.standings-flex-header,
.standings-row {
  display: flex;
  padding: 0.8rem;
  align-items: center;
  gap: 1rem;
}

.standings-row{
  font-family: 'Rajdhani', sans-serif;
  font-weight: 500;
  font-size: 1.1rem;
}

.standings-flex-header {
  color: var(--red-color);
  text-transform: uppercase;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: 'Rajdhani', sans-serif;
}

/* Comparador */

.compare-wrapper{
  margin-top: 2rem;
}

.compare-wrapper h3{
  font-family: 'Formula1Bold', sans-serif;
  font-weight: 800;
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 2rem;
  text-transform: uppercase;
}

.compare-wrapper p {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 500;
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-bottom: 2rem;
}

.compare-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.compare-item {
  background: var(--item-background);
  border-radius: var(--item-borderradius);
  box-shadow: var(--item-shadow);
  display: flex;
  width: 46%;
  padding: 1rem 0;
  gap: 0.5rem;
  height: 150px;
  overflow: hidden;
}

.compare-item ul {
  list-style: none;
  padding: 0;
}

.compare-item li {
  margin-bottom: 0.4rem;
}

.vs {
  font-size: 1rem;
  color: var(--primary-color);
  font-weight: bold;
  text-transform: uppercase;
  font-family: 'Orbitron', sans-serif;
}

.piloto-img {
  width: 200px;
  height: auto;
   filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
}

.piloto-info{
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
  font-weight: 700;
  font-family: "Formula1Bold", sans-serif;
  text-transform: uppercase;
  align-items: center;
  color: var(--primary-color);
}

.piloto-info h4{
  text-align: left;
  width: fit-content;
}

.piloto-details {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 500;
  font-size: 1.2rem;
}

.compare-selectors{
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  align-items: center;
}

.compare-selectors select {
  padding: 0.5rem;
  font-size: 1rem;
  background: var(--item-background);
  border-radius: var(--item-borderradius);
  box-shadow: var(--item-shadow);
  color: var(--primary-color);
  font-family: 'Orbitron', sans-serif;
  appearance: none; /* sacamos el estilo nativo */
  background-image: url('data:image/svg+xml;utf8,<svg fill="white" height="16" viewBox="0 0 24 24" width="16" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1rem;
  width: 250px;
}

.compare-box .vs{
  font-size: 2rem;
}

.compare-selectors select option {
  background-color: #15151F;
  color: var(--primary-color);
  font-size: 0.8rem;
  padding: 0.5rem;
}

.no-border-bottom{
  border-bottom: none;
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 1024px) {
  .posiciones-container {
    max-width: 98vw;
    padding: 0 1rem;
  }
  .tabla-posiciones {
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .championship-container h2{
    font-size: 1.8rem;
  }
  .piloto-info h4 {
    text-align: left;
    width: 180px;
}
  .championship-container{
    width: 90%;
  }
  .standings-container{
    flex-direction: column;
  }
  .pilots-standings, .constructors-standings{
    width: 100%;
  }
  .posiciones-container {
    max-width: 100vw;
    padding: 0 0.5rem;
  }
  .standings-flex-header, .standings-row{
    justify-content: center;
  }
  .tabla-posiciones {
    width: 100%;
    overflow-x: auto;
    display: block;
  }
  .tabla-posiciones table {
    width: 100%;
    min-width: 480px;
    border-collapse: collapse;
  }
  .tabla-posiciones th, .tabla-posiciones td {
    padding: 0.5em 0.3em;
    white-space: nowrap;
  }
  .compare-selectors{
    justify-content: center;
  }
  .compare-box{
    flex-direction: column;
    gap: 1.5rem;
  }
  .compare-item{
    width: 70%;
    height: 180px;
    gap: 1.5rem;
  }
  .piloto-details-container{
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .piloto-info{
    flex-direction: row;
  }
}

@media (max-width: 480px) {
  .championship-container p{
    font-size: 1.2rem;
  }
  .standings-wrapper h3{
    font-size: 1.5rem;
  }
  .compare-selectors {
    flex-direction: column;
  }
  .compare-item{
    width: 100%;
  }
  .piloto-info h4{
    width: 80%;
  }
  .position {
    width: 2rem;
  }
  .standings-flex-header, .standings-row{
    gap: 0.5rem;
  }
  .standings-row{
    font-size: 1rem;
  }
  .standings-flex-header{
    font-size: 1rem;
  }
  .posiciones-container {
    padding: 0 0.2rem;
  }
  .tabla-posiciones table {
    min-width: 320px;
  }
  .tabla-posiciones th, .tabla-posiciones td {
    padding: 0.3em 0.1em;
  }
  .compare-wrapper h3{
    font-size: 1.5rem;
  }
  .driver{
    width: 11rem;
  }
  .standings-wrapper{
    margin-bottom: 2rem;
  }
}