
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root{
    --primary-color: #e9e9e9;
    --secondary-color: #333333;
    --red-color: #E30713;
    --item-background: #202125b3;
    --item-borderradius: 12px;
} 

/* TEAM COLORS */
.team-bg-ferrari {
    background: #333333;
    background: linear-gradient(90deg, rgba(51, 51, 51, 1) 10%, rgba(237, 17, 49, 1) 100%);
}

.team-bg-mclaren {
background: #333333;
background: linear-gradient(90deg, rgba(51, 51, 51, 1) 10%, rgba(255, 128, 0, 1) 100%);
}

.team-bg-alpine {
    background: #333333;
    background: linear-gradient(90deg, rgba(51, 51, 51, 1) 10%, rgba(0, 80, 129, 1) 100%);
}

.team-bg-mercedes {
  background: #333333;
  background: linear-gradient(90deg, rgba(51, 51, 51, 1) 10%, rgb(33 201 173) 100% 100%);
}

.team-bg-redbull {
  background: #333333;
  background: linear-gradient(90deg, rgba(51, 51, 51, 1) 10%, rgba(54, 113, 198, 1) 100%);
}

.team-bg-williams {
  background: #333333;
  background: linear-gradient(90deg, rgba(51, 51, 51, 1) 10%, rgba(24, 104, 219, 1) 100%);
}

.team-bg-sauber {
  background: #333333;
  background: linear-gradient(90deg, rgba(51, 51, 51, 1) 10%, rgba(1, 192, 14, 1) 100%);
}

.team-bg-astonmartin {
  background: #333333;
  background: linear-gradient(90deg, rgba(51, 51, 51, 1) 10%, rgba(0, 122, 51, 1) 100%);
}

.team-bg-haas {
  background: #333333;
  background: linear-gradient(90deg, rgba(51, 51, 51, 1) 10%, rgba(184, 184, 184, 1) 100%);
}

.team-bg-rb {
  background: #333333;
  background: linear-gradient(90deg, rgba(51, 51, 51, 1) 10%, rgba(71, 129, 215, 1) 100%);
}

/* Teams */

.teams-wrapper{
    background-image: url(../img/bg4.webp);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    padding: 3.5rem 0rem;
}

.teams-container {
  max-width: 1200px;
  margin: 0 auto;
}

.teams-container h2{
    font-family: 'Formula1Bold', sans-serif;
    font-weight: 800;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.teams-container p {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 500;
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-bottom: 2rem;
}

.teams-list-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  width: 100%;
}

.team-card{
    width: calc(100% / 2 - 1rem);
    border-radius: var(--item-borderradius);    
    height: 275px;
    overflow: hidden;
    padding: 1rem;
    box-shadow: var(--item-shadow);
    cursor: pointer;
}
.team-header{
    display: flex; 
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
    height: 145px;
}

.team-header-info{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.team-header-info h3 {
    font-family: 'Formula1Bold', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.car-image{
    width: 75%;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
    padding-top: 8px;
}

.team-header-logo img {
    width: 45px;
    height: auto;
    margin-left: 1rem;
}

.team-drivers{
    display: flex;
    align-items: flex-start;
    border-top: 3px solid var(--primary-color);
}

.driver-card{
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
}

.driver-card h3{
    font-family: 'Formula1Bold', sans-serif;
    font-weight: 800;
    font-size: 0.8rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.driver-card h3 span {
    font-size: 1rem;
}

.driver-card img {
    width: 100px;
    height: auto;
     filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
}

/* ANIMATION */

.team-card {
  opacity: 0;
  transform: translateX(100px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.team-card.animate-in {
  opacity: 1;
  transform: translateX(0);
}

/* TEAMS POP UP */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10999;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background-color: #37383c;
  padding: 2rem;
  max-width: 1100px;
  width: 90%;
  border-radius: 12px;
  position: relative;
  animation: fadeIn 0.3s ease-in-out;
  color: var(--primary-color);
}

.close-btn {
  position: absolute;
  top: 0.5rem;
  right: 1rem;
  font-size: 2rem;
  cursor: pointer;
}

@keyframes fadeIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.team-body-popup{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.popup-body-flex{
  width: 60%;
  height: 410px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.team-drivers-popup{
    width: 40%;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
  justify-content: space-between;
      height: 410px;
}

.team-header-popup{
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem
}

.team-header-info h2{
  font-family: 'Formula1Bold', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--primary-color);
}

.team-header-info p{
  font-family: 'Formula1Bold', sans-serif;
  font-weight: 500;
  font-size: 1.1rem;
  color: var(--primary-color);
}

.team-info{
  display: flex;
  gap: 1.5rem;
}

.team-information{
  margin-top: 1rem;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 500;
  font-size: 1.2rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.team-stats, .team-details{
  font-family: 'Rajdhani', sans-serif;
  font-weight: 500;
  font-size: 1rem;
  color: var(--primary-color);
}

.team-drivers-popup p{
  font-family: 'Formula1Bold', sans-serif;
  font-weight: 500;
  font-size: 1.2rem;
  text-align: center;
}

.team-footer-popup{
  display: flex;
  margin-top: 2rem;
  align-items: center;
}

.team-drivers-popup img{
  width: 110px;
   filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
}

.team-footer-popup img{
  width: 500px;
  z-index: 100;
  margin-left: auto;
   filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
}

.driver-1{
  transform: scaleX(-1);
}

.team-logo {
  width: 100px;
  height: auto;
}

.team-details p span,
.team-stats p span {
  color: var(--team-color);
    font-weight: bold;
}

.red-line {
  width: 84%;
  height: 10px;
  background: linear-gradient(to right, rgba(255, 0, 0, 0) 0%, var(--team-color) 10%);
  position: absolute;
}

.team-header-info h2, .driver-title {
  color: var(--team-color);
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 1024px) {
  .equipos-container {
    max-width: 98vw;
    padding: 0 1rem;
  }
  .equipos-lista {
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .teams-container{
    width: 90%;
    margin: auto;
  }
  .teams-container h2{
    font-size: 2rem;
  }
  .teams-list-container{
    flex-direction: column;
  }
  .team-card{
    width: 100%;
  }
  .popup-body-flex{
    height: auto;
  }
  .equipos-container {
    max-width: 100vw;
    padding: 0 0.5rem;
  }
  .equipos-lista {
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
  }
  .equipo-item {
    width: 100%;
    margin-bottom: 1rem;
  }
  .equipos-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .modal-content {
    max-height: 90vh;
    overflow-y: auto;
  }
  .car-image{
    padding: 0;
  }
  .team-info{
    gap: 1rem;
  }
  .team-stats, .team-details{
    width: 50%;
  }
}

@media (max-width: 480px) {
  .equipos-container {
    padding: 0 0.2rem;
  }
  .driver-card{
    padding: 0;
  }
  .car-image{
    width: 100%;
    padding-top: 25px;
  }
  .equipo-item {
    margin-bottom: 0.5rem;
    padding: 0.5em 0.2em;
  }
  .team-body-popup{
    flex-direction: column;
  }
  .team-header-popup{
    flex-direction: column;
    align-items: flex-start;
  }
  .popup-body-flex{
    width: 100%;
    height: auto;
  }
  .team-logo{
    width: 50px;
  }
  .team-drivers-popup{
    width: 100%;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
  }
  .team-footer-popup img{
    width: 100%;
  }
  .red-line{
    left: -40px;
  }
  .team-header-info p{
    font-size: 1.2rem;
  }
  .team-drivers-popup img{
    width: 85px;
  }
  .team-drivers-popup{
    height: auto;
  }
  .team-footer-popup{
    margin-top: 2rem;
  }
}