/* Program Finder page — uses vars from style.css
   (--primary, --secondary, --accent, --dark, --white,
   --light-bg, --text-dark, --text-light). Shared card/section
   styles (home-topuni-*, home-section, trending-*, course-item-card,
   home-scholarcard-*, home-article-*, enquiry-modal) come from
   css/home.css, linked directly in program-finder.blade.php —
   NOT duplicated in this file, so don't re-add them here. */

/* Hero — same blobs + dotted mask pattern as the blog/events pages */
.pf-hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background:
        radial-gradient(ellipse 900px 500px at 15% -10%, rgba(85,171,215,0.35), transparent 60%),
        radial-gradient(ellipse 700px 500px at 100% 110%, rgba(37,117,252,0.4), transparent 60%),
        linear-gradient(150deg, var(--dark) 0%, var(--primary) 62%, #1a4f86 100%);
    padding: 72px 0 58px;
    text-align: center;
}

.pf-hero-blob {
    position: absolute;
    z-index: 0;
    border-radius: 50%;
    filter: blur(70px);
    pointer-events: none;
}

.pf-hero-blob-1 {
    width: 420px;
    height: 420px;
    top: -180px;
    right: -100px;
    background: radial-gradient(circle, rgba(85,171,215,0.5), transparent 70%);
}

.pf-hero-blob-2 {
    width: 360px;
    height: 360px;
    bottom: -240px;
    left: -120px;
    background: radial-gradient(circle, rgba(37,117,252,0.4), transparent 70%);
}

.pf-hero-dots {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: radial-gradient(rgba(255,255,255,0.14) 1.4px, transparent 1.4px);
    background-size: 26px 26px;
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 10%, #000 30%, transparent 100%);
    mask-image: radial-gradient(ellipse 80% 70% at 50% 10%, #000 30%, transparent 100%);
    pointer-events: none;
}

.pf-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
}

.pf-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--white);
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.22);
    padding: 7px 18px;
    border-radius: 30px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-bottom: 22px;
}

.pf-hero-eyebrow svg {
    color: var(--accent);
    flex-shrink: 0;
}

.pf-hero-title {
    color: var(--white);
    font-size: clamp(1.3rem, 3.2vw, 2.2rem);
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.25;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.pf-hero-title span {
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-weight: 500;
    color: var(--accent);
}

.pf-hero-sub {
    color: #cfd9f0;
    font-size: 1rem;
    margin: 0 auto;
    max-width: 700px;
    line-height: 1.65;
    text-wrap: balance;
}

.pf-hero-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--white);
    border-radius: 12px;
    height: 48px;
    padding: 0 16px;
    max-width: 580px;
    margin: 28px auto 0;
    box-shadow: 0 24px 50px rgba(4,26,87,0.32);
    border: 1px solid rgba(255,255,255,0.5);
    box-sizing: border-box;
}

.pf-hero-search svg {
    color: var(--text-light);
    flex-shrink: 0;
}

.pf-hero-search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0;
    margin: 0;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.88rem;
    line-height: normal;
    color: var(--text-dark);
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .pf-hero-title { white-space: normal; }
}

@media (max-width: 640px) {
    .pf-hero { padding: 44px 0 36px; }
    .pf-hero-title { white-space: normal; }
    .pf-hero-search input { font-size: 16px; }
}

/* Tabs + mobile "Filters" toggle button */
.pf-tabs-wrapper {
    background: var(--white);
    border-bottom: 1px solid #eee;
    position: -webkit-sticky;
    position: sticky;
    top: 72px;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.pf-tabs-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
}

.pf-tabs-inner {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.pf-tabs-inner::-webkit-scrollbar { display: none; }

.pf-tab-btn {
    background: var(--light-bg);
    border: none;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-dark);
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.25s ease;
    font-family: inherit;
}

.pf-tab-btn:hover {
    background: #eaf2fb;
    color: var(--primary);
}

.pf-tab-btn.active {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    color: var(--white);
    box-shadow: 0 4px 12px rgba(37,117,252,0.3);
}

.pf-tab-badge {
    background: rgba(255,255,255,0.6);
    color: var(--dark);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
}

.pf-tab-btn.active .pf-tab-badge { background: rgba(255,255,255,0.9); color: var(--primary); }

.pf-filters-toggle {
    display: none;
    flex-shrink: 0;
    align-items: center;
    gap: 8px;
    background: var(--dark);
    color: var(--white);
    border: none;
    padding: 10px 18px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: inherit;
}

@media (max-width: 900px) {
    .pf-filters-toggle { display: flex; }
}

@media (max-width: 640px) {
    .pf-tabs-wrapper { top: 0; }
    .pf-tab-btn { padding: 8px 16px; font-size: 0.82rem; }
}

/* Layout: program grid LEFT, filters sidebar RIGHT */
.pf-explore-section {
    padding-top: 36px;
}

.pf-layout {
    display: flex;
    align-items: flex-start;
    gap: 28px;
}

.pf-main {
    flex: 1;
    min-width: 0;
}

.pf-showing-line {
    color: var(--text-light);
    font-size: 0.86rem;
    margin: 0 0 16px;
}

.pf-empty-state {
    display: none;
    text-align: center;
    color: var(--text-light);
    font-size: 0.92rem;
    padding: 50px 20px;
}

.pf-empty-state.show { display: block; }

/* Sidebar */
.pf-sidebar {
    flex: 0 0 300px;
    background: var(--white);
    border: 1px solid #edf0f4;
    border-radius: 18px;
    padding: 22px;
    position: sticky;
    top: 140px;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    box-shadow: 0 10px 24px rgba(20,40,70,0.06);
}

.pf-sidebar::-webkit-scrollbar { width: 6px; }
.pf-sidebar::-webkit-scrollbar-thumb { background: #d7e6fb; border-radius: 10px; }

.pf-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.pf-sidebar-head h3 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.15rem;
    color: var(--dark);
    margin: 0;
}

.pf-sidebar-clear {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    font-family: inherit;
}

.pf-sidebar-clear:hover { color: var(--secondary); }

.pf-filter-group {
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid #f1f4f8;
}

.pf-filter-group-last {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.pf-filter-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0 0 12px;
}

.pf-filter-title svg {
    color: var(--primary);
    flex-shrink: 0;
}

.pf-filter-count {
    font-weight: 500;
    color: var(--text-light);
    font-size: 0.78rem;
    margin-left: -2px;
}

.pf-select {
    width: 100%;
    border: 1px solid #e2e6ec;
    border-radius: 10px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 0.84rem;
    color: var(--text-dark);
    background: var(--white);
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.pf-select:focus { border-color: var(--primary); }

.pf-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-dark);
}

.pf-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.pf-checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 12px;
}

/* Dual-handle price range slider — two overlapping native range
   inputs; only their thumbs are interactive (track is transparent),
   with a separate visual track + fill bar drawn underneath. */
.pf-range-slider {
    position: relative;
    height: 22px;
    margin-bottom: 12px;
}

.pf-range-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: #e4eaf2;
    border-radius: 4px;
    transform: translateY(-50%);
}

.pf-range-fill {
    position: absolute;
    top: 50%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
    transform: translateY(-50%);
}

.pf-range-slider input[type="range"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 22px;
    margin: 0;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: none;
}

.pf-range-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--white);
    border: 3px solid var(--primary);
    box-shadow: 0 2px 6px rgba(20,40,70,0.25);
    cursor: pointer;
    pointer-events: auto;
    margin-top: 0;
}

.pf-range-slider input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--white);
    border: 3px solid var(--primary);
    box-shadow: 0 2px 6px rgba(20,40,70,0.25);
    cursor: pointer;
    pointer-events: auto;
}

.pf-range-slider input[type="range"]::-webkit-slider-runnable-track {
    background: transparent;
    height: 22px;
}

.pf-range-slider input[type="range"]::-moz-range-track {
    background: transparent;
    height: 22px;
}

.pf-range-values {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--dark);
}

@media (max-width: 900px) {
    .pf-layout { flex-direction: column-reverse; }

    .pf-sidebar {
        flex: 1 1 auto;
        width: 100%;
        position: fixed;
        top: 0;
        right: -100%;
        bottom: 0;
        z-index: 9998;
        max-height: 100vh;
        border-radius: 0;
        transition: right 0.3s ease;
        box-shadow: -10px 0 30px rgba(0,0,0,0.15);
    }

    .pf-sidebar.open {
        right: 0;
    }
}

@media (max-width: 480px) {
    .pf-checkbox-grid { grid-template-columns: 1fr; }
}

/* ===== Page-specific override =====
   home.css centers course-card-uni / course-card-main vertically
   (justify-content: center). On this page the Apply panel
   (course-card-apply) is the tallest of the three columns, so the
   shorter uni/main columns were centering with a large empty gap
   above their content. Top-align them here instead — scoped to
   .pf-main so it only affects this page, home.css itself untouched. */
.pf-main .course-card-uni,
.pf-main .course-card-main {
    justify-content: flex-start;
}

/* =========================================================
   RESPONSIVE FIXES (added) — sticky tabs, mobile filters
   drawer, program cards, buttons
   ========================================================= */

:root { --pf-header-h: 72px; }

/* NOTE: never put overflow on html/body — it breaks position: sticky
   (site header + filter tabs). Clip only the page sections instead. */
.pf-hero, .pf-explore-section { overflow-x: clip; }

/* Hero title: one line only where it fits */
@media (max-width: 900px) {
    .pf-hero-title { white-space: normal; text-wrap: balance; }
}
@media (max-width: 640px) {
    .pf-hero-eyebrow { font-size: 0.66rem; padding: 6px 14px; margin-bottom: 16px; }
    .pf-hero-title { font-size: clamp(1.5rem, 6.4vw, 1.9rem); }
    .pf-hero-sub { font-size: 0.9rem; }
    .pf-hero-search { height: 46px; margin-top: 22px; }
}

/* Sticky tabs sit exactly under the real header height (set by JS) */
.pf-tabs-wrapper {
    top: var(--pf-header-h, 72px) !important;
}
.pf-tabs-row { position: relative; }
.pf-tabs-inner {
    flex: 1 1 auto;
    min-width: 0;
    scroll-behavior: smooth;
}

@media (max-width: 900px) {
    .pf-tabs-row { gap: 10px; padding: 12px 0 10px; }
    .pf-filters-toggle { position: relative; }
}

/* Tabs: always swipeable; native scrollbar hidden (mobile browsers
   don't show it reliably) and replaced by a JS-driven blue bar */
.pf-tabs-scroll {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}
.pf-tabs-inner {
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    overscroll-behavior-x: contain;
    scrollbar-width: none !important;
}
.pf-tabs-inner::-webkit-scrollbar { display: none !important; }

.pf-tabs-bar {
    display: none;
    position: relative;
    height: 4px;
    margin-top: 8px;
    border-radius: 10px;
    background: #e4ecf3;
    overflow: hidden;
}
.pf-tabs-bar span {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.15s ease;
}
.pf-tabs-scroll.has-overflow .pf-tabs-bar { display: block; }
.pf-tabs-scroll.has-overflow:not(.at-end) .pf-tabs-inner {
    -webkit-mask-image: linear-gradient(90deg, #000 80%, transparent);
    mask-image: linear-gradient(90deg, #000 80%, transparent);
}

/* active-filter count bubble on the Filters button */
.pf-filters-count {
    display: none;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--accent);
    color: var(--dark);
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
}
.pf-filters-count.show { display: inline-block; }

/* Desktop sidebar sticks below header + tabs */
.pf-sidebar {
    top: calc(var(--pf-header-h, 72px) + 84px);
    max-height: calc(100vh - var(--pf-header-h, 72px) - 104px);
}

/* extra drawer UI (injected by JS) hidden on desktop */
.pf-sidebar-close,
.pf-sidebar-footer,
.pf-backdrop { display: none; }

/* ===== Mobile / tablet: filters open as a slide-in drawer ===== */
@media (max-width: 900px) {
    .pf-layout { flex-direction: column; }

    .pf-sidebar {
        position: fixed !important;
        top: 0 !important;
        bottom: 0;
        right: 0 !important;
        left: auto;
        width: min(380px, 88vw) !important;
        max-width: 380px;
        max-height: none !important;
        height: 100%;
        padding: 0 !important;
        border-radius: 18px 0 0 18px !important;
        border: none;
        transform: translateX(105%);
        transition: transform 0.3s ease;
        z-index: 10001;
        display: flex;
        flex-direction: column;
        overflow: hidden !important;
    }
    .pf-sidebar.open { transform: translateX(0); }

    .pf-sidebar-head {
        flex-shrink: 0;
        margin: 0;
        padding: 18px 18px 14px;
        border-bottom: 1px solid #eef1f5;
        background: var(--white);
        gap: 12px;
    }
    .pf-sidebar-head h3 { margin-right: auto; }

    .pf-sidebar-body {
        flex: 1 1 auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 18px;
    }

    .pf-sidebar-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        border-radius: 50%;
        border: none;
        background: var(--light-bg);
        color: var(--dark);
        cursor: pointer;
        flex-shrink: 0;
    }

    .pf-sidebar-footer {
        display: block;
        flex-shrink: 0;
        padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid #eef1f5;
        background: var(--white);
        box-shadow: 0 -6px 16px rgba(20,40,70,0.06);
    }
    .pf-sidebar-apply {
        width: 100%;
        border: none;
        border-radius: 12px;
        padding: 13px 16px;
        font-family: inherit;
        font-weight: 700;
        font-size: 0.92rem;
        color: var(--white);
        background: linear-gradient(90deg, var(--primary), var(--secondary));
        cursor: pointer;
    }

    .pf-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 10000;
        background: rgba(4,26,87,0.45);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    .pf-backdrop.show { opacity: 1; visibility: visible; }

    body.pf-drawer-open { overflow: hidden; }

    .pf-checkbox { padding: 8px 0; }
    .pf-checkbox input[type="checkbox"] { width: 18px; height: 18px; }
    .pf-range-slider input[type="range"]::-webkit-slider-thumb { width: 22px; height: 22px; }
    .pf-range-slider input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; }
}

@media (max-width: 480px) {
    .pf-sidebar { width: 100% !important; max-width: none; border-radius: 0 !important; }
    .pf-checkbox-grid { grid-template-columns: 1fr 1fr; }
}

/* ===== Program list ===== */
.pf-main .course-item-card,
.pf-main .course-item-card > * { min-width: 0; }
.pf-main .course-card-title { overflow-wrap: anywhere; }

@media (max-width: 640px) {
    .pf-explore-section { padding-top: 22px; }
    .pf-showing-line { font-size: 0.8rem; margin-bottom: 12px; }
}

/* Load More / View All */
#pfViewAllRow {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}
@media (max-width: 480px) {
    #pfViewAllRow { flex-direction: column; align-items: stretch; }
    #pfViewAllRow .btn-outline-dark,
    #pfViewAllRow .btn-primary { width: 100%; justify-content: center; }
}

/* Touch devices: no hover lift */
@media (hover: none) {
    .pf-tab-btn:hover { background: var(--light-bg); color: var(--text-dark); }
    .pf-tab-btn.active:hover { background: linear-gradient(90deg, var(--primary), var(--secondary)); color: var(--white); }
}

/* ===== Sticky filter tabs — same behaviour as other pages ===== */
.pf-tabs-wrapper {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: var(--pf-header-h, 72px) !important;
    z-index: 999;
    margin-top: -1px;
}