/* =================================================================
   Wheelchair Assessment Form — Dark / Light Compatible
   Uses Bootstrap 5.3 CSS custom properties for full theme support.
   No color-mix(), no absolute connectors, no transform overlap.
   ================================================================= */

.wc-assessment-form {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 15px;
}

/* -----------------------------------------------------------------
   Step Indicators — always visible, solid colours, no opacity tricks
   ----------------------------------------------------------------- */
.wc-steps {
    border-bottom: 2px solid var(--bs-border-color, #dee2e6);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.wc-step-indicator {
    cursor: pointer;
    transition: none;
}

.wc-step-number {
    width: 36px;
    height: 36px;
    background: #e9ecef;
    color: #6c757d;
    font-weight: 700;
    font-size: 14px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wc-step-label {
    font-size: 0.72rem;
    color: #6c757d;
    letter-spacing: 0.02em;
}

/* Active step — blue circle */
.wc-step-indicator.active .wc-step-number {
    background: #0d6efd;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.2);
}

.wc-step-indicator.active .wc-step-label {
    color: #0d6efd;
    font-weight: 600;
}

/* Completed step — green circle with checkmark */
.wc-step-indicator.completed .wc-step-number {
    background: #198754;
    color: #fff;
}

.wc-step-indicator.completed .wc-step-label {
    color: #198754;
    font-weight: 500;
}

/* -----------------------------------------------------------------
   Step panels — NO animation (animation creates stacking context
   that traps z-index, breaking search dropdowns)
   ----------------------------------------------------------------- */
.wc-step {
    position: relative;
}

/* -----------------------------------------------------------------
   Step 1 Section Cards  (Client, Equipment)
   ----------------------------------------------------------------- */
.wc-section-card {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
}

.wc-section-card > .card-header {
    background: var(--bs-tertiary-bg);
    border-bottom: 1px solid var(--bs-border-color);
    padding: 0.65rem 1rem;
    border-radius: 0.75rem 0.75rem 0 0;
}

.wc-section-card > .card-header h5 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--bs-body-color);
}

.wc-section-card > .card-body {
    padding: 1rem;
}

/* -----------------------------------------------------------------
   Radio Buttons as Toggles — hardcoded colours, no CSS variables.
   JS sets inline styles as belt-and-suspenders.
   ----------------------------------------------------------------- */
.wc-radio-btn {
    position: relative;
    padding: 0.5rem 1rem;
    border: 2px solid #0d6efd;
    color: #0d6efd;
    background: transparent;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.wc-radio-btn input[type="radio"] {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
    margin: 0;
    padding: 0;
}

/* Primary variant — selected */
.wc-radio-btn.active {
    background-color: #0d6efd !important;
    color: #fff !important;
    border-color: #0d6efd !important;
}

/* Secondary variant (.btn-outline-secondary) — unselected */
.wc-radio-btn.btn-outline-secondary {
    border-color: #6c757d;
    color: #6c757d;
}

/* Secondary variant — selected */
.wc-radio-btn.btn-outline-secondary.active {
    background-color: #6c757d !important;
    color: #fff !important;
    border-color: #6c757d !important;
}

/* -----------------------------------------------------------------
   Measurement Fields
   ----------------------------------------------------------------- */
.wc-measurement-field {
    background: var(--bs-tertiary-bg);
    transition: border-color 0.2s, box-shadow 0.2s;
    border-radius: 0.5rem !important;
}

.wc-measurement-field:focus-within {
    border-color: var(--bs-primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.12);
}

.wc-upcharge-badge {
    white-space: nowrap;
    font-size: 0.75rem;
}

/* -----------------------------------------------------------------
   Option Cards  (seating sections, ADP options, accessories)
   ----------------------------------------------------------------- */
.wc-option-card {
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem !important;
    background: var(--bs-body-bg);
}

.wc-option-card:hover {
    border-color: rgba(var(--bs-primary-rgb), 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.wc-option-card.border-primary {
    border-width: 2px !important;
    border-color: var(--bs-primary) !important;
    background-color: var(--bs-primary-bg-subtle) !important;
}

.wc-option-card .card-body {
    padding: 0.625rem 0.75rem !important;
}

/* Option card label */
.wc-option-label {
    font-size: 0.82rem;
    line-height: 1.4;
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
}

/* ── Compact option cards (seating tabs) ── */
.wc-option-compact {
    padding: 0.45rem 0.6rem !important;
    border-radius: 0.375rem !important;
    border: 1px solid #e0e0e0 !important;
    background: #fff;
    transition: border-color 0.15s, background-color 0.15s;
}

.wc-option-compact:hover {
    border-color: #adb5bd !important;
    background: #f8f9fa;
}

.wc-option-compact .form-check-input:checked ~ .form-check-label {
    color: #0d6efd;
}

.wc-option-card.wc-option-compact .form-check-input:checked {
    /* parent card highlight when checked */
}

.wc-options-grid .col-md-4 {
    padding-bottom: 0.15rem;
}

.wc-option-compact .form-check {
    min-height: auto;
}

.wc-option-compact .form-check-input {
    width: 0.9em;
    height: 0.9em;
    margin-top: 0.2em;
}

.wc-option-compact .wc-opt-label {
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.3;
    display: block;
}

.wc-option-compact .wc-opt-meta {
    font-size: 0.7rem;
    line-height: 1.2;
    margin-left: 1.35em;
    margin-top: 0.15rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.wc-option-compact .wc-opt-adp {
    font-size: 0.7rem;
}

/* Checked card highlight */
.wc-option-compact:has(.form-check-input:checked) {
    border-color: #198754 !important;
    background: #f0faf4;
}

/* ── Collapsible section groups (accordion within tab) ── */
.wc-section-groups {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.wc-section-group {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.wc-group-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: none;
    background: #f0f0f0;
    color: #333;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s;
}

.wc-group-header:hover {
    background: #e2e2e2;
}

.wc-section-group.open > .wc-group-header {
    background: #2c3e50;
    color: #fff;
}

.wc-section-group.open > .wc-group-header:hover {
    background: #34495e;
}

.wc-group-icon {
    width: 18px;
    text-align: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.wc-group-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wc-group-count {
    display: none;
    font-size: 0.65rem;
    font-weight: 700;
    background: #fff;
    color: #2c3e50;
    border-radius: 999px;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    padding: 0 6px;
    flex-shrink: 0;
}

.wc-section-group.has-selection > .wc-group-header .wc-group-count {
    display: inline-block;
}

/* When closed + has selections: green accent */
.wc-section-group.has-selection:not(.open) > .wc-group-header {
    background: #d1e7dd;
    color: #0f5132;
}

.wc-section-group.has-selection:not(.open) > .wc-group-header .wc-group-count {
    background: #198754;
    color: #fff;
}

.wc-group-chevron {
    font-size: 0.7rem;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.wc-section-group.open > .wc-group-header .wc-group-chevron {
    transform: rotate(180deg);
}

.wc-group-body {
    display: none;
    padding: 0.75rem;
}

.wc-section-group.open > .wc-group-body {
    display: block;
}

/* ── Real-time filter ── */
.wc-option-filter-wrap {
    max-width: 300px;
}

.wc-option-filter-wrap .input-group-text {
    background: transparent;
    border-right: none;
    color: var(--bs-secondary-color);
    padding: 0.25rem 0.5rem;
}

.wc-option-filter-wrap .wc-option-filter {
    border-left: none;
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
}

.wc-option-filter-wrap .wc-option-filter:focus {
    box-shadow: none;
    border-color: var(--bs-primary);
}

.wc-option-filter-wrap .wc-option-filter:focus + .input-group-text,
.wc-option-filter-wrap .input-group:focus-within .input-group-text {
    border-color: var(--bs-primary);
}

/* -----------------------------------------------------------------
   Search Containers — z-index must beat ALL sibling content below.
   position:relative creates a stacking context so the absolute
   dropdown inside floats above everything that follows.
   ----------------------------------------------------------------- */
.wc-search-container {
    position: relative;
    z-index: 100;
}

/* -----------------------------------------------------------------
   Search Dropdowns  (client, frame, section product search)
   position:absolute + high z-index within the search container
   ----------------------------------------------------------------- */
.wc-search-results,
#clientSearchResults,
#frameSearchResults {
    position: absolute;
    z-index: 1060;
    width: 100%;
    background: var(--bs-body-bg);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
    border-radius: 0 0 0.5rem 0.5rem;
    border: 1px solid var(--bs-border-color);
    border-top: none;
    max-height: 300px;
    overflow-y: auto;
}

.wc-search-results .list-group-item,
#clientSearchResults .list-group-item,
#frameSearchResults .list-group-item {
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    border-color: var(--bs-border-color);
    transition: background 0.1s ease;
    cursor: pointer;
}

.wc-search-results .list-group-item:hover,
#clientSearchResults .list-group-item:hover,
#frameSearchResults .list-group-item:hover {
    background: var(--bs-tertiary-bg);
}

/* -----------------------------------------------------------------
   Selected Frame Card
   ----------------------------------------------------------------- */
#selectedFrame > .card {
    border-left: 4px solid var(--bs-primary);
    background: var(--bs-primary-bg-subtle);
    border-radius: 0.5rem;
}

/* -----------------------------------------------------------------
   Frame Configurator Panel
   ----------------------------------------------------------------- */
.wc-configurator-panel {
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 0.75rem;
}

.wc-configurator-panel .wc-config-title {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bs-secondary-color);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.wc-configurator-panel .wc-config-title i {
    color: var(--bs-primary);
}

.wc-config-attr-group {
    margin-bottom: 0.625rem;
}

.wc-config-attr-group .wc-config-attr-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bs-secondary-color);
    margin-bottom: 0.25rem;
}

.wc-config-attr-group .form-select {
    border-color: var(--bs-border-color);
    background-color: var(--bs-body-bg);
    font-size: 0.875rem;
    border-radius: 0.375rem;
}

.wc-config-attr-group .form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.12);
}

.wc-variant-resolved {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.35em 0.65em;
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(var(--bs-success-rgb), 0.1);
    color: var(--bs-success);
    border: 1px solid rgba(var(--bs-success-rgb), 0.25);
    border-radius: 2rem;
    margin-top: 0.5rem;
}

/* -----------------------------------------------------------------
   Seating Side Tabs  (responsive vertical tabs)
   Desktop: side nav left + content right
   Mobile:  horizontal scrollable tabs on top + content below
   ----------------------------------------------------------------- */

/* ── Container ── */
.wc-seating-tabs {
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.75rem;
    overflow: hidden;
    background: var(--bs-body-bg);
}

.wc-seating-tabs > .row {
    min-height: 400px;
}

/* ── Tab Navigation Column ── */
.wc-tab-nav-col {
    background: var(--bs-tertiary-bg, #f8f9fa);
    border-right: 1px solid var(--bs-border-color, #dee2e6);
}

.wc-tab-nav {
    padding: 0.5rem 0;
    gap: 2px;
}

/* ── Individual Tab Button ── */
.wc-tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: none;
    background: transparent;
    color: var(--bs-body-color);
    font-size: 0.82rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
    border-left: 3px solid transparent;
    white-space: nowrap;
}

.wc-tab-btn:hover {
    background: rgba(var(--bs-primary-rgb), 0.06);
}

.wc-tab-btn.active {
    background: var(--bs-body-bg, #fff);
    color: var(--bs-primary);
    font-weight: 600;
    border-left-color: var(--bs-primary);
    box-shadow: 1px 0 0 var(--bs-body-bg, #fff);
}

.wc-tab-icon {
    width: 18px;
    text-align: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.wc-tab-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Badge showing selected items count — hidden when 0 */
.wc-tab-badge {
    display: none;
    font-size: 0.68rem;
    font-weight: 700;
    background: var(--bs-primary);
    color: #fff;
    border-radius: 999px;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    padding: 0 5px;
    flex-shrink: 0;
}

.wc-tab-badge.has-items {
    display: inline-block;
}

/* ── Tab Content Column ── */
.wc-tab-content-col {
    min-height: 100%;
}

.wc-tab-content {
    padding: 1.25rem;
    position: relative;
}

/* ── Tab Panels ── */
.wc-tab-panel {
    display: none;
}

.wc-tab-panel.active {
    display: block;
}

.wc-tab-panel-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
    color: var(--bs-body-color);
}

/* ── MOBILE: horizontal scrollable tabs ── */
@media (max-width: 767.98px) {
    .wc-seating-tabs > .row {
        min-height: auto;
        flex-direction: column;
    }

    .wc-tab-nav-col {
        border-right: none;
        border-bottom: 1px solid var(--bs-border-color, #dee2e6);
        width: 100%;
        max-width: 100%;
        flex: 0 0 auto;
    }

    .wc-tab-nav {
        flex-direction: row !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 0;
        gap: 0;
    }

    .wc-tab-nav::-webkit-scrollbar {
        display: none;
    }

    .wc-tab-btn {
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
        padding: 0.625rem 0.75rem;
        min-width: 72px;
        border-left: none;
        border-bottom: 3px solid transparent;
        font-size: 0.7rem;
        text-align: center;
        white-space: nowrap;
    }

    .wc-tab-btn.active {
        border-left-color: transparent;
        border-bottom-color: var(--bs-primary);
        box-shadow: none;
    }

    .wc-tab-icon {
        font-size: 1.1rem;
    }

    .wc-tab-content-col {
        width: 100%;
        max-width: 100%;
        flex: 1 1 auto;
    }

    .wc-tab-content {
        padding: 1rem 0.75rem;
    }
}

/* -----------------------------------------------------------------
   Review Table  (Step 6)
   ----------------------------------------------------------------- */
#reviewSummary .table th {
    background: var(--bs-tertiary-bg);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--bs-secondary-color);
}

/* Review measurements card */
.wc-step[data-step="6"] .card {
    border-color: var(--bs-border-color);
    border-radius: 0.5rem;
}

.wc-step[data-step="6"] .card-header {
    background: var(--bs-tertiary-bg);
    border-bottom-color: var(--bs-border-color);
}

/* -----------------------------------------------------------------
   Navigation Buttons
   ----------------------------------------------------------------- */
.wc-assessment-form .border-top {
    border-color: var(--bs-border-color) !important;
}

/* -----------------------------------------------------------------
   Responsive
   ----------------------------------------------------------------- */
@media (max-width: 768px) {
    .wc-step-label {
        display: none;
    }

    .wc-step-number {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .wc-radio-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.85rem;
    }

    .wc-option-label {
        font-size: 0.8rem;
    }

    .wc-configurator-panel {
        padding: 0.75rem;
    }
}
