/* Big Brother Seasons page. Cloned from seasons.css.
   BB theming flows from the show-aware --brand-* tokens set on html.show-bigbrother
   in master.cshtml (brand-primary = #1E40AF). This sheet only loads on the BB
   Seasons page, so the tokens resolve to BB blue. Differences from seasons.css:
     * Special Exits box border uses var(--brand-primary) instead of Survivor green.
     * .card-episode -> .card-round (BB is round-based).
     * Avatar ring is a solid brand-blue (BB getscoredata returns no per-player
       accent color); houseguest name stays neutral/dark for readability. */

/* Normalize iOS auto-zoom on text */
html {
    -webkit-text-size-adjust: 100%;
}

/* Seasons Page Container */
.seasons-page {
    background: #FFF;
    padding: 2.5rem;
    padding-top: 4rem; /* tighter top spacing */
    position: relative;
    z-index: 1;
}

/* Content Wrapper using relative width and side padding */
.content-wrapper {
    position: relative;
    width: 90%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* Page Header */
.page-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin: 0 auto;
    width: 100%;
}

/* Header Left Section */
.header-left {
    display: flex;
    flex-direction: column; /* title above filters */
    align-items: flex-start;
    gap: 0.5rem;
}

/* Right: Special Exits Box */
.special-exits {
    width: 17.5rem;
    border: 0.125rem solid var(--brand-primary, #1E40AF);
    padding: 0.625rem;
    background-color: #FFF;
    text-align: center;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1);
}

    .special-exits h4 {
        margin: 0;
        text-align: center;
        font-size: 1rem;
        font-weight: 600;
        color: #181D27;
    }

    .special-exits hr {
        border-top: 0.0625rem solid var(--brand-primary, #1E40AF);
        margin: 0.3125rem 0;
    }

    .special-exits p {
        margin: 0.3125rem 0;
        font-size: 0.875rem;
        color: #535862;
    }

    .special-exits strong {
        color: firebrick;
    }

/* Page Title (match rest of site) */
.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: #181D27;
    line-height: 1.2;
    margin: 0 0 .25rem 0;
}

/* Filters row (dropdowns + toggles) */
.dropdown-section {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: flex-end;
    gap: 1rem;
    flex: 1 0 0;
}

/* Stacked label + control */
.control-group {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

/* Small label styling (not a title) */
.field-label {
    font-size: 0.875rem;
    line-height: 1rem;
    font-weight: 600;
    color: #535862;
    margin: 0;
}

/* Dropdown Button Styles */
.seasons-dropdown .seasons-dropdown-toggle {
    display: flex;
    padding: 0.625rem 1rem;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.5rem;
    border: 0.0625rem solid var(--Gray-300, #D5D7DA);
    background: var(--White, #FFF);
    box-shadow: 0 0.0625rem 0.125rem rgba(10, 13, 18, 0.05);
}

    .seasons-dropdown .seasons-dropdown-toggle::after {
        content: '\25BC';
        margin-left: 0.5rem;
        font-size: 0.75rem;
        line-height: 1;
    }

.seasons-dropdown.show .seasons-dropdown-toggle::after {
    content: '\25B2';
}

/* Shared segmented switch styling (both toggles) */
.segmented-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    border-radius: 999px;
    padding: 0.25rem;
    background: #fff;
    border: 1px solid var(--Gray-300, #D5D7DA);
    box-shadow: 0 1px 2px rgba(10,13,18,0.06);
    user-select: none;
}

    .segmented-switch .seg-btn {
        border: 0;
        background: transparent;
        padding: 0.5rem 0.9rem;
        font-size: 0.95rem;
        line-height: 1;
        border-radius: 999px;
        cursor: pointer;
        color: #535862;
        transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
    }

        .segmented-switch .seg-btn:hover {
            background: rgba(0,0,0,0.04);
        }

        .segmented-switch .seg-btn.active {
            background: #181D27;
            color: #fff;
            box-shadow: 0 1px 2px rgba(0,0,0,0.15);
        }

    .segmented-switch .seg-info {
        border: 0;
        background: transparent;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        font-weight: 700;
        font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial, 'Noto Sans';
        cursor: help;
        color: #535862;
    }

        .segmented-switch .seg-info:hover {
            background: rgba(0,0,0,0.04);
        }

/* Score Table Container */
.score-table {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin: 1.5rem 0 2.5rem;
    width: 100%;
    border-radius: 0.75rem;
    border: 0.0625rem solid var(--Gray-200, #E9EAEB);
    background: var(--White, #FFF);
    box-shadow: 0 0.0625rem 0.1875rem rgba(10, 13, 18, 0.10), 0 0.0625rem 0.125rem rgba(10, 13, 18, 0.06);
}

/* Card Header */
.card-header {
    width: 100%;
    background: var(--White, #FFF);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.card-header-content {
    display: flex;
    padding: 1.0rem 1.5rem 0.9rem 1.5rem;
    align-items: center;
    gap: 0.5rem;
    align-self: stretch;
}

.card-season {
    color: var(--Gray-900, #181D27);
    font-family: 'Inter', sans-serif;
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1.75rem;
}

.card-round {
    color: #535862;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.25rem;
}

/* Table Container */
.table-container {
    width: 100%;
}

/* Top + Bottom synced scrollbars (Top shows a real scrollbar) */
.table-scroll-wrapper {
    position: relative;
}

.table-scroll-top {
    overflow-x: scroll; /* force scrollbar */
    overflow-y: hidden;
    min-height: 22px; /* enough height so bar is visible on Windows */
    height: 22px;
    background: #FAFAFA;
    border: 1px solid #E9EAEB;
    border-radius: 6px;
    margin-bottom: 6px;
    position: relative;
    scrollbar-gutter: stable; /* keep space for scrollbar when not scrolling */
}

    .table-scroll-top .scroll-spacer {
        height: 1px;
    }
    /* provides scrollable content */
    .table-scroll-top .scroll-hint {
        display: none; /* shown via JS only when overflow exists */
        position: absolute;
        right: 10px;
        top: 2px;
        font-size: 12px;
        color: #6B7280;
        pointer-events: none;
    }

.table-scroll {
    overflow-x: auto;
    scrollbar-gutter: stable;
}

/* Make the top scrollbar look like a standard Windows scrollbar (Chromium/Edge) */
.table-scroll-top::-webkit-scrollbar {
    height: 14px;
}

.table-scroll-top::-webkit-scrollbar-track {
    background: #EEE;
    border-radius: 7px;
}

.table-scroll-top::-webkit-scrollbar-thumb {
    background: #C3C7CF;
    border-radius: 7px;
}

    .table-scroll-top::-webkit-scrollbar-thumb:hover {
        background: #A9AFB8;
    }

/* Firefox */
.table-scroll-top {
    scrollbar-width: thin;
    scrollbar-color: #C3C7CF #EEE;
}

/* Table Styles */
.table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    font-family: 'Inter', sans-serif;
    background: var(--White, #FFF);
}

    .table thead tr {
        background: var(--Gray-50, #FAFAFA);
    }

    .table thead th {
        border: 0.0625rem solid var(--Gray-200, #E9EAEB);
        text-align: center;
        font-size: 0.8rem;
        font-weight: 600;
        line-height: 1.2rem;
        padding: 0.9rem 1rem;
        white-space: normal; /* allow wrapping when showing full titles */
        color: var(--Gray-600, #535862);
    }

    /* Table row styling */
    .table tbody tr {
        border-bottom: 0.0625rem solid var(--Gray-200, #E9EAEB);
    }

    .table tbody td {
        text-align: center;
        font-size: 0.95rem;
        font-weight: 500;
        line-height: 1.35rem;
        padding: 0.9rem 1rem;
        color: var(--Gray-700, #3A3F47);
        white-space: normal;
    }

        /* Houseguest Cell Styling */
        .table tbody td.player-cell {
            border: none;
            text-align: left;
            padding: 0.6rem 0.75rem;
            background: transparent;
        }

.player-cell {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

    .player-cell img {
        width: 2.25rem;
        height: 2.25rem;
        flex: 0 0 auto;       /* don't let flex squish the avatar into an oval */
        border-radius: 50%;
        border: 2px solid var(--brand-primary, #1E40AF); /* solid BB-blue ring */
        object-fit: cover;    /* keep aspect ratio if the source image isn't square */
    }

.player-name {
    font-weight: 700;
    color: var(--Gray-900, #181D27); /* neutral/dark for readability (WCAG) */
}

/* Hover effect for table rows */
.table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

/* Placement Column */
.table tbody td.placement-cell {
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35rem;
    padding: 0.9rem 1rem;
    color: var(--Gray-700, #3A3F47);
    white-space: normal;
}

/* Column Highlighting */
.highlight-col {
    background-color: rgba(0, 0, 0, 0.03) !important;
    transition: background-color 0.3s ease;
}

/* ---------- Responsive adjustments for smaller screens ---------- */
@media (max-width: 768px) {
    /* Reduce page paddings and hero height so first view shows more content */
    .seasons-page {
        padding: 1rem 1rem 2rem;
        padding-top: 1.5rem;
    }

    .page-title {
        font-size: 1.35rem;
        margin-bottom: .25rem;
    }

    /* Cap hero height to avoid initial "zoomed-in" feel */
    .hero-banner img {
        max-height: 180px;
        object-fit: cover;
    }

    /* Hide desktop Special Exits box, show mobile compact one */
    .special-exits {
        display: none;
    }

    .special-exits-mobile {
        display: block;
    }

    /* Filters: tidy two-row grid on mobile */
    .dropdown-section {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: .6rem;
        align-items: end;
        width: 100%;
    }
    /* place toggles on the second row */
    #displayModeSwitch {
        grid-column: 1 / 2;
    }

    #headerModeSwitch {
        grid-column: 2 / 3;
    }

    .segmented-switch {
        width: 100%;
        justify-content: center;
        padding: .2rem;
    }

        .segmented-switch .seg-btn {
            padding: .45rem .7rem;
            font-size: .9rem;
        }

    /* Table compactness */
    .card-header-content {
        padding: .75rem 1rem;
        gap: .35rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .card-season {
        font-size: 1rem;
    }

    .card-round {
        font-size: .8rem;
    }

    .table thead th {
        padding: .6rem .6rem;
        font-size: .72rem;
        line-height: 1.05rem;
    }

    .table tbody td {
        padding: .6rem .6rem;
        font-size: .88rem;
        line-height: 1.2rem;
    }

    .player-cell img {
        width: 1.875rem; /* 30px */
        height: 1.875rem;
        border-width: 2px;
    }

    /* Top scrollbar slightly shorter on mobile */
    .table-scroll-top {
        height: 16px;
        min-height: 16px;
        margin-bottom: 4px;
    }

    /* ===== Remove sticky columns entirely on mobile ===== */
    .table thead th,
    .table tbody td {
        position: static !important;
        left: auto !important;
        z-index: auto !important;
    }
}

/* Hero */
.hero-banner {
    width: 100%;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

    .hero-banner img {
        width: 100%;
        object-fit: cover;
        display: block;
    }

.placement-cell {
    position: relative;
}

.special-exit-label {
    position: absolute;
    top: 0.25rem;
    left: 0.25rem;
    color: firebrick;
    font-weight: bold;
    font-size: 0.75rem;
    z-index: 2;
}

/* ---- Mobile-only Special Exits pill ---- */
.special-exits-mobile {
    display: none;
    width: 100%;
}

    .special-exits-mobile > summary {
        list-style: none;
        cursor: pointer;
        display: inline-block;
        padding: .5rem .8rem;
        border-radius: 999px;
        border: 1px solid #D5D7DA;
        background: #fff;
        font-weight: 600;
        font-size: .9rem;
        color: #181D27;
        box-shadow: 0 1px 2px rgba(10,13,18,0.06);
    }

        .special-exits-mobile > summary::-webkit-details-marker {
            display: none;
        }

    .special-exits-mobile[open] > summary {
        background: #F7F7F7;
    }

    .special-exits-mobile .sx-content {
        margin-top: .5rem;
        border: 1px solid #E9EAEB;
        border-radius: .5rem;
        padding: .6rem .8rem;
        background: #FFF;
        font-size: .9rem;
        color: #535862;
    }

        .special-exits-mobile .sx-content p {
            margin: .25rem 0;
        }

        .special-exits-mobile .sx-content strong {
            color: firebrick;
        }
