/* =============================================================
   Filter Tutors – TuitionKL  |  filter-tutors.css  v1.1.0
   ============================================================= */

/* ── Variables ──────────────────────────────────────────────── */
:root {
    --ft-green:        #2a7a4b;
    --ft-green-dark:   #1f5c38;
    --ft-green-light:  #e8f5ee;
    --ft-accent:       #f0a500;
    --ft-accent-dark:  #c98800;
    --ft-text:         #1a1a2e;
    --ft-muted:        #6b7280;
    --ft-border:       #e5e7eb;
    --ft-bg:           #f9fafb;
    --ft-card-bg:      #ffffff;
    --ft-radius:       14px;
    --ft-shadow:       0 4px 20px rgba(0,0,0,.08);
    --ft-shadow-hover: 0 12px 36px rgba(0,0,0,.14);
    --ft-video-green:  #1ab55c;
    --ft-modal-bg:     rgba(10,10,20,.72);
    --ft-transition:   .22s cubic-bezier(.4,0,.2,1);
}

/* ── Reset ──────────────────────────────────────────────────── */
.ft-filters *, .ft-grid *, .ft-modal * { box-sizing: border-box; }

/* ═══════════════════════════════════════════════════════════════
   FILTER BAR
═══════════════════════════════════════════════════════════════ */
.ft-filters {
    background: #fff;
    border: 1px solid var(--ft-border);
    border-radius: var(--ft-radius);
    padding: 20px 24px;
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--ft-shadow);
}

.ft-filter-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--ft-muted);
    margin-bottom: 7px;
}

.ft-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.ft-pill {
    padding: 6px 14px;
    border-radius: 999px;
    border: 1.5px solid var(--ft-border);
    background: #fff;
    color: var(--ft-text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--ft-transition);
    white-space: nowrap;
}
.ft-pill:hover  { border-color: var(--ft-green); color: var(--ft-green); background: var(--ft-green-light); }
.ft-pill.active { border-color: var(--ft-green); background: var(--ft-green); color: #fff; }

/* Search */
.ft-search {
    width: 100%;
    max-width: 360px;
    padding: 9px 16px;
    border: 1.5px solid var(--ft-border);
    border-radius: 999px;
    font-size: 14px;
    color: var(--ft-text);
    outline: none;
    transition: border-color var(--ft-transition);
}
.ft-search:focus { border-color: var(--ft-green); }

/* ═══════════════════════════════════════════════════════════════
   TUTOR GRID
═══════════════════════════════════════════════════════════════ */
.ft-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 24px;
}

/* ── Card ── */
.ft-card {
    background: var(--ft-card-bg);
    border: 1px solid var(--ft-border);
    border-radius: var(--ft-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--ft-shadow);
    transition: transform var(--ft-transition), box-shadow var(--ft-transition);
}
.ft-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ft-shadow-hover);
}

/* ── Photo wrap ── */
.ft-card-photo-wrap {
    position: relative;
    width: 100%;
    padding-top: 72%;          /* 4:3-ish portrait crop */
    background: var(--ft-green-light);
    overflow: hidden;
}

.ft-card-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform .4s ease;
}
.ft-card:hover .ft-card-photo { transform: scale(1.04); }

/* ── Play overlay on photo ── */
.ft-video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0);
    border: none;
    cursor: pointer;
    transition: background var(--ft-transition);
}
.ft-video-overlay:hover { background: rgba(0,0,0,.35); }

.ft-play-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    border: 2.5px solid rgba(255,255,255,.85);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    opacity: 0;
    transform: scale(.8);
    transition: opacity var(--ft-transition), transform var(--ft-transition);
    backdrop-filter: blur(4px);
    padding-left: 4px; /* optical centering for ▶ */
}
.ft-video-overlay:hover .ft-play-icon,
.ft-card:hover .ft-video-overlay .ft-play-icon {
    opacity: 1;
    transform: scale(1);
}

/* ── Card body ── */
.ft-card-body {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.ft-card-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--ft-text);
    margin: 0 0 3px;
    line-height: 1.3;
}
.ft-card-role {
    font-size: 13px;
    font-weight: 600;
    color: var(--ft-green);
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.ft-card-bio {
    font-size: 13.5px;
    color: var(--ft-muted);
    line-height: 1.55;
    margin: 0 0 14px;
    flex: 1;
    /* 3-line clamp */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Tags ── */
.ft-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 14px;
}
.ft-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
    white-space: nowrap;
    letter-spacing: .02em;
}
.ft-tag-subject    { background: var(--ft-green-light); color: var(--ft-green-dark); }
.ft-tag-programme  { background: #fff4e0; color: #9a6200; }

/* ── Card actions ── */
.ft-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ft-btn {
    flex: 1;
    min-width: 100px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all var(--ft-transition);
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
}

/* Watch Intro button */
.ft-btn-video {
    background: var(--ft-green-light);
    color: var(--ft-green-dark);
    border: 1.5px solid var(--ft-green);
}
.ft-btn-video:hover {
    background: var(--ft-green);
    color: #fff;
}

/* Enquire button */
.ft-btn-contact {
    background: var(--ft-accent);
    color: #fff;
}
.ft-btn-contact:hover {
    background: var(--ft-accent-dark);
    color: #fff;
}

/* ── Hidden / No results ── */
.ft-card[hidden] { display: none !important; }

.ft-no-results {
    text-align: center;
    padding: 48px 20px;
    color: var(--ft-muted);
    font-size: 16px;
}

/* ── Play overlay – dimmer tint for tutors without video ── */
.ft-video-overlay[data-has-video="0"] .ft-play-icon {
    background: rgba(0,0,0,.08);
    border-color: rgba(255,255,255,.55);
    color: rgba(255,255,255,.75);
}

/* ── Watch Intro button – muted style when no video ── */
.ft-btn-video[data-has-video="0"] {
    background: #f3f4f6;
    color: var(--ft-muted);
    border-color: var(--ft-border);
    cursor: pointer;
}
.ft-btn-video[data-has-video="0"]:hover {
    background: #e5e7eb;
    color: var(--ft-text);
}

/* ═══════════════════════════════════════════════════════════════
   VIDEO MODAL
═══════════════════════════════════════════════════════════════ */
.ft-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.ft-modal[hidden] { display: none; }

/* Backdrop */
.ft-modal-backdrop {
    position: absolute;
    inset: 0;
    background: var(--ft-modal-bg);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: ftFadeIn .22s ease both;
}

/* Modal box */
.ft-modal-box {
    position: relative;
    z-index: 1;
    background: #111827;
    border-radius: 16px;
    width: 100%;
    max-width: 760px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,.55);
    animation: ftSlideUp .28s cubic-bezier(.34,1.56,.64,1) both;
    display: flex;
    flex-direction: column;
}

/* Header */
.ft-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #1f2937;
    border-bottom: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
}
.ft-modal-name {
    font-size: 15px;
    font-weight: 700;
    color: #f9fafb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ft-modal-close {
    background: rgba(255,255,255,.08);
    border: none;
    color: #d1d5db;
    font-size: 22px;
    line-height: 1;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--ft-transition), color var(--ft-transition);
    flex-shrink: 0;
    margin-left: 12px;
}
.ft-modal-close:hover { background: rgba(255,255,255,.18); color: #fff; }

/* Player area */
.ft-modal-player {
    position: relative;
    width: 100%;
    padding-top: 56.25%;   /* 16:9 */
    background: #000;
    flex-shrink: 0;
}
.ft-modal-player iframe,
.ft-modal-player video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Sub-label */
.ft-modal-sub {
    text-align: center;
    font-size: 12px;
    color: #6b7280;
    padding: 10px;
    margin: 0;
    flex-shrink: 0;
}

/* ── No-video empty state ── */
.ft-modal-no-video {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    background: #111827;
    flex-shrink: 0;
}
.ft-modal-no-video[hidden] { display: none; }

.ft-no-video-icon {
    font-size: 52px;
    margin-bottom: 16px;
    opacity: .55;
    filter: grayscale(1);
}
.ft-no-video-msg {
    color: #9ca3af;
    font-size: 15px;
    text-align: center;
    margin: 0;
    line-height: 1.5;
    max-width: 300px;
}

/* ── Animations ── */
@keyframes ftFadeIn   { from { opacity:0 } to { opacity:1 } }
@keyframes ftSlideUp  { from { opacity:0; transform: translateY(28px) scale(.97) } to { opacity:1; transform: none } }

/* ── Responsive ── */
@media (max-width: 640px) {
    .ft-grid { grid-template-columns: 1fr; }
    .ft-modal-box { border-radius: 12px; }
    .ft-card-photo-wrap { padding-top: 62%; }
}

/* Prevent body scroll when modal open */
body.ft-modal-open { overflow: hidden; }