﻿html,
body,
.mud-layout,
.mud-main-content {
    min-height: 100vh;
    background-color: #FFFFFF !important;
}

.ps-layout {
    min-height: calc(100vh - 100px);
    display: flex;
    gap: 24px;
    align-items: flex-start;
    margin: 40px 30px 0;
}

.ps-filters {
    width: 280px;
    flex-shrink: 0;
    padding: 16px;

    position: sticky;
    top: 100px;
    align-self: flex-start;

    max-height: calc(100vh - 48px);
    overflow-y: auto;
    scrollbar-width: none;
}

.ps-filters::-webkit-scrollbar {
    display: none;
}

.ps-filters__head {
    display: flex;
    justify-content: flex-end;
}

.ps-main {
    flex: 1;
    min-width: 0;
}

.ps-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.ps-title {
    margin: 24px 0 48px !important;
    font-size: 80px;
}

.ps-tabs .mud-tabs-toolbar {
    background: transparent;
    border-bottom: 1px solid #B8C9D8;
}

.ps-tabs .mud-tab {
    border: 1px solid var(--mud-palette-primary, #0050A0);
    border-bottom: 0;
    border-radius: 4px 4px 0 0;
    margin-right: 6px;
    min-height: 36px;
    text-transform: none;
}

.ps-tabs .mud-tab.mud-tab-active {
    background: var(--mud-palette-primary, #0050A0);
    color: #FFFFFF;
}

.ps-tabs .mud-tab-slider {
    display: none;
}

.ps-ranking-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 8px 0 12px;
}

.ps-table-heading,
.ps-ranking-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.ps-ranking-actions {
    gap: 8px;
    flex-wrap: wrap;
}

.ps-table {
    border-top: 1px solid #B8C9D8;
}

.ps-table .mud-table-head th,
.ps-table.mud-simple-table thead th {
    color: var(--mud-palette-text-primary, #003F72);
    font-weight: 600;
}

.comparison-action-cell {
    position: sticky;
    right: 0;
    z-index: 2;
    width: 88px;
    min-width: 88px;
    background-color: #FFFFFF;
    box-shadow: -8px 0 10px -10px rgba(0, 0, 0, 0.55);
}

.mud-table-head .comparison-action-cell {
    z-index: 4;
}

.comparison-action-buttons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
}

.player-compare-dock {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1300;
    width: min(22rem, calc(100vw - 2rem));
}

.player-compare-dock__header {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 76px;
    padding: 12px 14px;
    color: #FFFFFF;
    border-radius: 14px;
    background: linear-gradient(115deg, #003F72 0%, #0050A0 72%, #087CC1 100%);
    box-shadow: 0 10px 28px rgba(0, 45, 88, 0.28);
}

.player-compare-dock__icon {
    color: #FFFFFF !important;
    background: rgba(255, 255, 255, 0.16) !important;
    flex: 0 0 auto;
}

.player-compare-dock__toggle {
    min-width: 0;
    width: 150px;
    font-size: large;
    padding: 6px 4px !important;
    color: #FFFFFF !important;
    text-transform: none;
    
}

.player-compare-dock__toggle .mud-button-label {
    display: flex;
}

.player-compare-dock__toggle .mud-button-icon-start .mud-icon-root {
    font-size: 2rem;
}

.player-compare-dock__label {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    font-weight: 700;
    line-height: 1.2;
}

.player-compare-dock__count {
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.75rem;
    font-weight: 500;
}

.player-compare-dock__slots {
    display: flex;
    flex: 1;
    justify-content: flex-end;
    gap: 4px;
}

.player-compare-dock__slot {
    width: 18px;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.3);
    transition: background-color 160ms ease, transform 160ms ease;
}

.player-compare-dock__slot.is-filled {
    background: #69D7FF;
    transform: scaleY(1.25);
}

.player-compare-dock__header > .mud-icon-button {
    color: rgba(255, 255, 255, 0.85);
    flex: 0 0 auto;
}

.player-compare-dock__header > .mud-icon-button:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.14);
}

.player-compare-panel {
    max-height: min(55vh, 440px);
    margin-bottom: 10px;
    overflow-y: auto;
    background: #FFFFFF;
    border: 1px solid #D8E4EF;
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(0, 35, 68, 0.16);
}

.player-compare-panel__heading {
    padding: 14px 16px 10px;
    border-bottom: 1px solid #E2EAF1;
}

.player-compare-panel__heading .mud-typography:first-child {
    color: #003F72;
    font-weight: 700;
}

.player-compare-panel__hint {
    color: #64788B;
}

.player-compare-players {
    padding: 8px 12px;
}

.player-compare-player {
    min-height: 44px;
    padding: 4px 8px;
    border-radius: 9px;
}

.player-compare-player + .player-compare-player {
    border-top: 1px solid #EDF2F6;
}

.player-compare-player:hover {
    background: #F7FAFD;
}

.player-compare-player__name {
    flex: 1;
    color: #003F72;
    font-weight: 600;
}

.player-compare-panel__button {
    width: calc(100% - 24px);
    min-height: 42px;
    margin: 4px 12px 12px;
    border-radius: 10px;
    font-weight: 700;
    text-transform: none;
    box-shadow: 0 4px 10px rgba(0, 80, 160, 0.18);
}

.ps-num {
    text-align: right !important;
}

.ps-pill {
    border-radius: 999px;
    text-transform: none;
    color: var(--mud-palette-text-primary, #003F72);
    border-color: var(--mud-palette-text-primary, #003F72);
}

.score-bar {
    display: grid;
    grid-template-columns: 180px 1fr 56px;
    gap: 12px;
    align-items: center;
    margin: 6px 0;
}

.score-bar--rank {
    grid-template-columns: 180px minmax(0, 1fr) 56px 80px;
}

.score-bar__rank {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.position-rankings__header {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) 56px 80px;
    gap: 12px;
    align-items: center;
    padding: 0 0 8px;
    margin: 0 0 8px;
    border-bottom: 1px solid #BDBDBD;
    font-weight: 600;
}

.position-rankings__index-heading {
    grid-column: 2 / span 2;
}

.position-rankings__rank-heading {
    text-align: right;
}

.score-bar__label--hl {
    font-weight: 700;
    color: var(--mud-palette-primary, #0050A0);
}

.score-bar__value {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Highlight Blue alleen voor een klein accent. */
.ps-highlight {
    color: #00A4E4;
}

.ps-table .mud-checkbox .mud-icon-button,
.ps-table .mud-checkbox .mud-icon-root,
.ps-table .mud-checkbox svg {
    color: var(--mud-palette-primary, #0050A0) !important;
}

html:has(.mud-dialog-container),
html:has(body.scroll-locked) {
    overflow: hidden;
}

.mud-dialog .mud-dialog-content {
    max-height: 70vh;
    overflow-y: auto;
}

.ps-table .rij-header {
    color: var(--mud-palette-text-primary, #003F72);
    font-weight: 600;
    white-space: nowrap;
    position: sticky;
    left: 0;
    z-index: 1;
    background-color: #FFFFFF;
}

@media (max-width: 600px) {
    .score-bar,
    .score-bar--rank,
    .position-rankings__header {
        grid-template-columns: minmax(95px, 1fr) minmax(0, 2fr) 48px 64px;
        gap: 8px;
    }
    
    .player-compare-dock {
        right: 0.75rem;
        bottom: 0.75rem;
        width: min(22rem, calc(100vw - 1.5rem));
    }

    .player-compare-dock__slots {
        display: none;
    }
}

@media (max-width: 768px) {
    .ps-layout--filters-open > .ps-main {
        display: none;
    }

    .ps-layout {
        display: block;
        min-height: 0;
        margin: 24px 16px 0;
        overflow-x: clip;
    }

    .ps-filters {
        position: static;
        width: 100%;
        max-height: min(60vh, 560px);
        margin-bottom: 20px;
        box-sizing: border-box;
    }

    .ps-main {
        width: 100%;
        min-width: 0;
    }

    .ps-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .ps-title {
        margin: 0 0 20px !important;
        font-size: clamp(2rem, 8vw, 3rem);
        line-height: 1.05;
    }

    .ps-tabs .mud-tabs-toolbar {
        display: block;
        overflow: visible;
        border: 0;
    }

    .ps-tabs .mud-tabs-scroll-button {
        display: none;
    }

    .ps-tabs .mud-tabs-toolbar-content,
    .ps-tabs .mud-tabs-tabbar {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .ps-tabs .mud-tabs-tabbar {
        display: flex;
        flex: 1 1 auto;
        flex-wrap: wrap;
        justify-content: flex-start;
        padding: 4px;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .ps-tabs .mud-tab {
        flex: 1 1 auto;
        min-width: max-content;
        max-width: none;
        min-height: 48px;
        height: auto;
        margin: 0;
        padding: 8px 10px;
        border: 0;
        border-radius: 9px;
        font-size: 0.9rem;
        line-height: 1.25;
        text-align: center;
        text-transform: none;
        white-space: nowrap;
    }

    .ps-tabs .mud-tab.mud-tab-active {
        background: var(--mud-palette-primary, #0050A0);
        color: #FFFFFF;
        box-shadow: 0 2px 6px rgba(0, 63, 114, 0.2);
    }

    .ps-ranking-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .ps-ranking-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .ps-ranking-actions .ps-pill {
        width: 100%;
        margin: 0 !important;
        white-space: normal;
    }

    .ps-table {
        max-width: 100%;
        min-width: 0;
    }

    .ps-table .mud-table-container {
        max-width: 100%;
        min-width: 0;
        overflow-x: clip;
    }

    .ps-table .mud-table-root {
        width: 100%;
        min-width: 100%;
        table-layout: fixed;
    }

    .ps-table .mud-table-cell {
        padding: 8px 10px;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .ps-table .mud-table-body .mud-table-row > .mud-table-cell {
        border-bottom: 1px solid #EDF2F6;
    }

    .ps-table .mud-table-body .mud-table-row > .mud-table-cell:last-child {
        border-bottom: 3px solid #B8C9D8;
    }

    .ps-table .mud-table-body .mud-table-row > .comparison-action-cell {
        position: static;
        width: 100%;
        min-width: 0;
        box-shadow: none;
    }

    .ps-table .mud-table-toolbar {
        flex-wrap: wrap;
        gap: 8px;
    }

}

@media (max-width: 500px) {
    .ps-tabs .mud-tabs-tabbar {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
        justify-content: start;
        border: 0;
        padding: 4px 0;
    }

    .ps-tabs .mud-tab {
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
        justify-content: center;
        text-align: center;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: normal;
    }
}

@media (max-width: 480px) {
    .ps-layout {
        margin: 16px 12px 0;
    }

    .ps-filters {
        padding: 12px;
    }

    .ps-title {
        font-size: 2rem;
    }

    .ps-table .mud-table-toolbar {
        padding: 8px 12px;
    }
}
