/* ==============================================================
   PAGE SPECIFIC FIXES - PRISTINE WORLD
   Correções específicas para páginas com problemas individuais
   ============================================================== */

/* === REDUÇÃO DE LINHAS DESNECESSÁRIAS EM TABELAS === */

/* Remover linhas vazias ou desnecessárias */
table tr:empty,
table tr:has(td:empty):has(td:only-child),
.table tr:empty {
    display: none !important;
}

/* Compactar tabelas com muitas linhas - limitar altura */
table {
    max-height: 500px !important;
    overflow-y: auto !important;
}

/* Para tabelas muito grandes, mostrar apenas as primeiras 20 linhas */
table tbody tr:nth-child(n+21) {
    display: none !important;
}

/* Botão para mostrar mais linhas (caso existam scripts) */
.show-more-rows {
    background: var(--medieval-brown) !important;
    color: var(--medieval-gold) !important;
    padding: 5px 10px !important;
    border: none !important;
    border-radius: 4px !important;
    margin: 10px auto !important;
    display: block !important;
    cursor: pointer !important;
}

/* === CORREÇÕES ESPECÍFICAS POR PÁGINA === */

/* Highscores - Limitação de entradas */
.highscores-container table tbody tr:nth-child(n+51) {
    display: none !important;
}

/* Characters - Reduzir informações desnecessárias */
.character-info .skills table tr:nth-child(n+11),
.player-details .skills table tr:nth-child(n+11) {
    display: none !important;
}

/* Wiki pages - Compactar seções */
.wiki-container .large-table {
    max-height: 400px !important;
    overflow-y: auto !important;
}

/* Dashboard - Limitar sessões mostradas */
.dashboard-container .session-history tr:nth-child(n+16) {
    display: none !important;
}

/* === OTIMIZAÇÃO DE ESPAÇAMENTOS GLOBAIS === */

/* Reduzir margens gerais */
.content > *,
.wiki-container > *,
.admin-container > * {
    margin-bottom: 10px !important;
}

/* Reduzir padding em seções */
.section,
.admin-section,
.dashboard-section {
    padding: 8px 10px !important;
    margin: 8px 0 !important;
}

/* Compactar formulários */
form {
    margin: 10px 0 !important;
}

form input,
form select,
form textarea {
    margin: 3px 0 !important;
    padding: 6px 8px !important;
}

form label {
    margin: 5px 0 2px 0 !important;
    display: block !important;
    font-size: 12px !important;
}

/* === CORREÇÕES ESPECÍFICAS MOBILE - PÁGINAS === */
@media screen and (max-width: 768px) {
    
    /* Limitar ainda mais as linhas de tabela no mobile */
    table tbody tr:nth-child(n+11) {
        display: none !important;
    }
    
    /* Adicionar indicador de "mais resultados" */
    table::after {
        content: "Scroll horizontal para ver mais colunas" !important;
        display: block !important;
        text-align: center !important;
        font-size: 10px !important;
        color: var(--medieval-gold) !important;
        margin: 5px 0 !important;
        font-style: italic !important;
    }
    
    /* Compactar ainda mais os containers */
    .content,
    .wiki-container,
    .admin-container {
        padding: 5px !important;
        margin: 3px auto !important;
    }
    
    /* Reduzir espaçamentos entre elementos */
    .content > *,
    .wiki-container > * {
        margin-bottom: 5px !important;
    }
    
    /* Formulários mobile ultra compactos */
    form {
        margin: 5px 0 !important;
    }
    
    form input,
    form select {
        margin: 2px 0 !important;
        padding: 4px 6px !important;
        font-size: 11px !important;
    }
    
    form label {
        margin: 3px 0 1px 0 !important;
        font-size: 10px !important;
    }
}

/* === PÁGINAS ESPECÍFICAS === */

/* Página de Bosses - Compactar informações */
.boss-wiki-container table td {
    padding: 5px 3px !important;
    font-size: 10px !important;
}

.boss-wiki-container .requirements {
    font-size: 9px !important;
    line-height: 1.2 !important;
}

/* Página de Items - Grid mais compacto */
.category-grid a {
    padding: 6px !important;
    font-size: 11px !important;
}

.offer-card {
    padding: 8px !important;
    margin-bottom: 8px !important;
}

/* Página de Streamers - Informações compactas */
.dashboard-container table {
    font-size: 10px !important;
}

.dashboard-container th,
.dashboard-container td {
    padding: 5px 4px !important;
}

/* Página de Houses - Lista compacta */
.house-list table td {
    padding: 6px 4px !important;
    font-size: 11px !important;
}

/* === CORREÇÕES DE LAYOUT ESPECÍFICAS === */

/* Evitar tabelas muito largas */
table {
    table-layout: fixed !important;
    word-wrap: break-word !important;
}

/* Headers de tabela mais informativos */
table th {
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
}

/* === PERFORMANCE E CARREGAMENTO === */

/* Lazy loading para imagens dentro de tabelas */
table img {
    loading: lazy !important;
}

/* Otimização de rendering */
table {
    contain: layout style !important;
}

/* === CORREÇÕES FINAIS === */

/* Evitar overflow horizontal desnecessário */
body {
    overflow-x: hidden !important;
}

/* Scroll suave */
html {
    scroll-behavior: smooth !important;
}

/* Otimização de fontes */
* {
    text-rendering: optimizeLegibility !important;
    -webkit-font-smoothing: antialiased !important;
}

/* === INDICADORES VISUAIS === */

/* Indicador de scroll para tabelas */
.table-wrapper {
    position: relative !important;
}

.table-wrapper::before {
    content: "⟷ Scroll" !important;
    position: absolute !important;
    top: 5px !important;
    right: 5px !important;
    background: rgba(139, 69, 19, 0.8) !important;
    color: var(--medieval-gold) !important;
    padding: 2px 6px !important;
    border-radius: 3px !important;
    font-size: 8px !important;
    z-index: 5 !important;
}

@media screen and (max-width: 768px) {
    .table-wrapper::before {
        display: block !important;
    }
}

@media screen and (min-width: 769px) {
    .table-wrapper::before {
        display: none !important;
    }
} 