/* Estilos base da tabela */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 14px;
}

/* Tamanhos fixos para colunas de posição e foto */
td.rank, th.rank {
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
}

td.photo, th.photo {
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    padding: 2px !important;
}

/* Tamanho mínimo para colunas de Run + Bomb */
th.run-bomb,
td.run-bomb {
    min-width: 100px !important;
    width: 100px !important;
    white-space: nowrap !important;
    padding: 4px 8px !important;
}

/* Alinhamento específico para células */
td.run-bomb {
    text-align: left !important;
}

th.run-bomb {
    text-align: center !important;
}

/* Ajuste para colunas de tentativas após Run + Bomb */
td:has(+ td.run-bomb) + td,
th:has(+ th.run-bomb) + th {
    padding-left: 12px !important;
}

/* Ajuste para células de scores */
td:not(.rank):not(.photo):not(.nome):not(.run-bomb):not(.final-score),
th:not(.rank):not(.photo):not(.nome):not(.run-bomb) {
    padding: 4px 10px !important;
    min-width: 70px !important;
}

/* Ajustes específicos para o final score */
td.final-score {
    min-width: 100px !important;
    width: 100px !important;
    white-space: nowrap !important;
    padding: 4px 8px !important;
    text-align: center !important;
}

.skater-photo {
    width: 50px !important;
    height: 50px !important;
    padding: 0.3em !important;
    border-radius: 50% !important;
    object-fit: cover;
    filter: grayscale(100%);
}

/* Estilos responsivos para telas pequenas */
@media screen and (max-width: 768px) {
    table {
        font-size: 12px;
    }
    
    th, td {
        padding: 4px !important;
    }
    
    /* Ajuste para células de scores em telas menores */
    td:not(.rank):not(.photo):not(.nome):not(.run-bomb):not(.final-score),
    th:not(.rank):not(.photo):not(.nome):not(.run-bomb) {
        padding: 4px 8px !important;
        min-width: 60px !important;
    }
    
    /* Ajuste para colunas de tentativas após Run + Bomb em telas menores */
    td:has(+ td.run-bomb) + td,
    th:has(+ th.run-bomb) + th {
        padding-left: 8px !important;
    }
    
    td.nome, th.nome {
        max-width: 100px;
        padding: 4px 8px !important;
    }
    
    td.run-bomb, th.run-bomb,
    td.final-score {
        padding: 4px 6px !important;
        font-size: 14px !important;
    }
    
    /* Ajuste para o badge de run + bomb */
    .badge-plus, .badge-equals {
        font-size: 12px !important;
        padding: 0.15em 0.3em;
    }
    
    /* Ajuste para o highlight */
    .highlight {
        font-size: 14px !important;
    }
    
    /* Ajuste para a coluna Run + Bomb em telas pequenas */
    th:contains('Run + Bomb'),
    td:has(.badge-plus) {
        min-width: 100px !important;
        width: 100px !important;
        padding: 2px 4px !important;
    }
}

/* Estilos para telas muito pequenas */
@media screen and (max-width: 480px) {
    table {
        font-size: 11px;
    }
    
    th, td {
        padding: 3px !important;
    }
    
    /* Ajuste para células de scores em telas muito pequenas */
    td:not(.rank):not(.photo):not(.nome):not(.run-bomb):not(.final-score),
    th:not(.rank):not(.photo):not(.nome):not(.run-bomb) {
        padding: 3px 6px !important;
        min-width: 50px !important;
    }
    
    /* Ajuste para colunas de tentativas após Run + Bomb em telas muito pequenas */
    td:has(+ td.run-bomb) + td,
    th:has(+ th.run-bomb) + th {
        padding-left: 6px !important;
    }
    
    td.nome, th.nome {
        max-width: 80px;
        padding: 3px 6px !important;
    }
    
    td.run-bomb, th.run-bomb,
    td.final-score {
        padding: 3px 4px !important;
        font-size: 14px !important;
    }
    
    /* Ajustes para as colunas de tentativas */
    th:not(.rank):not(.photo):not(.nome):not(:contains('Run + Bomb')),
    td:not(.rank):not(.photo):not(.nome):not(:has(.badge-plus)) {
        min-width: 35px;
        max-width: 45px;
    }
    
    /* Ajuste para a coluna Run + Bomb em telas muito pequenas */
    th:contains('Run + Bomb'),
    td:has(.badge-plus) {
        min-width: 100px !important;
        width: 100px !important;
        padding: 2px 3px !important;
    }
}

/* Container responsivo para a tabela */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

th, td {
    text-align: center !important;
    padding: 4px;
    border: 1px solid #ddd;
    vertical-align: middle;
}
th {
    color: white;
}
td.nome, th.nome {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.photo-container {
    position: relative;
    display: inline-block;
}
.country-flag {
    position: absolute;
    bottom: 8px;
    right: 0;
    width: 16px;
    height: 12px;
    border-radius: 2px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.8);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.status-skater-photo-container {
    position: relative;
    display: inline-block;
}
.status-skater-photo {
    padding:0.3em;
    width: 60px;
    height: 60px;
    border-radius: 50% !important;
    object-fit: cover;
    filter: grayscale(100%);
}
.highlight {
    font-weight: bold;
    color: #00f2b4;
}
.badge-plus {
    background-color: #00bc8c;
}
.badge-equals {
    background-color: #3498DB;
}
.badge {
    margin: 0.3em;
    display: inline-block;
    padding: 0.25em 0.4em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.badge-last {
    background-color: #6c757d;
    color: #fff;
    margin-bottom: 0.5em;
}
.badge-current {
    background-color: #00bc8c;
    color: #fff;
    margin-bottom: 0.5em;
}
.badge-next {
    background-color: #007bff;
    color: #fff;    
    margin-bottom: 0.5em;
}
.badge-plus {
    background-color: #00bc8c;
    color: #fff;
    margin: 0 3px;
}
.badge-equals {
    background-color: #3498DB;
    color: #fff;
    margin: 0 3px;
}
.mod_ranking {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-bottom: 20px !important;
    font-size: 14px !important;
    background: none !important;
    border: none !important;
    table-layout: fixed !important;
}
.mod_ranking td {
    padding: 2px 4px !important;
    border: none !important;
    vertical-align: middle !important;
}
.mod_ranking .position {
    width: 30px !important;
    text-align: center !important;
    font-weight: bold !important;
    padding: 2px !important;
}
.mod_ranking .photo {
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    padding: 1px !important;
    text-align: center !important;
}
.mod_ranking .name {
    text-align: left !important;
    padding: 2px 12px !important;
    font-weight: 500 !important;
}
.mod_ranking .score {
    width: 60px !important;
    text-align: center !important;
    color: #00f2b4 !important;
    font-size: 16px !important;
    padding: 2px 20px 2px 2px !important;
}
.mod_ranking .skater-photo {
    width: 45px !important;
    height: 45px !important;
    min-width: 45px !important;
    min-height: 45px !important;
    max-width: 45px !important;
    max-height: 45px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    margin: 1px 0 !important;
}
.mod_ranking .country-flag {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 16px !important;
    height: 12px !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    object-fit: cover;
}
.mod_ranking .current-skater {
    background-color: rgba(0, 242, 180, 0.1);
}
.mod_ranking .current-skater td {
    border-color: #00f2b4;
}
.history-section {
    margin-top: 40px;
    margin-bottom: 40px;
}
.history-title {
    background-color: #f8f9fa;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 5px;
    font-weight: bold;
}
.history-round {
    margin-bottom: 30px;
}
.history-round table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    border: none;
}
.history-round table td, 
.history-round table th {
    padding: 1px 4px;
    text-align: center;
    border: none;
    vertical-align: middle;
}
.history-round table td.position {
    padding: 1px;
    text-align: center;
    width: 60px;
}
.history-round table td.photo {
    padding: 1px;
    text-align: center;
    width: 60px;
}
.history-round table td.name {
    padding: 1px 4px;
    text-align: left;
}
.history-round table td.score {
    padding: 1px 4px;
    text-align: center;
    font-size: 18px;
}
.history-round .skater-photo {
    padding: 0;
    margin: 1px;
    margin-top: 8px;
    margin-bottom: 3px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    filter: grayscale(100%) !important;
}
.round-title {
    background-color:none;
    color: white;
    padding: 8px;
    margin-top: 10px;
    margin-bottom: -10px;
    border-radius: 3px;
}
tr.qualified {
    background: rgba(0, 188, 140, 0.1) !important;
}
tr.qualified td:first-child {
    position: relative;
}
tr.qualified td:first-child::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: #00bc8c;
}
tr.qualified td {
    background: none !important;
}
tr.current-skater {
    background-color: rgba(108, 117, 125, 0.1) !important;
}
tr.current-skater td {
    background-color: rgba(108, 117, 125, 0.1) !important;
}
tr.current-skater .skater-photo {
    filter: grayscale(100%) !important;
}

/* Estilos específicos para a bandeira na tabela mini */
table.mod_ranking .photo-container .country-flag {
    width: 12px !important;
    height: 8px !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    bottom: 0 !important;
    right: 0 !important;
}

/* Estilos específicos para o final score na tabela mini */
table.mod_ranking td.score {
    font-size: 16px !important;
    width: 50px !important;
    padding: 2px !important;
    padding-right: 20px !important;
}

/* Estilos específicos para o nome do skatista na tabela mini */
table.mod_ranking td.name {
    text-align: left !important;
    padding-left: 12px !important;
    font-weight: 500 !important;
    width: auto !important;
    white-space: nowrap !important;
}

.history-round table th {
    padding: 8px 4px;
}

/* Estilos responsivos para a tabela mini */
@media screen and (max-width: 768px) {
    .mod_ranking {
        font-size: 13px !important;
    }
    
    .mod_ranking .position {
        width: 25px !important;
        padding: 2px !important;
    }
    
    .mod_ranking .photo {
        width: 45px !important;
        min-width: 45px !important;
        max-width: 45px !important;
    }
    
    .mod_ranking .skater-photo {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        max-width: 40px !important;
        max-height: 40px !important;
    }
}

@media screen and (max-width: 480px) {
    .mod_ranking {
        font-size: 12px !important;
    }
    
    .mod_ranking .position {
        width: 22px !important;
        padding: 1px !important;
    }
    
    .mod_ranking .photo {
        width: 40px !important;
        min-width: 40px !important;
        max-width: 40px !important;
    }
    
    .mod_ranking .skater-photo {
        width: 35px !important;
        height: 35px !important;
        min-width: 35px !important;
        min-height: 35px !important;
        max-width: 35px !important;
        max-height: 35px !important;
    }
}

/* Container da tabela mini - sem rolagem */
.table-responsive-mini {
    width: 100% !important;
    overflow: hidden !important;
    margin-bottom: 20px !important;
}

.mod_ranking td {
    padding: 4px;
    border: 1px solid #ddd;
    vertical-align: middle;
}

/* Estilos responsivos para a tabela de histórico */
@media screen and (max-width: 768px) {
    .history-section {
        margin-top: 20px;
        margin-bottom: 20px;
    }
    
    .history-title {
        font-size: 16px;
        padding: 8px;
    }
    
    .history-round {
        margin-bottom: 20px;
    }
    
    .history-round table {
        font-size: 12px;
    }
    
    .history-round table td, 
    .history-round table th {
        padding: 4px 6px;
    }
    
    .history-round table td.position {
        width: 40px;
    }
    
    .history-round table td.photo {
        width: 40px;
    }
    
    .history-round table td.name {
        max-width: 100px;
        padding-left: 4px;
    }
    
    .history-round table td.score,
    .history-round table td:not(.position):not(.photo):not(.name):not(.run-bomb) {
        font-size: 14px !important;
    }
    
    .history-round .skater-photo {
        width: 30px;
        height: 30px;
        margin-top: 4px;
        margin-bottom: 2px;
    }
    
    .round-title {
        font-size: 14px;
        padding: 6px;
    }
    
    .history-round table td.score {
        font-size: 14px !important;
    }
    
    /* Ajuste para os badges na tabela de histórico */
    .history-round .badge-plus,
    .history-round .badge-equals {
        font-size: 12px !important;
        padding: 0.2em 0.4em;
    }
    
    /* Ajuste para o highlight na tabela de histórico */
    .history-round .highlight {
        font-size: 14px !important;
    }
}

@media screen and (max-width: 480px) {
    .history-section {
        margin-top: 15px;
        margin-bottom: 15px;
    }
    
    .history-title {
        font-size: 14px;
        padding: 6px;
    }
    
    .history-round {
        margin-bottom: 15px;
    }
    
    .history-round table {
        font-size: 11px;
    }
    
    .history-round table td, 
    .history-round table th {
        padding: 3px 4px;
    }
    
    .history-round table td.position {
        width: 30px;
    }
    
    .history-round table td.photo {
        width: 35px;
    }
    
    .history-round table td.name {
        max-width: 80px;
        padding-left: 2px;
    }
    
    .history-round table td.score,
    .history-round table td:not(.position):not(.photo):not(.name):not(.run-bomb) {
        font-size: 14px !important;
    }
    
    .history-round .skater-photo {
        width: 25px;
        height: 25px;
        margin-top: 3px;
        margin-bottom: 1px;
    }
    
    .round-title {
        font-size: 13px;
        padding: 4px;
    }
    
    /* Ajuste para os badges na tabela de histórico */
    .history-round .badge-plus,
    .history-round .badge-equals {
        font-size: 12px !important;
        padding: 0.15em 0.3em;
    }
    
    /* Ajuste para o highlight na tabela de histórico */
    .history-round .highlight {
        font-size: 14px !important;
    }
}

/* Container responsivo para a tabela de histórico */
.table-responsive-history {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.history-title {
    background-color: #f8f9fa;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 5px;
    font-weight: bold;
}

/* Estilização das barras de rolagem */
.table-responsive::-webkit-scrollbar,
.table-responsive-history::-webkit-scrollbar {
    height: 6px !important;
    background-color: rgba(44, 48, 52, 0.05) !important;
    border-radius: 3px !important;
}

.table-responsive::-webkit-scrollbar-thumb,
.table-responsive-history::-webkit-scrollbar-thumb {
    background-color: #2c3034 !important;
    border-radius: 3px !important;
    transition: background-color 0.3s ease !important;
}

.table-responsive::-webkit-scrollbar-thumb:hover,
.table-responsive-history::-webkit-scrollbar-thumb:hover {
    background-color: #1a1d20 !important;
}

/* Estilização para Firefox */
.table-responsive,
.table-responsive-history {
    scrollbar-width: thin !important;
    scrollbar-color: #2c3034 rgba(44, 48, 52, 0.05) !important;
}

/* Container das tabelas responsivas - apenas para tabelas com rolagem */
.table-responsive,
.table-responsive-history {
    overflow-x: auto !important;
    border-radius: 4px !important;
    background: rgba(44, 48, 52, 0.02) !important;
    padding: 1px !important;
    margin-bottom: 20px !important;
}

/* Container da tabela mini - sem rolagem */
.table-responsive-mini {
    border-radius: 4px !important;
    background: rgba(44, 48, 52, 0.02) !important;
    padding: 1px !important;
    margin-bottom: 20px !important;
    overflow-x: hidden !important;
}

/* Ajuste para o hover da tabela */
.table-responsive:hover,
.table-responsive-mini:hover,
.table-responsive-history:hover {
    background: rgba(44, 48, 52, 0.03) !important;
}

/* Ajustes específicos para a tabela mini responsiva */
.table-responsive-mini table {
    width: 100% !important;
}

.table-responsive-mini td.rank {
    padding: 4px !important;
    text-align: center !important;
}

.table-responsive-mini td.photo {
    padding: 2px !important;
    text-align: center !important;
}

.table-responsive-mini td.nome {
    padding: 4px 8px !important;
    text-align: left !important;
}

.table-responsive-mini td.final-score {
    padding: 4px !important;
    text-align: center !important;
    font-size: 14px !important;
}

.table-responsive-mini .skater-photo {
    width: 50px !important;
    height: 50px !important;
}

@media screen and (max-width: 480px) {
    .table-responsive-mini td.rank {
        padding: 3px !important;
    }
    
    .table-responsive-mini td.photo {
        padding: 2px !important;
    }
    
    .table-responsive-mini td.nome {
        padding: 3px 6px !important;
    }
    
    .table-responsive-mini td.final-score {
        padding: 3px !important;
    }
    
    .table-responsive-mini .skater-photo {
        width: 40px !important;
        height: 40px !important;
    }
} 