/**
 * Plik: 7-table.css
 * Oparty na 1:1 architekturze do page-tabela.php 
 * PRO-Comment: Zintegrowana "Klatka RWD" - ochrona przed Niewidzialną Szybą na Mobile
 */ 

/* RESET I UKRYWANIE ELEMENTÓW MOTYWU */
.post-main-container header, .entry-header, .post-header, .header-visual, .archive-header { display: none !important; }
#primary, .content-area, .site-main, .post-main-container, article.post, article.page { width: 100% !important; max-width: 100% !important; flex: 0 0 100% !important; padding: 0 !important; margin: 0 !important; }
#secondary, aside#sidebar, .sidebar, .widget-area:not(.ckm-sidebar-area) { display: none !important; }

/* GLOBALNA OCHRONA (Przeciw rozpychaniu) */
body { overflow-x: hidden !important; }

/* LAYOUT GŁÓWNY */
.ckm-tabela-wrapper { display: flex; gap: 40px; width: 100%; max-width: 1300px; margin: 40px auto; padding: 0 20px; align-items: start; box-sizing: border-box; }
.ckm-tabela-main { flex: 1; min-width: 0; }
.ckm-sidebar-area { width: 340px; flex-shrink: 0; }

/* KONTENER TABELI */
.ckm-tabela-container { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; width: 100%; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.ckm-tabela-topbar { padding: 12px 20px; border-bottom: 2px solid #cbd5e1; display: flex; align-items: center; justify-content: space-between; background: #fafbfc; }
.ckm-tabela-title { font-size: 13px; font-weight: 800; color: #111; text-transform: uppercase; margin: 0; }

.ckm-season-select { appearance: none; background: #fff url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2300a859%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095z%22%2F%3E%3C%2Fsvg%3E") no-repeat right 8px top 50%; background-size: 9px auto; border: 1px solid #cbd5e1; border-radius: 6px; padding: 5px 25px 5px 12px; font-size: 11px; font-weight: 700; cursor: pointer; }

/* --- KLATKA RWD (MOBILE SCROLL FIX) --- */
.ckm-tabela-scroll { 
    width: 100%;
    max-width: 100%;
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch; /* Gładki scroll palcem na iOS/Android */
}
.sp-league-table { 
    width: 100% !important; 
    border-collapse: collapse !important; 
    border: none !important; 
    margin: 0 !important; 
}

/* NAGŁÓWKI */
.sp-league-table thead th { background: #fff !important; color: #6b7280 !important; font-size: 10px !important; font-weight: 700 !important; text-transform: uppercase !important; border-bottom: 2px solid #cbd5e1 !important; padding: 10px 8px !important; text-align: center !important; }
.sp-league-table thead th.data-name { text-align: left !important; padding-left: 20px !important; }

/* KOMÓRKI */
.sp-league-table tbody td { padding: 8px 10px !important; text-align: center !important; font-size: 13px !important; color: #333 !important; border-bottom: 1px solid #cbd5e1 !important; vertical-align: middle !important; line-height: 1 !important; }

/* POZYCJA */
.sp-league-table tbody td:first-child { font-weight: 900 !important; color: #111 !important; font-size: 15px !important; width: 35px !important; }

/* AUTORSKA KLASA CKM DLA HERBÓW */
.ckm-team-box { display: flex !important; align-items: center !important; gap: 12px !important; text-decoration: none !important; color: #111 !important; line-height: 1 !important; margin: 0 !important; padding: 0 !important; }
.ckm-herb-img { width: 26px !important; height: 26px !important; min-width: 26px !important; max-width: 26px !important; display: block !important; object-fit: contain !important; flex-shrink: 0 !important; margin: 0 !important; padding: 0 !important; border: none !important; box-shadow: none !important; background: none !important; }
.ckm-team-name { font-weight: 600 !important; font-size: 13px !important; }

/* PUNKTY */
.sp-league-table tbody td.data-pts { font-weight: 900 !important; color: #111 !important; font-size: 14px !important; }

/* FORMA */
.data-form-cell { display: flex; gap: 3px; justify-content: center; align-items: center; min-width: 95px; }
.form-circle { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; border-radius: 50%; font-size: 14px; font-weight: 900; color: #fff; line-height: 1; margin: 0 !important; }
.form-w { background: #00a859; } .form-d { background: #adb5bd; } .form-l { background: #ff3c3c; }

/* 1. MISTRZOWSKI KAFEL (Badge) DLA NUMERU MIEJSCA */
.ckm-rank-badge { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 6px; font-weight: 800; font-size: 13px; color: #55625c; }

/* 2. SPADEK */
tr.ckm-row-releg > td { background-color: rgba(255, 107, 107, 0.1) !important; }
tr.ckm-row-releg > td:first-child { border-left: 4px solid #ff3c3c !important; }
tr.ckm-row-releg .ckm-rank-badge { background-color: #ff3c3c; color: #ffffff; }

/* 3. AWANS BEZPOŚREDNI */
tr.ckm-row-promo > td { background-color: rgba(0, 168, 89, 0.15) !important; }
tr.ckm-row-promo > td:first-child { border-left: 4px solid #00a859 !important; }
tr.ckm-row-promo .ckm-rank-badge { background-color: #00a859; color: #ffffff; }

/* 4. BARAŻE O AWANS */
tr.ckm-row-playup > td { background-color: rgba(135, 208, 104, 0.15) !important; }
tr.ckm-row-playup > td:first-child { border-left: 4px solid #87d068 !important; }
tr.ckm-row-playup .ckm-rank-badge { background-color: #87d068; color: #ffffff; }

/* 5. BARAŻE O SPADEK */
tr.ckm-row-playdn > td { background-color: rgba(250, 173, 20, 0.15) !important; }
tr.ckm-row-playdn > td:first-child { border-left: 4px solid #faad14 !important; }
tr.ckm-row-playdn .ckm-rank-badge { background-color: #faad14; color: #ffffff; }

.ckm-table-legend { display: flex; flex-wrap: wrap; gap: 15px 25px; margin-top: 25px; padding: 20px; background: #ffffff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04); border: 1px solid rgba(0, 0, 0, 0.05); }
.ckm-legend-item { display: flex; align-items: center; font-size: 13px; font-weight: 600; color: #55625c; letter-spacing: 0.5px; }
.ckm-legend-badge { display: inline-block; width: 16px; height: 16px; border-radius: 4px; margin-right: 10px; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1); }
.ckm-tabela-opis { margin-top: 15px; padding: 20px; background: #ffffff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04); border: 1px solid rgba(0, 0, 0, 0.05); font-size: 12px; font-weight: 500; font-style: italic; color: #868686; }    

/* RWD - TELEFONY I TABLETY (Zsynchronizowany Breakpoint 992px) */
@media (max-width: 992px) {
    /* Zrzucamy sidebar na dół, dajemy tabeli 100% szerokości */
    .ckm-tabela-wrapper { 
        flex-direction: column; 
        padding: 0 0; 
        margin-top: 20px; 
    }
    
    .ckm-tabela-main {
        width: 100%;
        padding: 0;
        box-sizing: border-box;
    }

    .ckm-sidebar-area { 
        width: 100%; 
        padding: 0 20px; 
        box-sizing: border-box; 
        margin-top: 40px; 
    }
    .ckm-tabela-container {
        border-radius: 0; /* Ostre rogi przy krawędziach wyglądają PRO */
        border-left: none;
        border-right: none;
    }
    
    /* Wymuszamy, by tabela nie kurczyła się ekstremalnie - 600px daje świetny efekt scrolla */
    .sp-league-table { 
        min-width: 600px !important; 
    }
    .sp-league-table thead th.data-name { 
        padding-left: 10px !important; 
    }
    .sp-league-table tbody td:first-child { 
        padding-left: 10px !important; /* Mniejsze wcięcie dla numeracji */
    }
    
    /* Legenda ciaśniej na telefonach i tabletach */
    .ckm-table-legend { 
        flex-direction: column; 
        gap: 12px; 
        padding: 15px; 
        margin-left: 0; 
        margin-right: 0; 
    }
    
    .ckm-tabela-opis { 
        margin-left: 0; 
        margin-right: 0; 
    }
}