* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Saira', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 500;
    background-color: #15151e;
    color: #ffffff;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #ffffff;
}

.drivers-list {
    padding: 10px;
}

.driver-row {
    border-bottom: 1px solid #2a2a3a;
    cursor: pointer;
    transition: background-color 0.2s;
}

.driver-content {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    transition: opacity 0.2s;
}

.driver-content.retired {
    opacity: 0.4;
}

.driver-row:hover {
    background-color: #2a2a3a;
}

.driver-row:last-child {
    border-bottom: none;
}

.driver-number {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    margin-right: 15px;
}

.driver-code {
    font-weight: 600;
    font-size: 1.1rem;
    margin-right: 20px;
    width: 50px;
}

.tyres-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

.tyre-badge {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.tyre-badge:hover {
    transform: scale(1.1);
}

.tyre-S {
    background-color: #ff1e1e;
    color: white;
}

.tyre-M {
    background-color: #ffd700;
    color: black;
}

.tyre-H {
    background-color: #ffffff;
    color: black;
}

.tyre-I {
    background-color: #00ff00;
    color: black;
}

.tyre-W {
    background-color: #4169e1;
    color: white;
}

/* Team colors for car numbers */
.team-mclaren {
    color: #ff8700;
}

.team-ferrari {
    color: #dc0000;
}

.team-redbull {
    color: #0600ef;
}

.team-mercedes {
    color: #00d2be;
}

.team-astonmartin {
    color: #006f62;
}

.team-alpine {
    color: #00b4ff;
}

.team-williams {
    color: #005aff;
}

.team-vcarb {
    color: #6b8ba4;
}

.team-kicksauber {
    color: #52e252;
}

.team-haas {
    color: #b6babd;
}

/* Modal team-specific styling */
.modal-content.team-mclaren {
    border-color: #ff8700;
}
.modal-content.team-mclaren h2 {
    color: #ff8700;
}
.modal-content.team-mclaren #pitOutBtn {
    background-color: #ff8700;
}

.modal-content.team-ferrari {
    border-color: #dc0000;
}
.modal-content.team-ferrari h2 {
    color: #dc0000;
}
.modal-content.team-ferrari #pitOutBtn {
    background-color: #dc0000;
}

.modal-content.team-redbull {
    border-color: #0600ef;
}
.modal-content.team-redbull h2 {
    color: #0600ef;
}
.modal-content.team-redbull #pitOutBtn {
    background-color: #0600ef;
}

.modal-content.team-mercedes {
    border-color: #00d2be;
}
.modal-content.team-mercedes h2 {
    color: #00d2be;
}
.modal-content.team-mercedes #pitOutBtn {
    background-color: #00d2be;
    color: black;
}

.modal-content.team-astonmartin {
    border-color: #006f62;
}
.modal-content.team-astonmartin h2 {
    color: #006f62;
}
.modal-content.team-astonmartin #pitOutBtn {
    background-color: #006f62;
}

.modal-content.team-alpine {
    border-color: #00b4ff;
}
.modal-content.team-alpine h2 {
    color: #00b4ff;
}
.modal-content.team-alpine #pitOutBtn {
    background-color: #00b4ff;
}

.modal-content.team-williams {
    border-color: #005aff;
}
.modal-content.team-williams h2 {
    color: #005aff;
}
.modal-content.team-williams #pitOutBtn {
    background-color: #005aff;
}

.modal-content.team-vcarb {
    border-color: #6b8ba4;
}
.modal-content.team-vcarb h2 {
    color: #6b8ba4;
}
.modal-content.team-vcarb #pitOutBtn {
    background-color: #6b8ba4;
}

.modal-content.team-kicksauber {
    border-color: #52e252;
}
.modal-content.team-kicksauber h2 {
    color: #52e252;
}
.modal-content.team-kicksauber #pitOutBtn {
    background-color: #52e252;
    color: black;
}

.modal-content.team-haas {
    border-color: #b6babd;
}
.modal-content.team-haas h2 {
    color: #b6babd;
}
.modal-content.team-haas #pitOutBtn {
    background-color: #b6babd;
    color: black;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #1e1e2e;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    border: 2px solid #e10600;
}

.modal-content h2 {
    color: #e10600;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.8rem;
    letter-spacing: 2px;
}

.driver-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    font-size: 2.2rem;
    font-weight: bold;
}

.modal-content .driver-number {
    width: auto;
    height: auto;
    margin: 0;
    font-size: 1.8rem;
}

.modal-content .driver-code {
    margin: 0;
    width: auto;
    font-size: 1.8rem;
    color: #ffffff;
}

.tyre-selection {
    margin-bottom: 25px;
}

.tyre-selection select {
    width: 100%;
    padding: 12px;
    font-size: 1.1rem;
    background-color: #2a2a3a;
    color: white;
    border: 1px solid #444;
    border-radius: 6px;
    cursor: pointer;
}

.modal-buttons {
    display: flex;
    gap: 15px;
}

.modal-buttons button {
    flex: 1;
    padding: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.modal-buttons button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#pitOutBtn {
    color: white;
}

#cancelBtn {
    background-color: #555;
    color: white;
}

.modal-buttons button:hover:not(:disabled) {
    opacity: 0.8;
}

/* Retire section */
.retire-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #333;
    text-align: center;
}

.retire-link {
    background: none;
    border: 1px solid #666;
    color: #999;
    padding: 8px 20px;
    font-size: 0.9rem;
    font-weight: normal;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Saira', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.retire-link:hover {
    border-color: #999;
    color: #ccc;
    background-color: rgba(255, 255, 255, 0.05);
}

/* Retired drivers styles */
.driver-row:hover .driver-content.retired {
    opacity: 0.5;
}

/* Retired tyre badges */
.tyre-badge.retired-tyre {
    opacity: 0.5;
}

.tyre-badge.retired-tyre:hover {
    cursor: default;
    transform: none;
}

/* OUT label for retired drivers */
.out-label {
    color: #888;
    font-size: 0.9rem;
    font-weight: bold;
    margin-left: 8px;
    align-self: center;
}

/* Disabled select */
select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Reset Button */
.reset-container {
    margin-top: 20px;
    text-align: center;
}

.reset-button {
    background-color: #ffffff;
    color: #15151e;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Saira', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
    letter-spacing: 1px;
}

.reset-button:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.reset-button:active {
    transform: scale(0.98);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }

    .driver-content {
        padding: 10px;
    }

    .driver-number {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .driver-code {
        font-size: 1rem;
        width: 45px;
    }

    .tyre-badge {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
}