/* CQC Tracker - Public Styles */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Open+Sans:wght@400;500;600&display=swap');

:root {
    --cqc-green:        #125035;
    --cqc-green-light:  #1a6b47;
    --cqc-green-pale:   #e8f3ee;
    --cqc-outstanding:  #6a3486;
    --cqc-outstanding-bg: #f3ebf8;
    --cqc-border:       #dde5e9;
    --cqc-bg:           #f6f9f7;
    --cqc-white:        #ffffff;
    --cqc-text:         #125035;
    --cqc-text-muted:   #5a7a6a;
    --cqc-radius:       10px;
    --cqc-shadow:       0 2px 12px rgba(18,80,53,0.10);
}

/* ================================================================
   SNAPSHOT WIDGET
   ================================================================ */
.cqc-snapshot-wrap {
    font-family: 'Open Sans', sans-serif;
    margin: 32px 0;
}

/* Intro heading + paragraph */
.cqc-snapshot-intro {
    margin-bottom: 20px;
}

.cqc-snapshot-intro__heading {
    font-family: 'DM Sans', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--cqc-green);
    margin: 0 0 10px;
    line-height: 1.2;
}

.cqc-snapshot-intro__text {
    font-family: 'Open Sans', sans-serif;
    font-size: 15px;
    color: var(--cqc-text);
    line-height: 1.6;
    margin: 0;
    max-width: 720px;
}

/* Table wrapper — horizontal scroll on mobile */
.cqc-snapshot-table-wrap {
    overflow-x: auto;
    border-radius: var(--cqc-radius);
    box-shadow: var(--cqc-shadow);
    border: 1px solid var(--cqc-border);
    margin-bottom: 20px;
}

/* Provider name link in snapshot table */
.cqc-provider-link {
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    color: var(--cqc-green);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s;
}

.cqc-provider-link:hover {
    border-bottom-color: var(--cqc-green);
}

/* CTA button row */
.cqc-snapshot-cta {
    margin-bottom: 16px;
}

.cqc-btn--full-list {
    display: inline-block;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    padding: 11px 28px;
    background: var(--cqc-green);
    color: #ffffff;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s;
    border: none;
    cursor: pointer;
}

.cqc-btn--full-list:hover {
    background: var(--cqc-green-light);
    color: #ffffff;
}

.cqc-btn--full-list:active {
    transform: scale(0.97);
}

/* ================================================================
   DASHBOARD
   ================================================================ */
.cqc-dashboard-wrap {
    font-family: 'Open Sans', sans-serif;
    color: var(--cqc-text);
    margin: 24px 0;
}

/* Filter Bar */
.cqc-filter-bar {
    background: var(--cqc-green);
    border-radius: var(--cqc-radius);
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: var(--cqc-shadow);
}

.cqc-filter-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.cqc-filter-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 160px;
}

.cqc-filter-group label {
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.75);
    margin-bottom: 6px;
}

.cqc-filter-group select,
.cqc-filter-group input[type="date"] {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 6px;
    color: #ffffff;
    padding: 9px 12px;
    font-family: 'Open Sans', sans-serif;
    font-size: 13px;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    transition: border-color 0.15s;
}

.cqc-filter-group select:focus,
.cqc-filter-group input[type="date"]:focus {
    border-color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.18);
}

.cqc-filter-group select option {
    color: #125035;
    background: #fff;
}

/* colorize placeholder/default for date inputs */
.cqc-filter-group input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.7;
}

.cqc-filter-group--actions {
    flex-direction: row;
    gap: 8px;
    align-items: flex-end;
    flex: 0 0 auto;
}

/* Buttons */
.cqc-btn {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 22px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    transition: background 0.15s, transform 0.1s;
    white-space: nowrap;
}
.cqc-btn--primary {
    background: #fff;
    color: var(--cqc-green);
}
.cqc-btn--primary:hover {
    background: var(--cqc-green-pale);
}
.cqc-btn--secondary {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.4);
}
.cqc-btn--secondary:hover {
    background: rgba(255,255,255,0.1);
}
.cqc-btn:active {
    transform: scale(0.97);
}

/* Results Meta */
.cqc-results-meta {
    font-size: 13px;
    color: var(--cqc-text-muted);
    margin-bottom: 12px;
    min-height: 20px;
}

/* Table */
.cqc-table-wrap {
    overflow-x: auto;
    border-radius: var(--cqc-radius);
    box-shadow: var(--cqc-shadow);
    border: 1px solid var(--cqc-border);
}

.cqc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: var(--cqc-white);
}

.cqc-table thead tr {
    background: var(--cqc-green);
    color: #ffffff;
}

.cqc-table thead th {
    padding: 14px 16px;
    text-align: left;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.cqc-table tbody tr {
    border-bottom: 1px solid var(--cqc-border);
    transition: background 0.1s;
}

.cqc-table tbody tr:last-child {
    border-bottom: none;
}

.cqc-table tbody tr:hover {
    background: var(--cqc-green-pale);
}

.cqc-table tbody td {
    padding: 13px 16px;
    color: var(--cqc-text);
    vertical-align: top;
    line-height: 1.4;
}

.cqc-location-name {
    display: block;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    color: var(--cqc-green);
}

.cqc-provider-name {
    display: block;
    font-size: 12px;
    color: var(--cqc-text-muted);
    margin-top: 2px;
}

/* Outstanding Badge */
.cqc-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.cqc-badge--outstanding {
    background: var(--cqc-outstanding-bg);
    color: var(--cqc-outstanding);
    border: 1px solid rgba(106,52,134,0.25);
}

/* Profile Link */
.cqc-profile-link {
    color: var(--cqc-green);
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s;
    white-space: nowrap;
}
.cqc-profile-link:hover {
    border-bottom-color: var(--cqc-green);
}

/* No Results */
.cqc-no-results {
    padding: 48px 24px;
    text-align: center;
    color: var(--cqc-text-muted);
    background: var(--cqc-white);
    border-radius: var(--cqc-radius);
}

/* Loading state */
.cqc-table-wrap--loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Pagination */
.cqc-pagination {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.cqc-page-btn {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 7px 14px;
    border: 1px solid var(--cqc-border);
    border-radius: 6px;
    background: var(--cqc-white);
    color: var(--cqc-text);
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
    min-width: 36px;
    text-align: center;
}

.cqc-page-btn:hover {
    background: var(--cqc-green-pale);
    border-color: var(--cqc-green);
}

.cqc-page-btn--active {
    background: var(--cqc-green);
    color: #fff;
    border-color: var(--cqc-green);
}

.cqc-page-btn--disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Attribution */
.cqc-attribution {
    font-size: 11px;
    color: var(--cqc-text-muted);
    margin-top: 16px;
    text-align: center;
}
.cqc-attribution a {
    color: var(--cqc-green);
}
/* ================================================================
   RESPONSIVE
   ================================================================ */

/* Tablet (max 1024px) — horizontal scroll on both tables */
@media (max-width: 1024px) {
    .cqc-snapshot-table-wrap,
    .cqc-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .cqc-snapshot-table-wrap .cqc-table,
    .cqc-table-wrap .cqc-table {
        min-width: 700px;
    }
}

/* Mobile (max 768px) — filter bar stacks, tables still scroll horizontally */
@media (max-width: 768px) {

    /* Filter bar */
    .cqc-filter-row {
        flex-direction: column;
    }
    .cqc-filter-group {
        min-width: 100%;
    }
    .cqc-filter-group--actions {
        flex-direction: row;
        width: 100%;
    }
    .cqc-btn {
        flex: 1;
        text-align: center;
    }

    /* Snapshot intro */
    .cqc-snapshot-intro__heading {
        font-size: 20px;
    }

    /* Both tables: thead stays visible, scroll horizontally */
    .cqc-snapshot-table-wrap,
    .cqc-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .cqc-snapshot-table-wrap .cqc-table,
    .cqc-table-wrap .cqc-table {
        min-width: 600px;
    }

    /* thead always visible — no hiding, no stacking */
    .cqc-table thead {
        display: table-header-group;
    }

    .cqc-table thead th {
        white-space: nowrap;
        padding: 12px 12px;
        font-size: 11px;
    }

    /* tbody rows stay as normal table rows */
    .cqc-table tbody tr {
        display: table-row;
        border: none;
        border-radius: 0;
        margin-bottom: 0;
        padding: 0;
        background: transparent;
    }

    .cqc-table tbody td {
        display: table-cell;
        padding: 11px 12px;
        font-size: 12px;
        white-space: nowrap;
    }

    /* Remove data-label pseudo content (not needed with scroll approach) */
    .cqc-table tbody td::before {
        content: none;
    }

    /* Pagination wraps tightly on small screens */
    .cqc-pagination {
        gap: 4px;
    }

    .cqc-page-btn {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 30px;
    }
}