/* ============================================================
   Public mentor directory. Builds on the tokens in styles.css.
   ============================================================ */
.dir-main { background: var(--canvas); padding: 40px 0 96px; min-height: 60vh; }
.dir-layout { display: grid; grid-template-columns: 290px 1fr; gap: 28px; align-items: start; }

/* ---------- account chip in the header ---------- */
.dir-account { display: flex; align-items: center; gap: 10px; }
.dir-account-name {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: .88rem; color: var(--ink); font-weight: 700;
}
.dir-account-name::before {
    content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--success);
    box-shadow: 0 0 0 3px var(--success-bg);
}
.dir-account .dir-btn { flex: none; padding: 8px 14px; font-size: .86rem; }
.dir-link-btn {
    background: none; border: none; color: var(--brand);
    font-size: .86rem; font-weight: 700; cursor: pointer; padding: 0;
}
.dir-link-btn:hover { text-decoration: underline; }

/* ---------- filters ---------- */
.dir-filters {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-lg); padding: 22px;
    position: sticky; top: calc(var(--header-h) + 20px);
    box-shadow: var(--shadow-xs);
}
.dir-filter-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.dir-filter-head h2 { font-size: 1.05rem; font-weight: 800; display: inline-flex; align-items: center; gap: 8px; }
.dir-filter-head h2::before {
    content: "tune"; font-family: "Material Symbols Outlined"; font-weight: normal; font-size: 20px;
    color: var(--brand); -webkit-font-feature-settings: "liga"; font-feature-settings: "liga";
}
.dir-filters .form-group { margin-bottom: 16px; }
.dir-filters label { font-size: .82rem; }
.dir-filters label strong { color: var(--brand); }
.dir-filters input[type=range] { width: 100%; margin-top: 6px; }
.dir-result-count {
    font-size: .85rem; color: var(--muted); font-weight: 600; padding-top: 14px;
    border-top: 1px solid var(--line); margin: 0;
}

/* ---------- grid ---------- */
.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.dir-card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-lg); padding: 22px; display: flex; flex-direction: column;
    box-shadow: var(--shadow-xs);
    transition: border-color .2s, box-shadow .2s, transform .2s;
}
.dir-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--brand-200); }
.dir-card-top { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.dir-avatar {
    width: 58px; height: 58px; border-radius: 16px; flex-shrink: 0; overflow: hidden;
    background: linear-gradient(135deg, var(--brand-100), var(--brand-50)); color: var(--brand-700);
    display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; letter-spacing: .02em;
}
.dir-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dir-card-name {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px;
    font-size: 1.08rem; font-weight: 800; color: var(--ink); line-height: 1.25;
}
.dir-card-sub { font-size: .86rem; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.dir-card-rate {
    display: inline-flex; align-items: baseline; gap: 2px; margin-top: 8px;
    font-size: 1rem; font-weight: 800; color: var(--ink);
    background: var(--canvas); border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px;
}
.dir-card-rate span { font-size: .78rem; font-weight: 600; color: var(--muted); }
.dir-card-bio {
    font-size: .92rem; color: var(--text); line-height: 1.6; flex: 1;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.dir-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 18px; }
.dir-chip {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 999px;
    padding: 3px 11px; font-size: .78rem; font-weight: 600; color: var(--brand-700);
}
.dir-card-foot { display: flex; gap: 8px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.dir-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: 1px solid transparent; border-radius: 999px; padding: 10px 16px; flex: 1;
    font-size: .9rem; font-weight: 700; cursor: pointer; text-decoration: none;
    transition: background .15s, border-color .15s, color .15s;
}
.dir-btn .material-symbols-outlined { font-size: 18px; }
.dir-btn:disabled { opacity: .6; cursor: not-allowed; }
.dir-btn-primary { background: var(--brand); color: #fff; }
.dir-btn-primary:hover:not(:disabled) { background: var(--brand-600); }
.dir-btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.dir-btn-ghost:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }

.dir-verified {
    display: inline-flex; align-items: center; gap: 3px; font-size: .72rem; font-weight: 800;
    background: var(--success-bg); color: var(--success); border-radius: 999px; padding: 2px 9px 2px 6px;
    text-transform: uppercase; letter-spacing: .03em;
}
.dir-verified .material-symbols-outlined { font-size: 14px; }

/* ---------- modals ---------- */
.dir-backdrop { position: fixed; inset: 0; background: rgba(12, 26, 74, .45); backdrop-filter: blur(3px); z-index: 1500; }
.dir-modal {
    position: fixed; z-index: 1600; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: min(500px, calc(100% - 32px)); max-height: calc(100dvh - 48px); overflow-y: auto;
    background: var(--surface); border-radius: var(--radius-xl); padding: 32px;
    box-shadow: var(--shadow-lg); animation: dirPop .2s ease;
}
@keyframes dirPop { from { opacity: 0; transform: translate(-50%, calc(-50% + 12px)); } to { opacity: 1; transform: translate(-50%, -50%); } }
.dir-modal-wide { width: min(780px, calc(100% - 32px)); }
.dir-close {
    position: absolute; top: 16px; right: 16px; background: var(--canvas); border: none;
    cursor: pointer; color: var(--muted); width: 38px; height: 38px;
    border-radius: 50%; display: grid; place-items: center; z-index: 1;
}
.dir-close:hover { background: var(--line); color: var(--ink); }
.dir-modal-title { font-size: 1.4rem; font-weight: 800; margin-bottom: 18px; padding-right: 44px; }
.dir-form .submit-btn { margin-top: 6px; }

/* ---------- profile ---------- */
.dir-profile-head {
    display: flex; gap: 18px; align-items: center;
    margin: -32px -32px 24px; padding: 32px 32px 24px;
    background: linear-gradient(180deg, var(--brand-50), var(--surface));
    border-bottom: 1px solid var(--line);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.dir-profile-head .dir-avatar { width: 84px; height: 84px; border-radius: 22px; font-size: 1.5rem; box-shadow: var(--shadow-sm); }
.dir-profile-head h2 { font-size: 1.5rem; font-weight: 800; }
.dir-section { margin-bottom: 22px; }
.dir-section-label {
    font-size: .72rem; font-weight: 800; color: var(--muted);
    text-transform: uppercase; letter-spacing: .1em; margin-bottom: 8px;
}
.dir-section-body { color: var(--ink); font-size: .96rem; line-height: 1.65; white-space: pre-wrap; }
.dir-section .dir-chips { margin: 0; }
.dir-record { border-left: 3px solid var(--brand-200); padding: 2px 0 2px 14px; margin-bottom: 12px; }
.dir-record strong { color: var(--ink); font-size: .95rem; }
.dir-record span { display: block; color: var(--muted); font-size: .86rem; }

/* ---------- availability ---------- */
.dir-day { margin-bottom: 14px; }
.dir-day-label { font-size: .85rem; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.dir-slots { display: flex; flex-wrap: wrap; gap: 8px; }
.dir-slot {
    background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
    padding: 8px 14px; font-size: .88rem; font-weight: 700;
    color: var(--ink); cursor: pointer; transition: all .15s ease;
}
.dir-slot:hover { border-color: var(--brand); color: var(--brand); }
.dir-slot.is-selected { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: var(--ring); }
.dir-no-slots {
    color: var(--muted); font-size: .92rem; background: var(--canvas); border: 1px dashed var(--line-strong);
    border-radius: var(--radius); padding: 14px 16px;
}

.dir-profile-actions {
    position: sticky; bottom: -32px; margin: 0 -32px -32px; padding: 14px 32px 20px;
    display: grid; gap: 10px; background: var(--surface); border-top: 1px solid var(--line);
    box-shadow: 0 -12px 24px -18px rgba(15, 23, 42, .25);
}
.dir-profile-buttons { display: flex; gap: 10px; }
.dir-choice {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-size: .92rem; color: var(--muted); min-height: 24px;
}
.dir-choice strong { color: var(--ink); }
.dir-choice .material-symbols-outlined { color: var(--success); font-size: 20px; }
.dir-choice-price { margin-left: auto; font-weight: 800; color: var(--brand); }
.dir-reassure {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    font-size: .8rem; color: var(--muted); text-align: center; margin: 0;
}
.dir-reassure .material-symbols-outlined { font-size: 16px; color: var(--success); }

/* ---------- auth tabs ---------- */
.dir-tabs { display: flex; gap: 4px; margin-bottom: 18px; padding: 4px; background: var(--canvas); border-radius: 999px; margin-right: 44px; }
.dir-tab {
    flex: 1; border: none; background: transparent;
    color: var(--muted); padding: 9px 10px; border-radius: 999px;
    font-size: .9rem; font-weight: 700; cursor: pointer;
}
.dir-tab.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- booking summary ---------- */
.dir-summary {
    background: var(--canvas); border: 1px solid var(--line);
    border-radius: var(--radius-lg); padding: 18px 20px; margin-bottom: 18px;
}
.dir-summary-row { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; font-size: .94rem; }
.dir-summary-row span:first-child { color: var(--muted); }
.dir-summary-row span:last-child { color: var(--ink); font-weight: 700; text-align: right; }
.dir-summary-total { border-top: 1px dashed var(--line-strong); margin-top: 8px; padding-top: 12px; font-size: 1.1rem; }
.dir-summary-total span:last-child { color: var(--brand); font-weight: 800; }

/* ---------- misc ---------- */
.dir-hint { color: var(--text); font-size: .93rem; margin-bottom: 16px; }
.dir-note { display: block; color: var(--muted); font-size: .82rem; margin-top: 6px; }
.dir-note a { color: var(--brand); font-weight: 700; }
.dir-error {
    background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-line);
    border-radius: var(--radius); padding: 10px 14px; font-size: .9rem; margin-bottom: 14px;
}
.dir-message {
    color: var(--muted); text-align: center; padding: 64px 20px; font-size: 1rem;
    background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg);
}
.dir-toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
    background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 999px;
    font-size: .92rem; font-weight: 600; z-index: 1700; box-shadow: var(--shadow-lg);
    max-width: calc(100% - 32px);
}
.dir-toast.is-error { background: var(--danger); }

@media (max-width: 960px) {
    .dir-layout { grid-template-columns: 1fr; gap: 20px; }
    .dir-filters { position: static; }
    .dir-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
    .dir-filter-head, .dir-result-count, .dir-filters .form-group:nth-child(2) { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
    .dir-main { padding: 24px 0 64px; }
    .dir-filters { grid-template-columns: 1fr; padding: 18px; }
    .dir-grid { grid-template-columns: 1fr; }
    .dir-modal { padding: 24px 20px; top: auto; bottom: 0; left: 0; right: 0; transform: none; width: 100%;
                 max-height: 92dvh; border-radius: var(--radius-xl) var(--radius-xl) 0 0; animation: dirSheet .22s ease; }
    .dir-modal-wide { width: 100%; }
    .dir-profile-head { margin: -24px -20px 20px; padding: 28px 20px 20px; }
    .dir-profile-actions { margin: 0 -20px -24px; padding: 14px 20px 20px; bottom: -24px; }
    .dir-account-name { display: none; }
}
@keyframes dirSheet { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ============================================================
   Booking helpers: next-available, sorting, empty states,
   profile summary bar, reassurance.
   ============================================================ */
.dir-card { cursor: pointer; }
.dir-card.is-bookable { border-color: var(--success-line); }
.dir-next {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    font-size: .86rem; color: var(--muted); margin: -4px 0 14px;
}
.dir-next .material-symbols-outlined { font-size: 17px; }
.dir-next.is-open { color: var(--success); }
.dir-next.is-open strong { color: var(--ink); }
.dir-next-dot {
    width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex-shrink: 0;
    box-shadow: 0 0 0 3px var(--success-bg); animation: ring 2.2s ease-out infinite;
}

.dir-results-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    margin-bottom: 16px;
}
.dir-results-hint { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); margin: 0; }
.dir-results-hint .material-symbols-outlined { font-size: 18px; color: var(--brand); }
.dir-sort { display: flex; align-items: center; gap: 8px; }
.dir-sort label { font-size: .85rem; font-weight: 700; color: var(--ink); white-space: nowrap; }
.dir-sort select {
    border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface);
    padding: 8px 34px 8px 14px; font-size: .88rem; font-weight: 600; color: var(--ink);
    appearance: none; -webkit-appearance: none; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236b778c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center;
}
.dir-sort select:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }

.dir-toggle {
    display: flex; align-items: center; gap: 10px; cursor: pointer;
    font-size: .88rem; font-weight: 600; color: var(--ink); margin: 2px 0 14px;
}
.dir-toggle input { width: 18px; height: 18px; accent-color: var(--brand); flex-shrink: 0; }
.dir-filters .dir-toggle { grid-column: 1 / -1; }

.dir-message-title { font-weight: 800; color: var(--ink); margin: 0 0 6px; }
.dir-message-sub { margin: 0 0 18px; }
.dir-message-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.dir-message-actions .dir-btn { flex: 0 1 auto; }

.dir-profile-id { min-width: 0; flex: 1; }
.dir-profile-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dir-icon-btn {
    align-self: flex-start; flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%;
    border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
    display: grid; place-items: center; cursor: pointer; margin-right: 44px;
}
.dir-icon-btn:hover { border-color: var(--brand); color: var(--brand); }
.dir-times { border-radius: var(--radius); transition: box-shadow .3s; }
.dir-times.is-nudged { animation: nudge .5s ease; box-shadow: 0 0 0 4px rgba(244, 165, 28, .35); }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.dir-more-times { margin-top: 4px; }

.dir-assure { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.dir-assure li { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--ink); }
.dir-assure .material-symbols-outlined { font-size: 20px; color: var(--success); flex-shrink: 0; }

body.dir-modal-open { overflow: hidden; }

@media (max-width: 640px) {
    .dir-results-bar { flex-direction: column; align-items: stretch; }
    .dir-sort select { flex: 1; }
    .dir-icon-btn { margin-right: 44px; }
    .dir-profile-head { flex-direction: row; text-align: left; flex-wrap: wrap; }
    .dir-profile-buttons { flex-direction: column; }
}
@media (max-width: 760px) {
    /* clear of the floating WhatsApp button */
    .dir-toast { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
}
/* price label: keep each part on one line; wrap between them cleanly */
.dir-card-rate { flex-wrap: wrap; row-gap: 0; }
.dir-card-rate span { white-space: nowrap; }
@media (max-width: 640px) { .dir-profile-head .dir-card-rate { border-radius: 12px; } }

/* ---------- packages: what to book (the mentor's own services) ---------- */
.dir-profile-headline { margin: 6px 0 0; font-weight: 600; color: var(--ink); unicode-bidi: plaintext; }
.dir-fullpage { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: .85rem; color: var(--brand); text-decoration: none; }
.dir-fullpage .material-symbols-outlined { font-size: 16px; }
.dir-packages { display: grid; gap: 8px; }
.dir-package {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
    padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; background: var(--surface);
    transition: border-color .15s, background-color .15s;
}
.dir-package:hover { border-color: var(--brand-200); }
.dir-package:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.dir-package input { accent-color: var(--brand); width: 18px; height: 18px; margin: 0; }
.dir-package-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dir-package-body strong { unicode-bidi: plaintext; }
.dir-package-body span { color: var(--muted); font-size: .86rem; unicode-bidi: plaintext; overflow-wrap: anywhere; }
.dir-package-price { font-weight: 800; color: var(--brand-800); white-space: nowrap; }
.dir-package-price { display: flex; flex-direction: column; align-items: flex-end; }
.dir-package-price small { font-weight: 600; color: var(--muted); font-size: .76rem; }
.dir-choice-count { color: var(--muted); font-size: .88rem; }
