/* Therapist Finder - Front-end Styles */

/* -- Variables ------------------------------------------------------------ */
:root {
    --tf-font-base:        inherit;
    --tf-color-primary:    #2a7ae2;
    --tf-color-primary-hv: #1a5bbf;
    --tf-color-dark:       #1a2540;
    --tf-color-muted:      #555;
    --tf-color-subtle:     #777;
    --tf-color-border:     #dde3eb;
    --tf-color-bg-card:    #fff;
    --tf-color-bg-pill:    #eef2f7;
    --tf-color-bg-pill-on: #2a7ae2;
    --tf-color-pill-on:    #fff;
    --tf-radius-card:      12px;
    --tf-radius-pill:      20px;
    --tf-radius-btn:       6px;
    --tf-photo-size:       120px;
}

/* -- Outer wrapper --------------------------------------------------------- */
.tf-finder {
    font-family: var(--tf-font-base);
    color: var(--tf-color-dark);
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Full-width breakout -- expands past the theme's content container.
   Remove these rules if the page already uses a full-width template. */
.tf-finder--breakout {
    width: 100vw;
    position: relative;
    left: 50%;
    margin-left: -50vw;
    padding: 0 32px;
    max-width: 100vw;
}

/* -- Filter bar ------------------------------------------------------------ */
.tf-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    align-items: flex-start;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--tf-color-border);
}

.tf-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tf-filter-group__label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--tf-color-subtle);
}

.tf-filter-group__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* -- Pill buttons ---------------------------------------------------------- */
.tf-pill {
    display: inline-flex;
    align-items: center;
    background: var(--tf-color-bg-pill);
    border: 1.5px solid transparent;
    border-radius: var(--tf-radius-pill);
    padding: 5px 14px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--tf-color-dark);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    line-height: 1.4;
}

.tf-pill:hover {
    background: #dde8f8;
    border-color: var(--tf-color-primary);
}

.tf-pill[aria-pressed="true"] {
    background: var(--tf-color-bg-pill-on);
    border-color: var(--tf-color-bg-pill-on);
    color: var(--tf-color-pill-on);
}

/* -- Clear button ---------------------------------------------------------- */
.tf-clear-btn {
    align-self: flex-end;
    background: none;
    border: none;
    color: var(--tf-color-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 0;
    text-decoration: underline;
    margin-bottom: 2px;
}

.tf-clear-btn:hover {
    color: var(--tf-color-primary-hv);
}

/* -- Results count --------------------------------------------------------- */
.tf-results-count {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--tf-color-primary);
    margin-bottom: 20px;
}

/* -- Card grid ------------------------------------------------------------- */
.tf-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* -- Individual card ------------------------------------------------------- */
.tf-card {
    background: var(--tf-color-bg-card);
    border: 1px solid var(--tf-color-border);
    border-radius: var(--tf-radius-card);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 20px 20px;
    text-align: center;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

.tf-card:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.tf-card[hidden] {
    display: none;
}

/* -- Photo ----------------------------------------------------------------- */
.tf-card__photo-wrap {
    width: var(--tf-photo-size);
    height: var(--tf-photo-size);
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 16px;
    flex-shrink: 0;
    border: 3px solid var(--tf-color-border);
    transition: border-color 0.2s ease;
}

.tf-card:hover .tf-card__photo-wrap {
    border-color: var(--tf-color-primary);
}

.tf-card__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tf-card__photo--placeholder {
    background: var(--tf-color-bg-pill);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tf-card__photo--placeholder::after {
    content: "\1F9D1\200D\2695\FE0F";
    font-size: 2.5rem;
}

/* -- Card body ------------------------------------------------------------- */
.tf-card__body {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    flex: 1;
}

.tf-card__name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--tf-color-dark);
    margin: 0 0 4px;
    line-height: 1.3;
}

.tf-card__title {
    font-size: 0.85rem;
    color: var(--tf-color-muted);
    margin: 0 0 10px;
}

.tf-card__credentials {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--tf-color-muted);
    margin: 0 0 10px;
}

/* -- Badges ---------------------------------------------------------------- */
.tf-card__badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    margin-bottom: 10px;
}

.tf-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 12px;
    line-height: 1.4;
}

.tf-badge--format {
    background: #e8f0fd;
    color: #1a5bbf;
}

.tf-badge--insurance {
    background: #e8f6ee;
    color: #1a6636;
}

/* -- Specialty tags -------------------------------------------------------- */
.tf-card__tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
}

.tf-tag {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--tf-color-muted);
    background: var(--tf-color-bg-pill);
    border-radius: 10px;
    padding: 2px 10px;
}

/* -- Bio ------------------------------------------------------------------- */
.tf-card__bio {
    font-size: 0.9rem;
    color: var(--tf-color-muted) !important;
    line-height: 1.6;
    margin: 0 0 16px;
    flex: 1;
}

/* -- Action buttons -------------------------------------------------------- */
.tf-card__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-top: auto;
}

.tf-btn {
    display: inline-block;
    width: 100%;
    padding: 10px 16px;
    border-radius: var(--tf-radius-btn);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    box-sizing: border-box;
}

.tf-btn--primary {
    background: var(--tf-color-primary);
    color: #fff;
    border-color: var(--tf-color-primary);
}

.tf-btn--primary:hover {
    background: var(--tf-color-primary-hv);
    border-color: var(--tf-color-primary-hv);
    color: #fff;
    text-decoration: none;
}

.tf-btn--secondary {
    background: transparent;
    color: var(--tf-color-primary);
    border-color: var(--tf-color-border);
}

.tf-btn--secondary:hover {
    border-color: var(--tf-color-primary);
    color: var(--tf-color-primary-hv);
    text-decoration: none;
}

/* -- No-match state -------------------------------------------------------- */
.tf-no-match {
    text-align: center;
    padding: 48px 24px;
    grid-column: 1 / -1;
}

.tf-no-match__message {
    font-size: 1rem;
    color: var(--tf-color-muted);
    margin-bottom: 20px;
}

.tf-no-match .tf-btn {
    display: inline-block;
    width: auto;
    padding: 10px 28px;
}

/* -- Notice (no data configured) ------------------------------------------ */
.tf-notice {
    padding: 16px 20px;
    background: #fff8e1;
    border-left: 4px solid #f5a623;
    border-radius: 4px;
    color: var(--tf-color-dark);
    font-size: 0.9rem;
}

/* -- Responsive ------------------------------------------------------------ */
@media (max-width: 1024px) {
    .tf-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .tf-grid {
        grid-template-columns: 1fr;
    }

    .tf-filters {
        gap: 12px 16px;
    }

    .tf-card {
        padding: 20px 16px 16px;
    }
}

/* -- Compact carousel ------------------------------------------------------ */
.tf-compact {
    display: flex;
    flex-direction: column;
    max-width: 640px;
    font-family: var(--tf-font-base, inherit);
    color: var(--tf-color-dark, #1a2540);
    gap: 8px;
}

/* Row containing arrows + track */
.tf-compact__row {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 185px;
}

/* Clipping wrapper */
.tf-compact__track-wrap {
    flex: 1;
    overflow: hidden;
    height: 100%;
    min-width: 0;
}

/* Sliding row of items -- hidden until JS initialises widths */
.tf-compact__track {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 100%;
    transition: transform 0.3s ease;
    will-change: transform;
    visibility: hidden;
}

.tf-compact__track.is-ready {
    visibility: visible;
}

/* Each therapist slot -- width set by JS based on visible count */
.tf-compact__item {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 8px;
    gap: 4px;
    text-align: center;
    min-width: 0;
    box-sizing: border-box;
    padding-left: 4px;
    padding-right: 4px;
    cursor: pointer;
}

/* Photo */
.tf-compact__photo-wrap {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 3px solid var(--tf-color-border, #dde3eb);
    transition: border-color 0.2s ease;
}

.tf-compact__item:hover .tf-compact__photo-wrap {
    border-color: var(--tf-color-primary, #2a7ae2);
}

.tf-compact__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tf-compact__photo--placeholder {
    background: #eef2f7;
}

/* Text */
.tf-compact__name {
    font-size: 0.78rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    word-break: break-word;
    max-width: 100%;
}

.tf-compact__specs {
    font-size: 0.7rem;
    color: var(--tf-color-muted, #555);
    margin: 0;
    word-break: break-word;
    max-width: 100%;
    line-height: 1.3;
}

/* Arrow buttons -- hidden by default, JS shows when needed */
.tf-compact__arrow {
    flex-shrink: 0;
    background: none;
    border: 1px solid var(--tf-color-border, #dde3eb);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    min-width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    color: var(--tf-color-primary, #2a7ae2);
    padding: 0;
    transition: background 0.15s ease, border-color 0.15s ease;
    visibility: hidden;
}

.tf-compact__arrow.is-visible {
    visibility: visible;
}

.tf-compact__arrow:hover {
    background: #eef2f7;
    border-color: var(--tf-color-primary, #2a7ae2);
}

.tf-compact__arrow[hidden] {
    visibility: hidden;
    display: flex;
}

/* Footer row -- counter left, finder link right */
.tf-compact__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 6px;
    border-top: 1px solid var(--tf-color-border, #dde3eb);
    gap: 8px;
}

.tf-compact__counter {
    font-size: 0.75rem;
    color: var(--tf-color-subtle, #777);
    white-space: nowrap;
    flex-shrink: 0;
}

.tf-compact__hint {
    font-size: 0.75rem;
    color: #111;
    flex: 1;
    text-align: left;
    padding-left: 8px;
}

/* Finder link -- sits in footer row */
.tf-compact__finder-link {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--tf-color-primary, #2a7ae2);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.tf-compact__finder-link:hover {
    color: var(--tf-color-primary-hv, #1a5bbf);
    text-decoration: underline;
}

/* -- Modal ----------------------------------------------------------------- */

/* Overlay */
.tf-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tf-modal[hidden] {
    display: none;
}

.tf-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    cursor: pointer;
}

/* Panel */
.tf-modal__panel {
    position: relative;
    background: #fff;
    border-radius: 14px;
    width: 90%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: row;
    gap: 20px;
    padding: 28px 24px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
    box-sizing: border-box;
    animation: tf-modal-in 0.22s ease;
}

@keyframes tf-modal-in {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Close button */
.tf-modal__close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 1.1rem;
    color: var(--tf-color-subtle, #777);
    cursor: pointer;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.15s ease, background 0.15s ease;
}

.tf-modal__close:hover {
    color: var(--tf-color-dark, #1a2540);
    background: #f0f2f5;
}

/* Photo column */
.tf-modal__photo-wrap {
    flex-shrink: 0;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--tf-color-border, #dde3eb);
    align-self: flex-start;
}

.tf-modal__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Body column */
.tf-modal__body {
    flex: 1;
    min-width: 0;
    word-break: break-word;
    overflow-wrap: break-word;
}

.tf-modal__name {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 2px;
    color: var(--tf-color-dark, #1a2540);
    padding-right: 24px; /* avoid close button */
}

.tf-modal__title {
    font-size: 0.85rem;
    color: var(--tf-color-muted, #555);
    margin: 0 0 10px;
}

.tf-modal__credentials {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--tf-color-muted, #555);
    margin: 0 0 10px;
}

/* Badges row */
.tf-modal__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 12px;
}

/* Bio */
.tf-modal__bio {
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--tf-color-muted, #555);
    margin: 0 0 14px;
}

/* Detail list */
.tf-modal__details {
    margin: 0 0 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tf-modal__detail {
    display: flex;
    gap: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
}

.tf-modal__detail dt {
    font-weight: 600;
    color: var(--tf-color-dark, #1a2540);
    flex-shrink: 0;
    min-width: 90px;
}

.tf-modal__detail dd {
    color: var(--tf-color-muted, #555);
    margin: 0;
}

.tf-modal__detail[hidden] {
    display: none;
}

/* Actions */
.tf-modal__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Mobile -- stack photo above body */
@media (max-width: 600px) {
    .tf-modal__panel {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 24px 18px;
        border-radius: 14px 14px 0 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        max-height: 85vh;
        box-sizing: border-box;
        animation: tf-modal-up 0.25s ease;
    }

    @keyframes tf-modal-up {
        from { opacity: 0; transform: translateY(40px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    .tf-modal__photo-wrap {
        align-self: center;
    }

    .tf-modal__detail {
        flex-direction: column;
        gap: 2px;
        text-align: left;
    }

    .tf-modal__detail dt {
        min-width: unset;
    }

    .tf-modal__badges {
        justify-content: center;
    }

    .tf-modal__name {
        padding-right: 0;
    }
}
