/* ===== Animações e Efeitos Visuais ===== */
.fade-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in-left.visible {
    opacity: 1;
    transform: none;
}
.logo img {
    margin-left: 22px;
}

/* ===== Tabela Resultado da Corrida ===== */
.tabela-scroll-wrapper {
    overflow-x: auto;
    position: relative;
}
.tabela-fixa th,
.tabela-fixa td {
    white-space: nowrap;
    vertical-align: middle;
    transition: background-color 0.3s ease;
}
.tabela-fixa th:first-child,
.tabela-fixa td:first-child {
    position: sticky;
    left: 0;
    z-index: 30;
    background: #f3f4f6;
    min-width: 48px;
    width: 48px;
}
.tabela-fixa th.foto-th,
.tabela-fixa td.foto-td {
    position: sticky;
    left: 48px;
    z-index: 20;
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    padding: 0.25rem;
}
.tabela-fixa td {
    font-size: 0.7rem;
}
.tabela-fixa td.foto-td {
    background-color: #FFFFFF;
}
.tabela-fixa th.foto-th {
    background-color: #f2f3f5;
}
.foto-piloto {
    width: 32px;
    height: 32px;
    border-radius: 9999px;
    object-fit: cover;
    display: block;
    margin: auto;
}
.tabela-fixa th div {
    min-height: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.tabela-fixa th span.invisible {
    visibility: hidden;
    display: block;
    height: 1em;
}
th.sortable:hover {
    cursor: pointer;
    background-color: #e5e7eb;
}
th.sortable.asc::after {
    content: " \2191";
    font-size: 0.75rem;
}
th.sortable.desc::after {
    content: " \2193";
    font-size: 0.75rem;
}
th.sortable {
    position: relative;
}
th.sortable .tooltip {
    display: block;
    position: absolute;
    bottom: -1.75rem;
    left: 50%;
    transform: translateX(-50%);
    background: #fb5d01;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    z-index: 9999;
    pointer-events: none;
}
th.sortable:hover .tooltip {
    display: block;
}
.melhor-volta-highlight {
    animation: pulseMelhorVolta 1.5s infinite;
}
@keyframes pulseMelhorVolta {
    0% { background-color: #fefcbf; }
    50% { background-color: #fde68a; }
    100% { background-color: #fefcbf; }
}

/* ===== Traçado do Circuito ===== */
.tracado-container {
    cursor: zoom-in;
    transition: transform 0.3s ease;
}
.tracado-container:hover {
    transform: scale(1.08);
}
#modalTracado .modal-body {
    background-color: #f9f9f9;
    padding: 1rem;
    text-align: center;
}

/* ===== Pódio ===== */
.podia-piloto-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 0.25rem;
}
.podia-bloco:hover {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

@media (max-width: 1023px) {
    .-rotate-90 {
        --tw-rotate: -90deg;
        padding-left: 50px;
        font-size: 0.8rem;
        font-weight: 500;
    }

}

@media (min-width: 1023px) {
    .-rotate-90 {
        font-size: 1rem;
        font-weight: 500;
        padding-bottom: 10px;
    }

}

/* ===== Patrocinadores ===== */
.patrocinador-logo-master,
.patrocinador-logo {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: block;
    object-fit: contain;
}
.patrocinador-logo-master {
    max-width: 100%;
}
.patrocinador-card-master {
    background: white;
    border-radius: 0.5rem;
    padding: 0.5rem;
    width: 14rem;
    height: 8rem;
    display: block;
    justify-content: center;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.patrocinador-card-master:hover .patrocinador-logo-master {
    transform: scale(1.20);
}
.patrocinador-card-master:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}
.patrocinador-card {
    background: white;
    border-radius: 0.5rem;
    padding: 0.5rem;
    width: 6rem;
    height: 4rem;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.patrocinador-card:hover .patrocinador-logo {
    transform: scale(1.20);
}
.patrocinador-card:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* ===== Zoom em Fotos ===== */
.foto-zoom {
    transition: transform 0.3s ease;
}
.foto-zoom:hover {
    transform: scale(1.1);
}

/* ===== Tooltip Ultrapassagens ===== */
#tooltipUltrapassagens {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 999999;
    white-space: nowrap;
}

/* ===== Tabela e Indicadores ===== */
.table th, .table td {
    vertical-align: middle;
}
.tooltip-icon {
    color: #007bff;
    margin-left: 5px;
    cursor: pointer;
}
.var-rapida { color: green; font-weight: bold; }
.var-media { color: blue; font-weight: bold; }
.var-lenta { color: red; font-weight: bold; }
.var-ignorada { color: gray; font-style: italic; }
.var-melhor {
    color: #000;
    font-weight: bold;
}

/* ===== Modal Customizado ===== */
.modal-content {
    border-radius: 12px;
}
.modal {
    z-index: 999999;
}
.modal-header {
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    z-index: 9999;
}
.modal-title {
    font-weight: bold;
    text-align: center;
}
.modal-footer {
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}
.table {
    font-size: 14px;
    margin-bottom: 0;
}
.table th {
    background: #343a40;
    color: white;
}
.table tbody td,
.table thead th {
    vertical-align: middle;
    font-size: 0.8rem;
}

/* ===== Tooltip Voltas e Gráfico ===== */
#tooltipVoltas {
    position: fixed !important;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    z-index: 99999;
    white-space: nowrap;
}
.highlight {
    stroke-width: 5 !important;
    opacity: 1 !important;
}
.dim {
    opacity: 0.1;
}
.controls {
    margin: 10px;
}
.controls button {
    padding: 5px 10px;
    margin: 0 5px;
    color: #fff;
    border: none;
    cursor: pointer;
}
.dot {
    opacity: 0;
    pointer-events: all;
    cursor: pointer;
}
.dot:hover {
    opacity: 1 !important;
}
.driver-label {
    font-size: 10px;
    fill: #ccc;
    cursor: pointer;
}

/* ===== Gráfico Tempos ===== */
#chartTempos {
    width: 100%;
    height: 600px;
    display: block;
    background: #f8f9fa;
    border-radius: 8px;
}
#tooltipTempos {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}
#legendTempos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}
#legendTempos label {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease-in-out;
}
#legendTempos label:hover {
    background: #d1d5db;
}
#legendTempos input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}
#clear-tempos, #top6-tempos {
    background: #374151;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease-in-out;
}
#clear-tempos:hover, #top6-tempos:hover {
    background: #1f2937;
}
