/* =============================================
   THERAPISTS PAGE
   ============================================= */
.therapists-page {
    padding-top: 72px;
    padding-bottom: 80px;
}

.therapists-hero {
    max-width: 920px;
    padding-top: 32px;
}

.hero-tag {
    display: inline-flex;
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--card);
    border: 1px solid var(--border);
    backdrop-filter: blur(18px);
    color: var(--primary);
    font-weight: 800;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
}

.page-title {
    margin-top: 16px;
    font-size: clamp(2.8rem, 6vw, 5.6rem);
    line-height: 0.95;
    letter-spacing: -0.05em;
    max-width: 12ch;
}

.page-text {
    margin-top: 16px;
    max-width: 760px;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--light);
}

/* =============================================
   TOP SEARCH BAR
   ============================================= */
.search-bar-panel {
    margin-top: 28px;
    padding: 16px 20px;
    border-radius: 24px;
    background: var(--card);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.search-wrap {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.18);
    color: var(--text);
    padding: 14px 18px;
    border-radius: 16px;
    outline: none;
    font-family: inherit;
    font-size: 1rem;
    backdrop-filter: blur(14px);
    transition: border-color 0.2s ease;
}
.search-input:focus { border-color: var(--primary); }
.search-input::placeholder { color: var(--light); }

.search-btn {
    border: none;
    padding: 14px 28px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-weight: 800;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: 0.25s ease;
    font-family: inherit;
    white-space: nowrap;
}
.search-btn:hover { transform: translateY(-2px); }

/* =============================================
   MAIN LAYOUT: sidebar + cards
   ============================================= */
.therapist-body {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    align-items: start;
    margin-top: 24px;
}

/* =============================================
   LEFT SIDEBAR
   ============================================= */
.sidebar-filters {
    position: sticky;
    top: 88px;
    border-radius: 24px;
    background: var(--card);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 22px 20px 26px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-filters-title {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--light);
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: -4px;
}

.filter-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--light);
}

/* Price Slider */
.price-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-slider-value {
    font-size: 0.85rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.slider-track-wrap {
    position: relative;
    height: 4px;
    background: var(--border);
    border-radius: 999px;
    overflow: visible;
    margin: 4px 0;
}

.slider-fill {
    position: absolute;
    left: 0; top: 0;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    pointer-events: none;
    transition: width 0.08s ease;
}

.price-slider {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 100%;
    height: 20px;
    opacity: 0;
    cursor: pointer;
    margin: 0; padding: 0;
    -webkit-appearance: none;
    appearance: none;
    z-index: 2;
}

.slider-track-wrap::after {
    content: "";
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px; height: 16px;
    border-radius: 50%;
    background: white;
    border: 2.5px solid var(--primary);
    box-shadow: 0 2px 12px rgba(110,168,254,0.35);
    pointer-events: none;
    left: var(--thumb-pct, 100%);
    transition: left 0.08s ease;
    z-index: 1;
}

.slider-ticks {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    color: var(--light);
    font-weight: 600;
    opacity: 0.65;
    margin-top: 2px;
}

/* Language Pills */
.lang-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.lang-pill {
    padding: 6px 13px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--light);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.lang-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(110, 168, 254, 0.06);
}
.lang-pill.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(110,168,254,0.25);
}

/* Clear button */
.clear-btn {
    width: 100%;
    padding: 10px 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--light);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    margin-top: 4px;
}
.clear-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(110, 168, 254, 0.05);
}

/* =============================================
   RIGHT COLUMN
   ============================================= */
.therapist-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.results-bar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--light);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0 4px 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 18px;
}

/* =============================================
   GRID + CARD — clean SaaS layout
   Works perfectly for 1, 2, 3, or any number of cards.
   Last row always looks intentional, never stretched.
   ============================================= */

/*
 * Pure CSS grid — no flex tricks needed.
 * auto-fill with minmax means:
 *   - Desktop: 3 columns naturally at ~300px each
 *   - Tablet:  2 columns
 *   - Mobile:  1 column
 * Cards NEVER stretch beyond their column. Grid handles everything.
 */
.therapist-grid-advanced {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    align-items: stretch;
    height: 100%;
    justify-content: center; /* lone card centers on page instead of sitting left */
}

/* 1 card alone: cap width so it doesn't go full container width */
.therapist-grid-advanced:has(.therapist-card-advanced:only-child) {
    grid-template-columns: minmax(280px, 420px);
}

/* =============================================
   CARD
   ============================================= */
/* =============================================
   CARD — compact vertical layout
   ============================================= */
.therapist-card-advanced {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    background: var(--card);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    overflow: hidden;
    /* Do NOT set height — let content drive it */
}
.therapist-card-advanced:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.14);
}

/* ── Photo ── */
.therapist-photo-wrap {
    width: 100%;
    /* Use aspect-ratio so the crop is proportional on every screen size.
       4/3 gives a nice portrait frame that shows face + shoulders. */
    aspect-ratio: 4 / 3;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(120,120,140,0.15);
}
.therapist-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* center center = safest default; shows face on most portrait photos.
       center top was cropping chins on mobile because the card is narrower. */
    object-position: center 20%;
    display: block;
    transition: transform 0.35s ease;
}
.therapist-card-advanced:hover .therapist-photo {
    transform: scale(1.03);
}
.therapist-photo-fallback {
    width: 100%;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    font-weight: 900;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    flex-shrink: 0;
}

/* ── Card body ── */
.card-body {
    display: flex;
    flex-direction: column;
    padding: 13px 14px 14px;
    gap: 8px;
}

/* Name */
.card-name-row h3 {
    font-size: 0.97rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--text);
    line-height: 1.2;
    margin: 0 0 2px;
    /* Clamp name to 2 lines max */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Qualification — clamp to 2 lines so long text doesn't blow up card height */
.card-meta-line {
    font-size: 0.74rem;
    color: var(--light);
    font-weight: 500;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Rating */
.card-rating {
    display: flex;
    align-items: center;
    gap: 5px;
}
.card-stars { display: flex; gap: 2px; }
.star { font-size: 0.75rem; line-height: 1; }
.star.filled { color: #f5a623; }
.star.half   { color: #f5a623; opacity: 0.5; }
.star.empty  { color: rgba(255,255,255,0.2); }
.card-rating-num {
    font-weight: 800;
    font-size: 0.8rem;
    color: var(--text);
}

/* Divider */
.card-divider {
    height: 1px;
    background: var(--border);
    flex-shrink: 0;
}

/* ── Expertise — STRICT 3-pill layout ── */
.card-expertise-label {
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 5px;
}

/*
 * Key fix: 3 pills per row, no wrapping beyond first row.
 * We use a grid with 3 equal columns so each pill fills its cell.
 * The "+X more" badge sits in its own cell naturally.
 */
.expertise-pills {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    /* Never more than 2 rows visible */
    max-height: calc(2 * (22px + 4px));
    overflow: hidden;
}

.exp-pill {
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(var(--primary-rgb, 80,180,140), 0.10);
    border: 1px solid rgba(var(--primary-rgb, 80,180,140), 0.24);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}
.exp-pill.more {
    color: var(--light);
    background: transparent;
    border-color: var(--border);
}

/* Info rows */
.card-info-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.card-info-item {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    font-size: 0.76rem;
    color: var(--light);
    line-height: 1.35;
}
.card-info-item .icon { flex-shrink: 0; margin-top: 1px; }

/* ── Bottom: price + availability + CTA ── */
.card-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding-top: 2px;
}

.card-price-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 6px;
    min-height: 34px;
}

.card-price {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    line-height: 1;
}

.card-price-amount {
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-price-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--light);
    opacity: 0.75;
}

.card-available {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--light);
    text-align: right;
    line-height: 1.3;
    flex-shrink: 0;
}

/* Always a dedicated coloured line for the status */
.card-available-when {
    display: block;
    font-size: 0.78rem;
    font-weight: 800;
    margin-top: 1px;
    letter-spacing: -0.01em;
}
.card-available-when.soon   { color: #22c55e; }   /* today / tomorrow / day after */
.card-available-when.future { color: var(--primary); } /* further out — matches brand */

.book-btn {
    width: 100%;
    padding: 10px 10px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    font-weight: 800;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    border: none;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    box-shadow: var(--shadow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-decoration: none;
}
.book-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(0,0,0,0.18);
}

.secondary-mini {
    padding: 7px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.06);
    color: var(--text);
    font-weight: 700;
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.22s ease;
    text-decoration: none;
    width: 100%;
}
.secondary-mini:hover { transform: translateY(-2px); }

/* =============================================
   STATES
   ============================================= */
.state-box {
    margin-top: 16px;
    padding: 32px;
    border-radius: 24px;
    background: var(--card);
    backdrop-filter: blur(22px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    text-align: center;
    color: var(--text);
}
.state-box h3 { font-size: 1.5rem; margin-bottom: 8px; letter-spacing: -0.04em; }
.state-box p  { color: var(--light); line-height: 1.7; }

.hidden { display: none !important; }

.loader {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.22);
    border-top-color: var(--primary);
    margin: 0 auto 14px;
    animation: spin 0.85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =============================================
   PAGINATION
   ============================================= */
.pagination {
    margin-top: 24px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}
.page-btn {
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    padding: 10px 16px;
    min-width: 42px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-family: inherit;
    transition: 0.25s ease;
    backdrop-filter: blur(16px);
}
.page-btn:hover:not(:disabled),
.page-btn.active {
    transform: translateY(-2px);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
}
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* =============================================
   TOAST
   ============================================= */
.page-toast {
    position: fixed;
    top: 88px; right: 22px;
    z-index: 1200;
    max-width: 320px;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--text);
    color: #fff;
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* =============================================
   BOOKING MODAL
   ============================================= */
.booking-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: grid;
    place-items: center;
    padding: 18px;
}
.booking-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10,15,25,0.55);
    backdrop-filter: blur(6px);
}
.booking-modal-card {
    position: relative;
    width: min(100%, 580px);
    background: var(--bg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-radius: 28px;
    padding: 28px;
    z-index: 1;
    max-height: 90vh;
    overflow-y: auto;
}
.booking-modal-close {
    position: absolute;
    top: 14px; right: 14px;
    width: 40px; height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.booking-modal-top {
    display: flex;
    gap: 16px;
    align-items: center;
    padding-right: 48px;
}
.booking-photo-fallback {
    width: 88px; height: 105px;
    border-radius: 16px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-weight: 900;
    font-size: 1.8rem;
    overflow: hidden;
    isolation: isolate;
}
.booking-photo {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}
.booking-kicker {
    display: inline-block;
    color: var(--primary);
    font-weight: 800;
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.booking-modal-head h3 { font-size: 1.35rem; letter-spacing: -0.04em; }
.booking-modal-head p  { margin-top: 4px; color: var(--light); line-height: 1.6; font-size: 0.93rem; }
.booking-modal-body    { margin-top: 18px; }
.booking-modal-body p  { color: var(--text); line-height: 1.75; }
.booking-note {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--border);
    color: var(--light);
    line-height: 1.7;
    font-size: 0.91rem;
}
.booking-modal-actions {
    margin-top: 22px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1100px) {
}

@media (max-width: 960px) {
    .therapist-body { grid-template-columns: 1fr; }
    .sidebar-filters { position: static; }
}

@media (max-width: 820px) {
    .therapists-page { padding-top: 64px; }
    .therapists-hero { padding-top: 20px; }
    .page-title { font-size: clamp(2.5rem, 11vw, 4rem); max-width: 100%; }
    .search-wrap { flex-direction: column; align-items: stretch; }
    .search-btn  { width: 100%; }
    .booking-modal-card    { padding: 22px; border-radius: 22px; }
    .booking-modal-top     { align-items: flex-start; }
    .booking-modal-actions { flex-direction: column; }
    .booking-modal-actions .primary-btn,
    .booking-modal-actions .secondary-btn { width: 100%; }
}

@media (max-width: 600px) {
    .therapists-page { padding-top: 56px; }
    .therapists-hero { padding-top: 16px; }
    .page-title { font-size: clamp(2.2rem, 12vw, 3.4rem); }
    .page-text  { font-size: 0.98rem; }

    /* Full width cards on phone */
    .therapist-grid-advanced { grid-template-columns: 1fr; }

    /* On phone, photo is wider so use a taller aspect ratio
       to give more vertical room for the face */
    .therapist-photo-wrap,
    .therapist-photo-fallback {
        aspect-ratio: 3 / 2;
    }

    .search-wrap { flex-direction: column; align-items: stretch; }
    .search-btn  { width: 100%; }
    .booking-modal-top { flex-direction: column; align-items: flex-start; }
    .booking-photo-fallback { width: 76px; height: 90px; }
    .page-toast { right: 14px; left: 14px; max-width: none; }
}
