﻿/* ── GPPA shared layout ──────────────────────────────────────── */

.gppa-content-section {
    padding: 1.5rem;
}

.gppa-content-title {
    font-size: clamp(1.375rem, 1rem + 1.5vw, 1.75rem);
    font-weight: 700;
    color: var(--gppa-ink);
}

.gppa-content-instruction {
    font-size: 0.9375rem;
    color: var(--gppa-muted);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* Tighten the content sections at mobile widths so cards/tables get the room (#556782).
   Side padding comes from --gppa-content-pad-x, shared with the footer nav row so the heading
   and footer button pairs right-align to the same edge (Kelly 07-10). */
@media (max-width: 767.98px) {
    .gppa-content-section {
        padding: 1rem var(--gppa-content-pad-x, 0.25rem);
    }
}

/* ── Step heading row + relocated nav controls (#556782) ─────────
   Each step's heading is wrapped in .gppa-step-title-row. Below 768px the mock moves the
   Back/Next/Export controls out of the sticky stepper bar to sit beside the heading; the parent
   hands them in via each view's HeaderActions slot, rendered inside .gppa-step-header-actions.
   Global (not scoped) because the wrapper spans four different views and the buttons come from a
   parent-owned RenderFragment that carries no child-scope attribute. */

/* Hidden at >=768px — the controls render in the sticky bar there instead. */
.gppa-step-header-actions {
    display: none;
}

@media (max-width: 767.98px) {
    /* Title on the left, controls pinned right; wrap so a long heading + wide controls (e.g. the
       Summary step's Back + Export Summary) drop the controls to their own line rather than overflow. */
    .gppa-step-title-row {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.5rem 0.75rem;

        /* AC #556782 item 6: the Back/Next controls stick to the top as the user scrolls a long
           rule/remark list, so they never scroll off. The row pins just below the sticky tab bar
           (--gppa-tab-bar-height) — its sticky container is the tall .gppa-content-section, so it
           stays pinned through the whole list. z-index sits below the tab bar (101) so any hairline
           overlap is covered by it; the top shadow fills a sub-pixel gap under the bar with the
           surface colour and the bottom hairline separates the pinned row from the scrolling content. */
        position: sticky;
        top: calc(var(--gppa-sticky-top) + var(--gppa-tab-bar-height, 52px));
        z-index: 100;
        background-color: var(--mud-palette-surface);
        box-shadow: 0 -8px 0 0 var(--mud-palette-surface), 0 1px 0 0 var(--gppa-border);
        padding-block: 0.375rem;
    }

    .gppa-step-header-actions {
        display: flex;
        align-items: center;
        gap: var(--gppa-nav-gap, 1rem);
        margin-left: auto;
    }

    .gppa-step-header-actions .mud-button-root {
        white-space: nowrap;
    }

    /* Title + instruction stack together inside the pinned row — the instruction wraps to its
       own line(s) beside (not into) the Back/Next controls, staying above the row's bottom
       hairline. Mirrors the Rule Search header text block Kelly signed off on (#556782 07-10).
       flex 1 1 0: a long instruction's max-content width would otherwise wrap the controls onto
       their own line; basis 0 keeps them beside the title and lets the text column wrap instead. */
    .gppa-step-header-text {
        flex: 1 1 0;
        min-width: 0;
    }

    /* The instruction's global 1.5rem bottom margin would inflate the pinned row; the row's own
       padding-block owns that spacing. Zeroed only here — at >=768px the instruction is in
       normal flow and keeps its margin to space the content below it. */
    .gppa-step-header-text .gppa-content-instruction {
        margin-bottom: 0;
    }

    /* Summary step: no room at iPhone SE widths for the title and the Back/Export pair on one
       line, so the row stacks — title, instruction, then the controls right-aligned — all still
       above the hairline (#556782 Kelly 07-10). */
    .gppa-step-title-row--stack {
        flex-direction: column;
        align-items: stretch;
    }

    /* In the column direction flex-basis 0 would govern height, not width — size to content. */
    .gppa-step-title-row--stack .gppa-step-header-text {
        flex: 0 0 auto;
    }

    .gppa-step-title-row--stack .gppa-step-header-actions {
        margin-left: 0;
        align-self: flex-end;
    }
}

/* ── GPPA side-panel open buttons (<992px) ───────────────────────
   The Filters (Rule Search) and Summary (Codes/Remarks) buttons that open the side panel
   as a full-viewport overlay. Global (not component-scoped) because the buttons render
   inside three different views and MudButton markup doesn't carry scope attributes. */

.gppa-summary-btn-row {
    margin-bottom: 1rem;
}

/* Below 768px the sticky step heading (title + instruction + hairline) sits directly above this
   row, so give the button's border room to clear the hairline — same clearance as the Rule
   Search Filters button (#556782 Kelly 07-10). */
@media (max-width: 767.98px) {
    .gppa-summary-btn-row {
        margin-top: var(--gppa-below-heading-gap, 0.75rem);
    }
}

/* The mock draws these as neutral outline buttons — dim-grey label + light-grey border, with the
   accent color only on the leading icon — not MudBlazor's default all-primary-blue outlined style
   (#556782). Colors come from the GPPA palette vars (set on .gppa-component, so they cascade here);
   two-class selectors outrank MudBlazor's single-class .mud-button-outlined-primary, so no !important.
   The "Filters 3" count badge keeps its own explicit blue via .gppa-panel-btn-count below. */
.gppa-summary-btn-row .mud-button-root,
.rule-search-filters-btn .mud-button-root {
    color: var(--gppa-dim);
    border-color: var(--gppa-border);
}

    .gppa-summary-btn-row .mud-button-root .mud-icon-root,
    .rule-search-filters-btn .mud-button-root .mud-icon-root {
        color: var(--gppa-blue);
    }

/* Step-nav Back is an outline button, so it takes the same neutral treatment (dim label + grey
   border) as Filters/Summary. Next/Export are filled-primary and deliberately keep the accent
   blue as the primary action (#556782). Targets only the outlined buttons in the nav rows. */
.gppa-navigation-row .mud-button-outlined,
.gppa-step-header-actions .mud-button-outlined {
    color: var(--gppa-dim);
    border-color: var(--gppa-border);
}

/* Count badge on the Filters button (mock: "Filters 3"). Mirrors the side panel's
   .accordion-count pill. */
.gppa-panel-btn-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.375rem;
    margin-left: 0.5rem;
    border-radius: 999px;
    background-color: rgb(202, 220, 233);
    color: #005999;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

/* ── Rule Search: Chapter/Table/Rule info popup ──────────────────
   The rule identifier cell carries an info icon that opens a popup with the
   chapter title, table title, and chapter-guide link. The popup is MudPopover
   content teleported into MudPopoverProvider at the document root, so these
   rules are global (not component-scoped) to reach the rendered card. */

.rule-info-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
    white-space: nowrap;
}

.rule-info-icon {
    color: #5A5A5A;
    padding: 2px;
}

.rule-info-icon:hover {
    color: #1D1D1D;
}

.rule-info-icon:focus-visible,
.gppa-rule-info-close:focus-visible {
    outline: 2px solid #005999;
    outline-offset: 1px;
}

/* The popover surface is provided by our card below, so strip MudPopover's own chrome. */
.gppa-rule-info-popover {
    background-color: transparent;
    box-shadow: none;
    overflow: visible;
}

.gppa-rule-info-popup {
    background-color: #FFFFFF;
    color: #1D1D1D;
    border: 1px solid #E6E6E6;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    padding: 0.75rem 0.875rem;
    max-width: 22rem;
    font-size: 0.8125rem;
    line-height: 1.45;
    text-align: left;
}

.gppa-rule-info-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.gppa-rule-info-text {
    flex: 1 1 auto;
}

.gppa-rule-info-text strong {
    font-weight: 700;
}

.gppa-rule-info-close {
    margin: -0.25rem -0.375rem 0 0;
    color: #5A5A5A;
}

.gppa-rule-info-divider {
    margin: 0.5rem 0;
}

.gppa-rule-info-guide {
    margin-top: 0.5rem;
}

/* Beat MudLink's defaults (Typo.body1 → 16px, underline only on hover): the guide link should
   read at the popup's own text size and be persistently underlined, per the 558557 mocks. */
.gppa-rule-info-popup .fwd-link {
    color: #005999;
    font-weight: 600;
    font-size: 0.8125rem;
    text-decoration: underline !important;
    display: inline-flex;
    align-items: center;
}

/* ── Accessibility utilities ─────────────────────────────────── */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.taag-header{
    height: 60px;
}

.mud-popover:not(.mud-popover-open) {
    top: 0 !important;
    bottom: unset;
}

body {
    font-family: "Public Sans", sans-serif;
}

hr {
    opacity: 1 !important;
}

h1:focus {
    outline: none;
}

span.mud-button-label {
    margin-right: 2px;
    color: #005999 !important;
}

.mud-snackbar {
    min-width: 256px;
    height: auto;
    padding: 0px 14px;
    align-items: normal;
}

.mud-alert-filled-success {
    background-color: #9FD4D1;
    border-left: 10px solid #1A9891;
}

    .mud-alert-filled-success .mud-snackbar-icon {
        color: #1A9891;
    }

.mud-alert-filled-info {
    background-color: #AAD7E5;
    border-left: 10px solid #51ACCA;
}

    .mud-alert-filled-info .mud-snackbar-icon {
        color: #51ACCA;
    }

.mud-alert-filled-warning {
    background-color: #F3E6AA;
    border-left: 10px solid #E6CB52;
}

    .mud-alert-filled-warning .mud-snackbar-icon {
        color: #E6CB52;
    }

.mud-snackbar-content-message {
    color: black;
}

.csv-export-button {
    font-size: 15px;
    margin-left: 12px;
    text-transform: none;
    border-color: #ABABAB;
    color: #005999 !important;
}

    .csv-export-button:focus-visible {
        text-decoration: underline;
        border-color: #005999;
    }

    .csv-export-button:disabled {
        opacity: 0.65 !important;
        pointer-events: none;
        cursor: not-allowed;
        user-select: none;
    }

.chart-view-button {
    border-top-right-radius: 0px;
    border-bottom-right-radius: 0px;
    border-right: none;
    border-color: #ABABAB;
}

    .chart-view-button:focus-visible {
        outline: 1px solid #005999;
    }

    .chart-view-button:disabled {
        opacity: 0.65 !important;
        pointer-events: none;
        cursor: not-allowed;
        user-select: none;
    }

.table-view-button {
    border-top-left-radius: 0px;
    border-bottom-left-radius: 0px;
    border-left: none;
    border-color: #ABABAB;
}

    .table-view-button:focus-visible {
        outline: 1px solid #005999;
    }

    .table-view-button:disabled {
        opacity: 0.65 !important;
        pointer-events: none;
        cursor: not-allowed;
        user-select: none;
    }

.default-container {
    padding-left: 80px;
    padding-right: 80px;
}

.district-of-columbia-text {
    position: absolute;
    right: 0;
    top: 38%;
    font-size: clamp(.2rem, .9vw, .7rem);
    margin-top: 0px;
}

.chart-filter-container {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: nowrap;
}

    .chart-filter-container .chart-data-view-container {
        display: flex;
        align-items: flex-end;
        margin-bottom: 4px;
        margin-top: 12px;
    }

.chart-area-container {
    width: 100%;
    border: 1px solid #E6E6E6;
    border-radius: 7px;
    padding: 48px 36px 24px 36px;
}

.narrative-paragraph {
    font-size: 18px;
    line-height: 1.62;
}

    .narrative-paragraph a {
        color: #005999;
        border-bottom: 1px solid #005999;
    }

.small-narrative-paragraph {
    font-size: 16px;
    line-height: 1.62;
}

.clear-all-filters-button {
    text-decoration: underline !important;
    font-size: 16px;
    color: #005999 !important;
    padding: 0px;
    text-transform: none;
    margin-top: 4px;
    font-family: 'Public Sans';
}

    .clear-all-filters-button:hover {
        background-color: transparent !important;
    }

.kpi-bullet-point {
    min-width: 48px;
    min-height: 48px;
    background-color: #E1E2E2;
    border-radius: 32px;
    margin-right: 16px;
}

.kpi-question {
    font-weight: 700;
    font-size: 40px;
    margin: 0px;
}

.kpi-divider {
    height: 180px;
    margin: 0 32px;
    border-width: 5px;
    border-color: #F1F1F1;
}

.kpi-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    padding: 40px 0px;
}

.kpi-value {
    font-size: 64px;
    color: #005999;
    font-weight: bolder;
    font-family: 'Public Sans';
}

.kpi-description {
    font-size: 32px;
    margin-bottom: 18px;
}

.double-kpi-container {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
}

.double-kpi-divider {
    height: 137px;
    margin: 0 48px;
    border-width: 3px;
    border-color: #E6E6E6;
    margin-top: 12px;
}

.double-kpi-description {
    font-size: 22px;
    margin-bottom: 18px;
}

.chart-area-with-kpi-container {
    width: 100%;
    display: flex;
    align-items: flex-start;
}

    .chart-area-with-kpi-container .chart-area-kpi-container {
        margin-right: 24px;
        min-width: 250px;
        width: 250px;
    }

.chart-area-kpi-container .chart-kpi-divider {
    border-width: 2px;
    width: 180px;
}

.chart-area-kpi-container .chart-area-kpi {
    margin-bottom: 32px;
    margin-right: 16px;
}

.chart-area-with-kpi-area-container {
    border-left: 1px solid #E6E6E6;
    padding-left: 24px;
    width: 90%;
}

.nav-menu-item-with-icon {
    display: inline;
    width: 100%;
    font-size: 16px;
}

    .nav-menu-item-with-icon .nav-menu-item-icon {
        width: 19px !important;
        height: 19px !important;
        margin-left: 4px;
    }

.mud-list-item-icon {
    min-width:40px;
}


.autocomplete-selector .mud-expand-panel-text {
    padding-left: 16px;
}

.autocomplete-selector .active-filters-expansion-panel {
    display: block;
    position: sticky;
    bottom: 0px;
    left: 0px;
    right: 0px;
    border-top: 1px solid #E6E6E6;
    border-radius: 0px;
    max-height: 345px;
    overflow-y: auto;
    overflow-x: hidden;
    background: white;
}

.autocomplete-selector .active-filters-expansion-panel-with-selection .mud-expand-panel .mud-expand-panel-header {
    font-weight: bolder;
    color: #005999;
}

.autocomplete-selector .mud-expand-panel .mud-expand-panel-header .mud-expand-panel-icon {
    display: block;
    fill: #1d1d1d;
    margin-right: 2px;
}

.autocomplete-selector {
    transform: translateY(4px) !important;
    max-height: 345px !important;
}

    .autocomplete-selector .selector-keyword-filter {
        display: block;
    }

.autocomplete-selector .mud-list {
    overflow: hidden;
}

.selector-keyword-filter {
    display: none;
}

.autocomplete-multiselect-container .active-filters-expansion-panel {
    display: none;
}

.autocomplete-selector .active-filters-expansion-panel .mud-panel-expanded {
    height: 345px;
}

.autocomplete-multiselect-container .mud-select {
    height: 0px;
}

.autocomplete-multiselect-container .autocomplete-selector-dropdown {
    height: 0px;
    visibility: hidden;
    margin: 0px;
}

.autocomplete-multiselect-container .autocomplete-text-field {
    margin-top: 4px;
}

.autocomplete-items-container {
    display: none;
}

.autocomplete-selector .autocomplete-items-container {
    max-height: 290px;
    overflow-y: auto;
    overflow-x: hidden;
    display: block;
}

.autocomplete-selector-dropdown .more-results-hint {
    display: none !important;
}

.autocomplete-selector .more-results-hint {
    padding: 8px 16px;
    color: #666;
    font-style: italic;
    border-top: 1px solid #e0e0e0;
    display: block;
}

/* Keyboard-accessibility: visible focus on year/month/day cells and
header navigation buttons. Popovers render at document root, so these
page-level rules apply once the component is rendered on the page.
Targets MudBlazor 8.15.0 picker classes. */
.mud-day:focus,
.mud-day:focus-visible,
.mud-picker-month:focus,
.mud-picker-month:focus-visible,
.mud-picker-year:focus,
.mud-picker-year:focus-visible {
    outline: 2px solid #005999 !important;
    outline-offset: -2px;
    background-color: rgba(0, 89, 153, 0.15) !important;
    border-radius: 4px;
    z-index: 1;
}

.mud-picker-content .mud-primary-text {
    font-weight: 400;
    margin: 0px;
    color: #1d1d1d !important;
    font-size: 16px;
}

.mud-picker-content .mud-typography-h5 {
    font-size: 16px !important;
}

.mud-day.mud-current:focus {
    outline: 2px solid #005999 !important;
    outline-offset: -2px;
    background-color: rgba(0, 89, 153, 0.25) !important;
}

.mud-picker-calendar-header-switch:focus,
.mud-picker-nav-button-prev:focus,
.mud-picker-nav-button-next:focus {
    outline: 2px solid #005999 !important;
    outline-offset: 2px;
    background-color: rgba(0, 89, 153, 0.1);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.data-dictionary-link:focus-visible {
    outline: 1px solid #005999;
}

.pivot-grid {
    border: 1px solid #e0e0e0;
}

    .pivot-grid table {
        table-layout: fixed;
    }

    .pivot-grid .mud-table-child-content {
        padding: 0px !important;
    }

    .pivot-grid th {
        vertical-align: bottom !important;
    }

        .pivot-grid th:first-child {
            width: 48px !important;
        }

    .pivot-grid td:first-child {
        width: 48px !important;
    }

    .pivot-grid .mud-table-container {
        max-height: 600px;
    }

    .pivot-grid .table-header-class {
        width: 155px;
    }

    .pivot-grid .table-header-dimension-class {
        width: 290px;
    }

    .pivot-grid .dimension-cell {
        width: 290px !important;
    }

    .pivot-grid .metric-cell {
        width: 155px !important;
    }

    .pivot-grid .mud-table-root {
        width: fit-content !important;
    }

    .pivot-grid .column-header {
        align-items: flex-end !important;
        font-size: 14px;
    }

        .pivot-grid .column-header .column-options {
            margin-bottom: 12px;
        }

    .pivot-grid .mud-icon-button:disabled {
        display: none;
    }

    .pivot-grid .mud-table-pagination-actions .mud-icon-button:disabled {
        display: initial;
    }


@media (max-width: 600px) {
    .pivot-grid th:first-child {
        width: 100% !important;
    }

    .pivot-grid td {
        width: 100% !important;
    }

        .pivot-grid td:first-child {
            margin-top: 8px;
            width: 100% !important;
        }

    .pivot-grid .dimension-cell {
        width: 100% !important;
    }

    .pivot-grid .metric-cell {
        width: 100% !important;
    }
}

@media screen and (max-width: 1200px) {

    .chart-area-container {
        width: 100%;
        padding: 0px;
        border: none;
    }

    .chart-filter-container {
        flex-wrap: wrap;
    }

    .chart-area-with-kpi-container {
        flex-direction: column;
    }

        .chart-area-with-kpi-container .chart-area-kpi-container {
            width: 100%;
            margin-right: 0px;
        }

    .chart-area-kpi-container .chart-kpi-divider {
        display: none;
    }

    .chart-area-kpi-container .chart-area-kpi {
        margin-bottom: 16px;
        margin-left: 16px;
        margin-right: 16px;
    }

    .chart-area-with-kpi-area-container {
        border: none;
        padding: 0px;
        width: 100%;
    }
}


@media screen and (max-width: 768px) {
    .district-of-columbia-text {
        position: unset;
        font-size: 16px;
        margin-top: 24px;
    }

    .narrative-paragraph {
        font-size: 16px;
        line-height: 1.62;
    }

    .default-container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .kpi-bullet-point {
        min-width: 32px;
        min-height: 32px;
    }

    .kpi-question {
        font-size: 32px;
    }

    .kpi-divider {
        height: 140px;
        margin: 0 16px;
    }

    .kpi-container {
        padding: 0px;
    }

    .kpi-value {
        font-size: 48px;
    }

    .kpi-description {
        font-size: 24px;
    }

    .double-kpi-container {
        flex-direction: column;
        align-items: center;
    }

    .double-kpi-divider {
        margin: 36px 0px;
        width: 70%;
        border-bottom: 3px solid #E6E6E6;
        height: unset;
    }
}