/**
 * ChronoSat Components - Compatibilidade com sistema legado
 * Mantém classes W3.CSS e estilos ChronoSat originais
 */
@charset "UTF-8";

body {
    color: #fff !important;
    background-color: #000 !important;
    /* font-family:FordFont; /* Desabilitado fonte FORD */
    font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
}

/* ChronoSat specific classes */
.CS-table-all {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.CS-top-subtitle {
    width: 100%;
    min-height: 28px;
    margin-top: 6px;
    border-radius: 3px;
    color: white;
}



.CS-Header {
    color: #ffc107;
    background: #4d2e00 !important;
    position: sticky;
    top: 0;
    z-index: 5;
}

.CS-SubHeader {
    padding: 2px 5px !important;
    text-align: center;
    font-weight: bold;
    border: none;
    background: linear-gradient(.5deg, #111, #777, #666) !important;
    color: #ccc;
    text-shadow: 2px 2px 5px #000000;
    font-size: 1.5em;
}

.CS-time-stamp {    background: linear-gradient(135deg, goldenrod, #ff8c42) !important;
    /* display: flex; */
    align-items: center;
    color: #1a1a1a;
    padding: 2px 5px !important;
    text-align: center;
    font-weight: bold;
    border: none;
    width: 100%;
    display: inline-block;
}

.CS-ctrl-btns {
    display: inline-flex;
    gap: 13px;
    padding-left: 8px;
    font-size: 1.3em;
    left: 0;
    position: relative;
    margin-right: 20px;
}

.CS-ctrl-btns i {
    cursor: pointer;
    transition: color 0.3s ease;
    background: #1a1a1a;
    color: darkslategray;
    padding: 3px;
    border-radius: 4px;
}


.CS-nowrap {
    white-space: nowrap;
}

.CS-penalty {
    color: #ff4444;
    font-weight: bold;
}

.CS-bonus {
    color: dodgerblue;
    font-weight: bold;
}

.CS-total-time {
    color: #ffd700;
    font-weight: bold;
    font-size: 1.1em;
}

.CS-status {
    padding: 4px 8px;
    border-radius: 4px;
    background: #4CAF50;
    color: white;
    font-size: 0.9em;
    font-weight: bold;
}

/**
 * @brief Animação de rolldown para exibir elementos suavemente
 * @details Utiliza transição de altura para efeito de "rolldown" ao alternar visibilidade
 *
 * Para usar:
 * 1. Adicione a classe .CS-rolldown ao elemento que será exibido/ocultado.
 * 2. Ao mostrar, adicione também a classe .CS-rolldown--open.
 * 3. Remova .CS-rolldown--open para ocultar com animação reversa.
 */
.CS-rolldown {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(.4,0,.2,1), opacity 0.3s linear;
    will-change: max-height, opacity;
    display: block;
}

.CS-rolldown--open {
    max-height: 800px; /* Ajuste conforme conteúdo máximo esperado */
    opacity: 1;
    transition: max-height 0.5s cubic-bezier(.4,0,.2,1), opacity 0.3s linear;
}

.CS-details-box {
    background: #3a3a3a !important;
    border: solid #666 !important;
    border-width: 0 1px 1px 1px !important;
    border-radius: 0 0 8px 8px !important;
    padding: 12px !important;
    margin-top: 6px;
    box-shadow: 8px 10px 23px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    z-index: 10 !important;
    position: absolute !important;
    display: none;
    left: 10vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Font weight helpers */
.bfw-bold { font-weight: bold !important; }
.bfw-underline { text-decoration: underline !important; }
.bfw-hidden { display: none !important; }

/* Display helpers */
.w3-display-container {
    position: relative;
}

.w3-display-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

.pointerCursor {
    cursor: pointer;
}

/* Modalidade filters */
.CS-db1, .CS-db2, .CS-db3 {
    transition: opacity 0.3s ease;
}

.ModDisabled {
    opacity: 0.3;
    pointer-events: none;
}

/* Badges for SS selection */
.w3-badge {
    display: inline-block;
    padding: 2px 6px;
    margin: 1px;
    background: #666;
    color: white;
    border-radius: 3px;
    font-size: 0.8em;
    cursor: pointer;
    transition: background 0.3s ease;
}

.w3-badge:hover {
    background: goldenrod;
}

.SsDetailSelect {
    background: #555;
}

.SsDetailSelect:hover {
    background: goldenrod;
}

/* Carousel de patrocinadores */
.tinycarousel {
    margin: 10px 0;
    border-radius: 8px;
    overflow: hidden;
}

.tinycarousel .viewport {
    width: 100%;
    height: 100px;
    overflow: hidden;
    position: relative;
}

.tinycarousel .overview {
    list-style: none;
    margin: 0;
    padding: 0;
    position: absolute;
    left: 0;
    top: 0;
    height: 100px;
    display: flex;
    align-items: center;
}

.tinycarousel .overview li {
    display: block;
    float: left;
    margin-right: 10px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tinycarousel .overview li img {
    max-height: 70px;
    max-width: 120px;
    object-fit: contain;
    filter: brightness(0.9);
    transition: filter 0.3s ease;
}

.tinycarousel .overview li img:hover {
    filter: brightness(1.1);
}

/* Botões de controle */
.ResultsModButtons {
    padding: 5px 0px;
    margin: 2px;
    cursor: pointer;
}

.ResultsModButtons:hover {
    background: #555;
    border-color: #777;
}

.CS-page-title {
    font-weight: bold;
    flex: 1 1 auto; 
    text-align: left; 
    white-space: normal;
    color: white;
    /* font-family: "Times New Roman", Times, "Liberation Serif", "Nimbus Roman", "Georgia", serif; */
}

/* CatsBtns - botões de categoria */
.CS-CatsBtns {
    margin: 10px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.CS-CatsBtns span {
    padding: 4px 8px;
    background: #555;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s ease;
}

.CS-CatsBtns span:hover {
    background: lightsalmon;
}

.CS-print-logo {
    height: 74px; 
    margin-left: 20px; 
    object-fit: contain; 
    flex-shrink: 0;
    display: none;
}



@media (max-width:601px) {
    .tinycarousel {
        zoom: 50%;
    }
}

.CS-progress-bar-container {
    width: 100%;
    height: 3px;
    background: linear-gradient(135deg, goldenrod, #ff8c42) !important;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    position: relative;
}
.CS-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #c0c0c0 0%, #7080a0 100%);
    transition: width 0.4s ease;
    border-radius: 5px 0 0 5px;
}

/**
 * @brief Container para tabelas com scroll lateral em dispositivos móveis
 * @details Implementa overflow horizontal com scroll suave e indicadores visuais
 */
.CS-table-container {
    position: relative;
    overflow-x: auto;
    overflow-y: visible;
    width: 100%;
    /* Scroll suave em dispositivos iOS */
    -webkit-overflow-scrolling: touch;
    /* Personalização da scrollbar */
    scrollbar-width: thin;
    scrollbar-color: goldenrod #333;
    max-height: 70vh;
}

/**
 * @brief Personalização da scrollbar para navegadores WebKit
 */
.CS-table-container::-webkit-scrollbar {
    height: 8px;
}

.CS-table-container::-webkit-scrollbar-track {
    background: #333;
    border-radius: 4px;
}

.CS-table-container::-webkit-scrollbar-thumb {
    background: goldenrod;
    border-radius: 4px;
}

.CS-table-container::-webkit-scrollbar-thumb:hover {
    background: #b8860b;
}

/**
 * @brief Colunas fixas à esquerda (críticas)
 * @details Mantém posição e número sempre visíveis durante scroll horizontal
 */
.CS-table-sticky-left {
    position: sticky;
    left: 0;
    text-align: center !important;
    background: inherit;
    z-index: 4;
    /* Largura fixa para evitar sobreposição */
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    /* Sombra sutil para indicar separação */
}

/**
 * @brief Segunda coluna fixa (número do veículo)
 * @details Posicionada após a primeira coluna sticky
 */
.CS-table-sticky-left-2 {
    position: sticky;
    left: 80px; /* Exatamente a largura da primeira coluna */
    text-align: center !important;
    background: inherit;
    z-index: 3;
    /* Largura fixa para números de veículos */
    width: 75px;
    min-width: 75px;
    max-width: 75px;
}

.CS-table-sticky-left-3 {
    position: sticky;
    background: inherit;
    z-index: 2;
    left: 165px;
    align-items: center;
    display: inline-flex !important;
    /* box-shadow: 2px 0 5px rgba(0,0,0,0.4); */
}

.CS-crewfaces {
    align-items: center;
    height: 38px;
    display: inline-block;
    transition: height 0.8s ease;
}

.CS-crewfaces img {
    border-radius: 40%;
    object-fit: cover;
    margin-right: 5px;
    background-color: #321;
    max-height: 100%;
    width: auto;
}

.CS-penais {
    text-align: center !important;
}

.CS-total {
    text-align: right !important;
}


/**
 * @brief Colunas scrolláveis no meio da tabela
 */
.CS-scrollable-col {
    /* min-width: 120px; Largura mínima aumentada para colunas de piloto/SS */
    white-space: nowrap;
    align-content: center;
    line-height: 1.5;
}


/**
 * @brief Animação para indicador de scroll
 */
@keyframes CS-fadeInOut {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

/**
 * @brief Configurações responsivas para scroll lateral
 */
@media (max-width: 992px) {
    .CS-table-container {
        /* Força scroll se conteúdo exceder largura disponível */
        min-width: 100%;
    }
    
    /* .CS-table-all {
        /* Largura mínima que força scroll em telas pequenas */
        /* min-width: 900px; */
    /* } */
    
    /* Ajusta largura das colunas sticky em mobile */
    .CS-table-sticky-left {
        width: 70px;
        min-width: 70px;
        max-width: 70px;
    }
    
    .CS-table-sticky-left-2 {
        left: 70px; /* Ajuste correspondente */
        width: 75px;
        min-width: 75px;
        max-width: 75px;
    }
    
    .CS-table-sticky-left-3 {
        left: 145px; /* Exatamente a largura da primeira e segunda coluna */
    }
    
    /* Colunas scrolláveis menores em mobile */
    .CS-scrollable-col {
        min-width: 100px;
    }
}

@media (max-width: 768px) {
    /* Em telas muito pequenas, reduz ainda mais */

    .CS-table-container {
        max-height: 82vh;
    }
    .CS-table-sticky-left {
        width: 60px;
        min-width: 60px;
        max-width: 60px;
    }
    
    .CS-table-sticky-left-2 {
        left: 60px;
        width: 55px;
        min-width: 55px;
        max-width: 55px;
    }

    .CS-table-sticky-left-3 {
        left: 115px;
    }


    .CS-scrollable-col {
        min-width: 90px;
    }
    
    /* Reduz padding das células em mobile */
    .CS-table-container .CS-table-all td,
    .CS-table-container .CS-table-all th {
        padding: 4px 6px;
    }
}




@media (max-width: 340px) {

    .CS-table-sticky-left-3 {
        position: relative;
        left: inherit;
    }
}

/**
 * @brief em desktop
 */
@media (min-width: 840px) {
    /* .CS-table-container::after {
        display: none;
    } */

    .CS-table-sticky-left-3 {
        display: inline-flex !important;
    }

    .CS-crewfaces {
        height: 64px;
    }

    .CS-penais {
        position: sticky;
        right: 150px;
        background: inherit;
        z-index: 2;
        /* Largura fixa para números de veículos */
        width: 60px;
        min-width: 120px;
        max-width: 120px;
        box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    }

    .CS-total {
        padding-right: 15px !important;
        position: sticky;
        right: 0px;
        background: inherit;
        z-index: 3;
        /* Largura fixa para evitar sobreposição */
        width: 150px;
        min-width: 150px;
        max-width: 150px;
        /* Sombra sutil para indicar separação */
        box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    }
}





/**
 * @brief Melhora performance do scroll em dispositivos touch
 */
.CS-table-container {
    /* Acelera rendering do scroll */
    transform: translateZ(0);
    will-change: scroll-position;
}





.header-container {
    width: 100%;
}

.header-bar {
    width: 100%;
    height: 28px;
    background-color: #1A1A1A;
}

.header-content {
    display: flex;
    align-items: center;
    padding: 0 10px;
    height: 98px;
}

.logo-box {
    align-self: center;
    flex: 0 0 auto;
    margin-right: 20px;
    position: relative;
    z-index: 2;
}

.logo-box img {
    max-height: 148px; /* para ter overflow exato */
    object-fit: contain;
}
.title-box {
    flex: 1 1 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 200px;
    color: white;
    margin-top: -45px;
    line-height: 1.2;
}

.title-box .subtitle {
    font-size: 13px;
    font-weight: 300;
}

.title-box .title {
    font-size: 24px;
    font-weight: bold;
}

.title-box .description {
    font-size: 13px;
    padding-top: 4px;
}

.title-box .timestamp {
    font-size: 11px;
    padding-top: 4px;
}

.chronosat-box {
    flex: 0 0 auto;
    margin-left: auto;
}

.chronosat-box img {
    height: 74px;
    object-fit: contain;
}


.CS-signatures {
    display: inline-flex;
    margin-bottom: 20px;
    background-color: lightgray;
}

.CS-signature-group {
    display: inline-block;
    padding: 0 2px;
}

.CS-signature-title {
    background-color: goldenrod;
    color: black;
    text-align: center;
    font-weight: bold;
}

.CS-signature-img img{
    height: 10px;
}

.CS-signatures:hover img {
    height: 64px;
    transition: height 0.5s ease;
}



/* Responsivo: empilhar abaixo de 768px */
@media (max-width: 940px) {
    .header-content {
        /* flex-direction: column-reverse; */
        /* align-items: flex-start; */
        /* height: inherit; */
        zoom: 0.8;
    }

    .logo-box {
        margin-bottom: 10px;
    }

    .logo-box img {
        max-height: 120px; /* Ajuste para telas pequenas */
    }

    .title-box {
        margin-top: -39px;
    }

    .chronosat-box {
        margin-left: 0;
        margin-top: 10px;
        align-self: center;
        padding: 6px;
    }
    .chronosat-box img {
        height: 64px; /* Ajuste para telas pequenas */
    }

}


/* Responsivo: empilhar abaixo de 768px */
@media (max-width: 640px) {
    .header-content {
        flex-direction: column-reverse;
        align-items: flex-start;
        height: inherit;
        zoom: 0.6;

    }

    .logo-box {
        margin-right: 0;
    }

    .title-box {
        zoom: 1.3;
        text-align: center;
        align-self: center;
    }

    .chronosat-box {
        margin-top: 0;
        margin-bottom: 25px;
    }
}

/* Contêiner dos seletores */
.CS-page-controls {
    display: flex;
    justify-content: space-between;
    /* align-items: center; */
    flex-wrap: wrap;
    /* gap: 15px; */
    /* padding: 10px; */
    background: #1a1a1a;
}


/* Caixas individuais */
.CS-mod-selector-box,
.CS-stage-selector-box,
.CS-reload-control-box {
    padding: 10px 15px;
    border-radius: 5px;
    /* min-width: 220px; */
    display: flex;
    flex-direction: column;
    text-align: center;
    flex: 1
}
/* Alinhar à esquerda */
.CS-mod-selector-box {
    align-items: flex-start;
    text-align: left;
    flex: 1;
}

/* Centralizado */
.CS-stage-selector-box {
    align-items: center;
    text-align: center;
    flex: 1;
}

/* Alinhar à direita */
.CS-reload-control-box {
    display: flex;
    flex-direction: row; /* garante alinhamento horizontal */
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap; /* permite quebrar em telas pequenas, se necessário */
    gap: 10px;
    flex: 1;
    color: goldenrod;
    padding: 0 10px;
    min-width: fit-content;
}


/* Responsivo: abaixo de 768px, empilhar e centralizar */
@media (max-width: 768px) {
    .CS-page-controls {
        /* flex-direction: column; */
        align-items: center;
    }

    .CS-mod-selector-box,
    .CS-stage-selector-box,
    .CS-reload-control-box {
        align-items: center !important;
        text-align: center !important;
        justify-content: center;
    }

    .CS-reload-control-box {
        justify-content: center !important;
    }
    
    /* .CS-page-controls > div {
        margin-top: 10px;
    } */
    

    .CS-CarNr {
        font-size: 1.3em;
    }

}

.CS-subtable-text {
    position: relative;
    /* bottom: 5px; */
    right: 10px;
    font-size: 11px;
    color: yellow;
    pointer-events: none;
    animation: CS-fadeInOut 4s infinite;
    z-index: 1;
    text-align: center;
    background: #1a1a1a;
}

.CS-selectboxes {
    margin-right: 30px;
    background-color: goldenrod;
    color: black;
    border: none;
    margin: 4px;
    font-weight: bold;
    border: 2px solid #1a1a1a;
    display: inline-block;
    max-width: 70%;
}

.usage-tip-splits {
    position: absolute;
    background: chocolate;
    color: #1a1a1a;
    padding: 10px;
    border: 2px solid #1a1a1a;
    border-radius: 16px;
    box-shadow: 0 0 0 5px goldenrod;
    margin: -19px 105px;
    font-size: 1.4em;
    transition: width 1s ease;
    display: block;
    z-index: 100;
}

.CS-splits-display {
    display: block;
}

.CS-diff-display {
    display: none;
}

.CS-speed {
    font-weight: normal;
    font-style: italic;
}

/**
 * @brief Caixa de diálogo informativa ChronoSat
 * @details Exibe informações em destaque com estilo modal centralizado
 */
.CS-info-dialog-box {
    display: none;
    max-height: 0;
    transition: max-height 0.3s ease;
    z-index: 999;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 95vw;
    height: 90vh;
    max-width: 600px;
    max-height: 0px;
    background: #222;
    color: #fff;
    border: 4px solid #ff6b35;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.7);
    overflow-y: auto;
    word-wrap: break-word;
    padding: 24px 18px 18px 18px;
    font-size: 1.1em;
}

/**
 * @brief Botão de fechar para caixa de diálogo ChronoSat
 * @details Posiciona o botão no canto superior direito, com alinhamento centralizado
 */
.CS-dialog-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/**
 * @brief Estilização do ícone de fechar dentro do botão de diálogo
 * @details Garante tamanho e posicionamento corretos para o span do ícone
 */
.CS-dialog-close-btn span {
    display: block;
    width: 24px;
    height: 24px;
    position: relative;
}

/**
 * @brief Estilização das barras do ícone "X" de fechar
 * @details Cada span representa uma barra do "X", posicionadas e rotacionadas para formar o ícone
 */
.CS-dialog-close-btn span > span {
    position: absolute;
    left: 0;
    top: 11px;
    width: 24px;
    height: 2.5px;
    background: #ff6b35;
    border-radius: 2px;
}

/* Rotaciona as barras para formar o "X" */
.CS-dialog-close-btn span > span:first-child {
    transform: rotate(45deg);
}

.CS-dialog-close-btn span > span:last-child {
    transform: rotate(-45deg);
}

.CS-crew-face-img {
    height: 120px;
    margin: 2px;
    border-radius: 8px;
    box-shadow: 0 0 4px #333;
    /* background-color: darkslategray;
    background-image: url(../img/bg_grafico_640x640px_100_qualidade-v01.jpg); */
    background: linear-gradient(135deg, #444, #964) !important;
}



/* Camada escurecedora cobrindo todo o viewport com transição de opacidade */
.CS-fadeout-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;              /* Inicia oculta */
    align-items: center;        /* Centraliza verticalmente o ícone */
    justify-content: center;    /* Centraliza horizontalmente o ícone */
    opacity: 0;
    background: rgba(16, 15, 15, 0.8);
    transition: opacity 3s ease;
}

/* Ícone central com opacidade total */
.CS-fadeout-screen i {
    position: relative;
    z-index: 1;
    color: goldenrod;
    font-size: 64px;
}

.CS-footer {
    display: none;
    text-align: left;
}

.CS-credits {
    position: fixed;
    bottom: 0;
    line-height: 1;
    bottom: 0;
    left: 0;
    width: fit-content;
    background: #222;
    color: #ac6613;
    padding: 2px;
    text-align: center;
    font-size: 0.6em;
    z-index: 1000;
}


.CS-credits div {
    display: inline-block;
    text-align: left;
    margin: 0 5px;
    height: 0;
    overflow-y: auto;
    transition: height 2s ease;
}

.CS-credits:hover div {
    height: auto;
}