/* Competitions League Table Styles */
.league-table-container {
    color: #fff;
    width: 100%;
    /*max-width: 900px;*/
    margin: 40px auto;
    padding: 0;
}

.league-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 1em;
    background: none;
    border: 1px solid color-mix(in srgb, var(--ecru) 25%, transparent);
    border-top: 2px solid var(--ecru);
    border-radius: var(--box-border-radius);
    overflow: hidden;
}

/* celler */
.league-table th,
.league-table td {
    padding: 14px 10px;
    text-align: left;
    border-bottom: 1px solid #232a36;
    white-space: nowrap;
}

.league-table th {
    font-size: 1.12em;
    letter-spacing: 1px;
    background: var(--bs-body-bg);
    border-bottom: 2px solid #232a36;
    font-weight: 600;
    text-transform: uppercase;
    color: #fff;
}

/* rad-typer (posisjon i tabellen) */
.league-table tr.top {
    background: linear-gradient(90deg, #174c3c 80%, #1e5c47 100%);
}
.league-table tr.bottom {
    background: linear-gradient(90deg, #4c1717 80%, #5c1e1e 100%);
}
.league-table tr.mid {
    background: var(--bs-body-bg);
}

/* hover på hovedrader */
.league-table tr {
    transition: background 0.2s;
}
.league-table tbody tr.team-row:hover {
    background: #26304a;
    cursor: pointer;
}

/* klubb-logo */
.league-table .team-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    vertical-align: middle;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    background: #222;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.15);
}

/* --- Fiks for klubbnavn og logo på samme linje --- */
.league-table td.team {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

/* vi styler navnene uten å endre display,
   så display:none fra .hide-mobile/.hide-desktop får styre synligheten */
.league-table .team .team-name-mobile,
.league-table .team .team-name-desktop {
    line-height: 1;
    vertical-align: middle;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
}

/* form badges (desktop og i detaljer) */
.league-table .form-icon {
    display: inline-block;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    margin: 0 2px;
    line-height: 26px;
    font-size: 0.8em;
    font-weight: 700;
    color: #fff;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.10);
    letter-spacing: 0.5px;
}
.league-table .form-icon.W { background: #2ecc40; }
.league-table .form-icon.D { background: #f1c40f; color: #222; }
.league-table .form-icon.L { background: #e74c3c; }

/* ------------------------- */
/*  DETAILS-"SKUFF" RAD     */
/* ------------------------- */

/* ekstra-raden rett under laget på mobil */
.league-table tbody tr.details-row {
    background: rgba(0,0,0,0.3);
    /* på desktop skal den aldri synes (se media query under) */
}

.league-table .details-inner {
    padding: 12px 16px;
    color: #fff;
    font-size: 0.95em;
    line-height: 1.4;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.league-table .details-stats {
    flex: 1 1 140px;
    min-width: 140px;
}

.league-table .details-stats > div {
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed rgba(255,255,255,0.1);
    padding-bottom: 2px;
}
.league-table .details-stats > div:last-child {
    border-bottom: 0;
}

.league-table .details-stats .label {
    font-weight: 500;
    opacity: 0.8;
    margin-right: 6px;
    color: #fff;
}
.league-table .details-stats .val {
    font-weight: 600;
    color: #fff;
}

.league-table .details-form {
    flex: 1 1 120px;
    min-width: 120px;
}
.league-table .details-form .label {
    font-weight: 500;
    opacity: 0.8;
    margin-bottom: 4px;
    color: #fff;
}
.league-table .details-form .form-icons .form-icon {
    /* mindre badges i drawer */
    width: 22px;
    height: 22px;
    line-height: 22px;
    font-size: 0.7em;
    margin-right: 4px;
}

/* område for "Club profile"-knappen i drawer */
.league-table .details-link-area {
    flex: 1 1 100%;
    min-width: 140px;
    margin-top: 12px;
}

.league-table .club-profile-btn {
    display: inline-block;
    background: var(--ecru, #cbb27a);
    color: #222;
    text-decoration: none;
    font-weight: 400;
    font-size: 0.9em;
    line-height: 1.2;
    padding: 8px 12px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.league-table .club-profile-btn:active {
    transform: scale(0.98);
}

/* ------------------------- */
/*  RESPONSIVE HELPERS      */
/* ------------------------- */

/* .hide-mobile = vises på desktop/tablet, skjules på mobil
   .hide-desktop = vises på mobil, skjules på desktop/tablet */

.hide-mobile {}
.hide-desktop {}

/* ------------------------- */
/*  RESPONSIVE BREAKPOINTS  */
/* ------------------------- */

/* Mobil / smal skjerm */
@media (max-width: 700px) {

    .league-table-container {
        padding: 8px;
        border-radius: 10px;
    }

    .league-table th,
    .league-table td {
        padding: 8px 4px;
        font-size: 0.95em;
    }

    .league-table .team-logo {
        width: 28px;
        height: 28px;
        margin-right: 6px;
    }

    .league-table .form-icon {
        width: 18px;
        height: 18px;
        line-height: 18px;
        font-size: 0.8em;
    }

    /* Skjul kolonner som er "for avansert" på mobil */
    .league-table thead .hide-mobile,
    .league-table tbody .hide-mobile {
        display: none;
    }

    /* Kun-mobil elementer skal synes */
    .hide-desktop {
        display: inline;
    }

    /* Desktop/tablet-only ting skal bort på mobil */
    .hide-mobile {
        display: none;
    }

    /* Hovedraden skal være tydelig klikkbar */
    .league-table tbody tr.team-row {
        cursor: pointer;
    }

    /* Drawer/logg-raden er skjult som default */
    .league-table tbody tr.details-row {
        display: none;
    }
    .league-table tbody tr.details-row.open {
        display: table-row;
    }
}

/* Tablet/desktop */
@media (min-width: 701px) {

    /* På større skjermer viser vi full tabell og skjuler drawer-row helt */
    .league-table tbody tr.details-row {
        display: none !important;
    }

    /* På desktop lar vi alle kolonner synes uansett */
    .league-table thead .hide-mobile,
    .league-table tbody .hide-mobile {
        display: table-cell;
    }

    /* Mobil-only elementer skal ikke synes */
    .hide-desktop {
        display: none;
    }

    /* Desktop/tablet-elementer skal vises */
    .hide-mobile {
        display: inline;
    }
}

/* ------------------------- */
/* Leaderboard-komponenten  */
/* ------------------------- */

.leaderboard-table tbody tr[data-bs-toggle="collapse"] {
    cursor: pointer;
}

.lb-detail {
    background: #0d6efd10;
}

.lb-stat {
    display: flex;
    justify-content: space-between;
    padding: .25rem 0;
    border-bottom: 1px dashed rgba(0,0,0,.08);
}
.lb-stat:last-child {
    border-bottom: 0;
}
.lb-stat b {
    margin-left: .5rem;
}
