﻿/* Page layout overrides */

.rankdetail #mainmiddle {
    max-width: 1100px;
}

/* Chip row spacing */
.preset-chips .badge {
    display: inline-flex;
    align-items: center;
    padding: .375rem .5rem;
    font-weight: 500; /* slightly stronger than default */
}

/* ==========================================================================
   DETAILS PAGE (filters + grid)
   ========================================================================== */

/* Filter box */
.filter-container {
    display: grid;
    gap: 16px;
    margin: 16px 0 20px;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--bs-border-color);
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    box-shadow: var(--bs-box-shadow-sm);
}

.filter-readonly-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
}

.filter-readonly-banner .btn-customize {
    margin-left: auto;
}

.filter-row {
    display: block;
}

.filter-group {
    display: grid;
    grid-template-columns: 210px 1fr 190px;
    gap: 26px;
    align-items: center;
}

    .filter-group label {
        font-weight: 600;
    }

    .filter-group span {
        text-align: right;
        color: var(--bs-body-color);
    }

/* Small screens */
@media (max-width:800px) {
    .filter-container {
        padding-left: 30px;
        padding-right: 30px;
    }

    /* Stack: label (full width), slider (full width), value (full width, right-aligned) */
    .filter-group {
        grid-template-columns: 1fr; /* single column */
        grid-auto-rows: auto;
    }

        .filter-group label {
            grid-column: 1 / -1; /* full width */
            margin: 0; /* optional: keep it tight */
        }

        .filter-group div {
            grid-column: 1 / -1; /* slider full width */
        }

        .filter-group span {
            grid-column: 1 / -1; /* full width line for value */
            text-align: right;
        }
}

/* noUiSlider minor refinements */
.noUi-target {
    background: #eaeaea;
    border: none;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.04);
}

.noUi-connect {
    background: #5b8def;
}

.noUi-handle {
    border: 1px solid #cfd8ff;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

/* Prevent pointer events on disabled noUiSlider */
[disabled].noUi-target, [disabled] .noUi-handle {
    pointer-events: none;
}

/* Centre everything on the rankings table by default */
#rankTable.dataTable th,
#rankTable.dataTable td {
    text-align: center;
}

    /* ...except the "#" (col 2) and "Occupation" (col 3) which should be left */
    #rankTable.dataTable th:nth-child(2),
    #rankTable.dataTable td:nth-child(2),
    #rankTable.dataTable th:nth-child(3),
    #rankTable.dataTable td:nth-child(3) {
        text-align: left;
    }

    /* Ensure DataTables' numeric typing doesn't force right alignment */
    #rankTable.dataTable th.dt-type-numeric,
    #rankTable.dataTable td.dt-type-numeric {
        text-align: center;
    }

/* Reduce font size for the rankings table */
#rankTable.dataTable {
    font-size: 16px;
}

    /* Lighten up the table headers */
    #rankTable.dataTable thead th {
        font-weight: 500; /* normal (400) or medium (500) looks good */
    }

    /* Remove all DataTables 2.x box-shadows (stripes + hover effects) */
    #rankTable.dataTable th,
    #rankTable.dataTable td {
        box-shadow: none !important;
    }

    /* Add a subtle highlight on row hover */
    #rankTable.dataTable tbody tr:hover > * {
        background-color: var(--bs-tertiary-bg) !important;
    }

.child .dtr-details{
    text-align:left;
}

.dt-layout-row .dt-length {
    display: flex;
    gap: 10px;
    align-items: center;
}

.dt-layout-row .dt-search {
    display: flex;
    gap: 10px;
    align-items: center;
}

.dt-layout-row .dt-search input {
    width:300px;
}

@media screen and (max-width: 767px) {
    .dt-layout-row .dt-search input {
        width: 100%;
    }
    /* Centre the "entries per page" control */
    .dt-layout-cell.dt-layout-start {
        display: flex;
        justify-content: center;
    }

    .dt-layout-cell.dt-layout-start .dt-length {
        justify-content: center;
    }
}

.d-n {
    display: none;
}

/* Lock sorting: disable header interaction and hide sort affordances */
#rankTable.dt-locked thead th {
    pointer-events: none;
    cursor: default;
    color: var(--bs-secondary-color);
}

    #rankTable.dt-locked thead th .locked-sort-icon {
        pointer-events: auto; /* let the tooltip work */
    }

    /* Hide sort icons/affordances (works across DT 2 variants) */
    #rankTable.dt-locked thead th.sorting,
    #rankTable.dt-locked thead th.sorting_asc,
    #rankTable.dt-locked thead th.sorting_desc,
    #rankTable.dt-locked thead th.dt-orderable,
    #rankTable.dt-locked thead th.dt-ordering-asc,
    #rankTable.dt-locked thead th.dt-ordering-desc {
        background-image: none !important;
    }

    /* Locked sorting visuals */
    #rankTable.dt-locked thead th.locked-sort {
        position: relative;
    }

    #rankTable.dt-locked thead th .locked-sort-icon {
        opacity: .8;
        vertical-align: -2px;
    }

/* Already present: prevent clicks + hide DT sort arrows */
#rankTable.dt-locked thead th {
    pointer-events: none;
    cursor: default;
}

    #rankTable.dt-locked thead th.sorting,
    #rankTable.dt-locked thead th.sorting_asc,
    #rankTable.dt-locked thead th.sorting_desc,
    #rankTable.dt-locked thead th.dt-orderable,
    #rankTable.dt-locked thead th.dt-ordering-asc,
    #rankTable.dt-locked thead th.dt-ordering-desc {
        background-image: none !important;
    }

/* ==========================================================================
   Ad slot spacing (keeps layout tidy)
   ========================================================================== */
.adsbygoogle {
    margin: 10px 0 16px !important;
}

/* Bootstrap-friendly applied state */
.btn-applied {
    background-color: var(--bs-success-bg-subtle);
    color: var(--bs-success-text-emphasis);
    border-color: var(--bs-success-border-subtle);
}

    .btn-applied:hover {
        background-color: color-mix(in srgb, var(--bs-success) 25%, var(--bs-success-bg-subtle));
    }

[data-bs-theme="dark"] .btn-applied {
    background-color: var(--bs-success-bg-subtle);
}

#filterBtn.btn-applied::after {
    content: " ✓";
    font-weight: 600;
}


