.team-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    align-items: center;
    justify-content: center;
    width: 82vw;
}

.team-page {
    display: flex;
    flex-direction: column;
    margin-right: auto;
    width: calc(100vw - 300px);
    margin-top: 20px;
    margin-left: 150px;
    margin-right: 150px;
    margin-bottom: 100px;
}

.team-name {
    font-family: 'Formula1';
    font-weight: 500;
    font-size: 2rem;
    color: white;
    text-align: center;
    padding: 10px;
}

.team-name p {
    font-family: 'Formula1';
    font-weight: 100;
    font-size: 1.25rem;
    color: white;
    text-align: left;
    margin: 0;
}

.number-flag {
    display: inline-block;
    color: white;
    margin-top: 15px;
    padding: 10px;
}

.driver-number {
    font-family: 'Formula1';
    font-weight: 100;
    font-size: 2.4rem;
    display: inline-block;
    color: white;
    margin: 0;
    margin-right: 5px;
}

.driver-flag {
    height: 30px;
    width: 40px;
    display: inline-block;
    color: white;
    border-radius: 10%;
    margin: 0;
}

.team-body {
    width: 82vw;
    display: flex;
    flex-direction: row;
    flex: 1;
    height: 120%;
}

.drivers-info {
    display: flex;
    flex-direction: row;
    flex: 1;
    height: 100%;
}

.teams-info {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
}

.key-block {
    display: flex;
    flex-direction: column;
    flex: 1;
    font-weight: 500;
    justify-content: space-between;
}

.value-block {
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
}

.key-block p,
.value-block p {
    font-family: 'Formula1';
    font-size: 1rem;
    color: white;
    margin: 0; 
    padding: 14px;
}

.profile p {
    font-family: 'Formula1';
    font-size: 1.5em;
    font-weight: 500;
    color: white;
}

.profile-desc {
    display: flex;
    flex-direction: column;
    flex: 1;
    font-family: 'Formula1';
    color: white;
    padding: 10px;
    border: 1px solid white;
    border-radius: 12px;
}

.profile-desc p {
    color: white;
    font-family: 'Montserrat';
    text-align: justify;
    text-align: left;
    font-weight: 400;
    font-size: 1.12rem;
    padding: 15px;
    margin: 0;
}

.driver-name {
    font-family: 'Formula1';
    color: white;
    font-size: 2rem;
    font-weight: 500;
    padding: 0;
    margin: 0;
}

.driver-name p {
    padding: 5px;
    margin: 0;
}

.driver-number {
    font-family: 'Formula1';
    color: white;
}

.driver-pic {
    height: 100%;
    width: 100%;
    height: auto;
    width: auto;
    background-size: contain; 
    background-position: center; 
    background-repeat: no-repeat;
    position: relative;
    border-radius: 2%;
    aspect-ratio: 1/1;
}

.driver-link {
    text-decoration: none;
    font-size: inherit;
}

.left-driver {
    margin-right: 10px;
}

.left-driver,
.right-driver {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
    flex-basis: 50%;
}

.logo-box {
    display: flex;
    flex: 1;
    background-color: white; /* Default background color */
    flex-direction: row;
    width: 100%;
    max-width: auto;
    max-height: 150px;
    justify-content: center;
    border-radius: 14px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    margin: 0px 10px;
    aspect-ratio: 1/1;
}

.rb-background {
    background-color: #1434CB; 
}

.aston-martin-background {
    background-color: #00665e;
}

.default-background {
    background-color: white;
}

.left-driver,
.right-driver {
    border: 1px solid white;
    border-radius: 12px;
    background-color: black;
    transition: background-color 0.3s;
}

.left-driver:hover,
.right-driver:hover {
    background-color: rgb(242, 242, 242);
}

.left-driver .driver-pic,
.right-driver .driver-pic {
    max-width: 100%;
    max-height: 100%;
    transition: transform 0.3s;
}

.left-driver:hover .driver-pic,
.right-driver:hover .driver-pic {
    transform: scale(1.1);
    overflow: hidden;
}

.left-driver:hover .driver-number,
.left-driver:hover .name-text,
.left-driver:hover .team-name p,
.right-driver:hover .driver-number,
.right-driver:hover .name-text,
.right-driver:hover .team-name p {
    color: black;
}

.data-block {
    display: flex;
    flex-direction: row;
    flex: 2;
}

.timeline {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.timeline-text p {
    font-family: 'Formula1';
    font-size: 1.5em;
    font-weight: 500;
    color: white;
}

.button-wrap {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.button-container {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    width: 100%;
}

.line {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    margin-bottom: 10px;
    z-index: 1;
}

.year-button-container {
    position: relative;
}

.btn {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    border: none;
    border-radius: 5px;
}

.btn-primary {
    font-family: 'Formula1';
    font-size: 1rem;
    padding: 10px;
    color: white; 
    border: none;
    border-radius: 5px;
    margin-bottom: 10px;
}

.btn-primary:hover {
    filter: brightness(0.75)
}

.btn-collapse {
    display: none;
    position: absolute;
    left: 0;
    width: 40vw;
}

.btn-collapse.show {
    display: block;
}

.card {
    background-color: #444;
    padding: 15px;
    border-radius: 5px;
    margin-top: 10px;
}

.card-body {
    color: white;
    font-family: 'Montserrat';
    text-align: justify;
    text-align: left;
    font-weight: 400;
    font-size: 0.85rem;
    padding: 15px;
    margin: 0;
}

@media (max-width: 768px) {
    .team-page {
        flex-direction: column; /* Stacks elements vertically on smaller screens */
    }

    .image-block,
    .stats-block {
        min-width: auto; /* Remove minimum width */
        margin-right: 0; /* Reset margin */
    }
}