/* assets/css/stats-member-practice-checklist.css */

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background:
        radial-gradient(1200px 800px at 20% -10%, rgba(96, 165, 250, .12), transparent 60%),
        radial-gradient(1200px 800px at 90% 10%, rgba(34, 197, 94, .10), transparent 55%),
        radial-gradient(900px 700px at 50% 120%, rgba(234, 179, 8, .08), transparent 60%),
        var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    overflow: auto;
}

.pageMain--search {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.panel {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.05),
            rgba(255, 255, 255, 0.03));
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
    overflow: visible;
}

.panelHead {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.panelHead h2 {
    margin: 0;
    font-size: 18px;
}

.panelSub {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.panelBody {
    padding: 18px;
}

.advancedSearchForm {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    align-items: flex-end;
}

.searchField {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 0 0 auto;
}

.searchField--wide {
    min-width: 260px;
    flex: 1 1 260px;
}

.searchField label {
    font-size: 14px;
    opacity: 0.75;
    color: var(--muted);
    font-weight: 600;
}

.searchWrap--field {
    width: 100%;
}

.searchField input[type="search"],
.searchField select {
    width: auto;
    min-width: 130px;
    max-width: 220px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border-radius: 10px;
    padding: 0 12px;
    font-size: 14px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

#memberSearchInput,
#tuneSearchInput {
    min-width: 180px;
    max-width: 240px;
}

.searchField--wide input,
.searchField--wide .searchWrap--field {
    width: 100%;
}

.searchField--wide .autocompleteShell {
    min-width: 0;
}

.searchField input:focus,
.searchField select:focus {
    outline: none;
    border-color: rgba(96, 165, 250, 0.75);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.16);
}

.searchField select,
.searchField select option {
    background-color: #111827;
    color: #e5e7eb;
}

.searchActions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
    margin-left: auto;
}

#resetFormBtn,
#resetFiltersBtn {
    height: 38px;
    padding: 0 14px;
    border-radius: 10px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    transition: all 0.15s ease;
}

#resetFormBtn:hover,
#resetFiltersBtn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Checklist Section */
.checklistCard {
    border: 1px solid rgba(138, 180, 255, 0.2);
    background: rgba(138, 180, 255, 0.02);
    border-radius: var(--radius);
    padding: 20px;
}

.checklistHeader {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.checklistHeader h3 {
    margin: 0 0 4px 0;
    font-size: 20px;
    font-weight: 700;
}

.progressBarContainer {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    overflow: hidden;
    margin-top: 8px;
}

.progressBar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #8ab4ff, #00f2fe);
    transition: width 0.3s ease;
}

.actionBtns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.actionBtn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.actionBtn:hover {
    background: rgba(96, 165, 250, 0.2);
    border-color: rgba(96, 165, 250, 0.4);
}

.actionBtn.primaryBtn {
    background: rgba(138, 180, 255, 0.12);
    border-color: rgba(138, 180, 255, 0.3);
    color: var(--accent);
}

.actionBtn.primaryBtn:hover {
    background: rgba(138, 180, 255, 0.22);
    border-color: rgba(138, 180, 255, 0.5);
}

.actionBtn svg {
    display: block;
    flex: 0 0 auto;
}

.tune-checkbox {
    transform: scale(1.3);
    cursor: pointer;
}

.checklist-row.checked td {
    opacity: 0.5;
    text-decoration: line-through;
}

/* Results Table */
.panelBody--results {
    padding-top: 12px;
}

.tableWrap {
    overflow: auto;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.statsTable {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    background: rgba(255, 255, 255, 0.03);
}

.statsTable th,
.statsTable td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: middle;
    line-height: 1.25;
    text-align: left;
}

.statsTable th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #0f1115;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.statsTable tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.statsTable tr:last-child td {
    border-bottom: none;
}

.tuneLink {
    color: var(--text);
    font-weight: 700;
    text-decoration: none;
}

.tuneLink:hover {
    color: #93c5fd;
    text-decoration: underline;
}

.typePill,
.modePill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    white-space: nowrap;
}

.typePill {
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.28);
    color: #fde68a;
}

.modePill {
    background: rgba(167, 139, 250, 0.14);
    border-color: rgba(167, 139, 250, 0.28);
    color: #ddd6fe;
}

.actionLink {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.1s ease;
}

.actionLink:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    text-decoration: none;
}

.highlightText {
    color: var(--accent);
    font-weight: 600;
    font-size: 14px;
}

/* Empty States */
.emptyState,
.errorState,
.loadingState {
    text-align: center;
    padding: 30px 14px;
    color: var(--muted);
    font-size: 14px;
}

.errorState {
    color: var(--bad);
}

.loadingState {
    color: var(--accent);
}

/* Responsive styles */
@media (max-width: 900px) {
    .advancedSearchForm {
        align-items: stretch;
    }

    .searchField,
    .searchField--wide {
        flex: 1 1 calc(50% - 12px);
        min-width: 180px;
    }

    .searchActions {
        margin-left: 0;
    }
}

@media (max-width: 700px) {
    .searchField--wide {
        flex: 1 1 100%;
        min-width: 100%;
    }

    .searchField:not(.searchField--wide) {
        flex: 1 1 calc(50% - 12px);
        min-width: 140px;
    }

    .searchActions {
        flex: 1 1 100%;
        margin-left: 0;
    }

    .panelHead {
        padding-left: 14px;
        padding-right: 14px;
        flex-direction: column;
        gap: 8px;
    }

    .panelBody {
        padding-left: 14px;
        padding-right: 14px;
    }

    .statsTable th:nth-child(4),
    .statsTable td:nth-child(4),
    .statsTable th:nth-child(5),
    .statsTable td:nth-child(5) {
        display: none;
    }

    .checklistHeader {
        flex-direction: column;
        align-items: stretch;
    }

    .actionBtns {
        margin-top: 10px;
    }
}

/* Print Stylesheet */
@media print {
    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 11pt !important;
    }

    .no-print,
    .header,
    .homeBtn,
    .statsBtn,
    .burgerWrap,
    .footer,
    .actionBtns,
    .searchPanel,
    .filtersPanel,
    td.no-print,
    th.no-print {
        display: none !important;
    }

    .wrap,
    .main,
    .pageMain,
    .panel,
    .resultsPanel,
    .panelBody,
    .tableWrap,
    .checklistCard {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        background: none !important;
        box-shadow: none !important;
        color: #000 !important;
    }

    .checklistCard {
        margin-bottom: 20px !important;
        border-bottom: 2px dashed #000 !important;
        padding-bottom: 12px !important;
    }

    .progressBarContainer {
        display: none !important;
    }

    .statsTable {
        width: 100% !important;
        border: 1px solid #000 !important;
        background: #fff !important;
        color: #000 !important;
        border-collapse: collapse !important;
    }

    .statsTable th,
    .statsTable td {
        border-bottom: 1px solid #000 !important;
        border-right: 1px solid #e0e0e0 !important;
        color: #000 !important;
        padding: 6px 10px !important;
    }

    .statsTable th {
        background: #f0f0f0 !important;
        font-weight: 700 !important;
    }

    .statsTable tr:last-child td {
        border-bottom: 1px solid #000 !important;
    }

    .checklist-row.checked td {
        opacity: 0.6 !important;
        text-decoration: line-through !important;
    }

    .tuneLink {
        color: #000 !important;
        text-decoration: underline !important;
    }

    .typePill,
    .modePill {
        border: none !important;
        background: none !important;
        color: #000 !important;
        padding: 0 !important;
        font-size: 11pt !important;
    }

    /* Print overrides for filtered progress and active filters description */
    body.is-filtered #progressText {
        display: none !important;
    }
    body.is-filtered #filteredProgressText {
        display: block !important;
        font-weight: bold !important;
        color: #000 !important;
        font-size: 12pt !important;
    }

    #activeFilters {
        display: block !important;
        margin: 10px 0 !important;
        font-size: 11pt !important;
        color: #000 !important;
        border-bottom: 1px solid #000 !important;
        padding-bottom: 6px !important;
    }
    #activeFilters::before {
        content: "Active Filters: ";
        font-weight: bold;
    }
    #activeFilters:empty {
        display: none !important;
    }
}

/* Screen style for filtered progress text */
.filteredProgressText {
    margin-top: 4px;
    font-size: 13px;
    color: var(--accent);
    opacity: 0.9;
}
