/* ═══════════════════════════════════════════════════════════
   Course finder — faceted card grid
   Sticky twin-search bar, level pills, checkbox filter rail and a
   three-column card grid.
   ═══════════════════════════════════════════════════════════ */

.igop-finder2 { background: #f7f8fb; }

/* ═══════════ TWIN SEARCH BAR ═══════════ */

.igop-searchbar {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
    background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 18px 20px; margin-bottom: 14px; position: relative; z-index: 30;
    transition: padding .2s, box-shadow .2s;
}
.igop-searchbar-count {
    display: none; font-size: .85em; font-weight: 800; color: var(--ink);
    align-self: center; white-space: nowrap;
}

.igop-sfield { min-width: 0; }
.igop-sfield label {
    display: flex; align-items: center; gap: 8px;
    font-size: .95em; font-weight: 800; color: var(--ink); margin-bottom: 9px;
}
.igop-sicon { font-size: .95em; }

/* The theme sets a fixed height on <select>, which chopped the bottom off the
   text at this font size. Height is forced back to content-driven here, and the
   longer placeholders are allowed to ellipsis rather than overflow. */
.igop-finder2 .igop-sselect {
    box-sizing: border-box;
    display: block; width: 100%; max-width: 100%;
    height: auto; min-height: 0; line-height: 1.45;
    padding: 14px 40px 14px 16px;
    border: 1px solid var(--line); border-radius: 11px; background-color: #fff;
    font-family: inherit; font-size: .92em; color: var(--ink); cursor: pointer;
    transition: border-color .16s, box-shadow .16s;
    text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 15px center;
}
.igop-finder2 .igop-sselect:focus {
    outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(62, 73, 115, .12);
}
/* Some themes style the option list too; keep it legible. */
.igop-finder2 .igop-sselect option { color: var(--ink); background: #fff; font-size: 15px; }

/* Compact + pinned once the list is scrolled */
.igop-searchbar.is-stuck {
    position: sticky; top: 0; border-radius: 0 0 14px 14px;
    padding: 10px 18px; grid-template-columns: auto 1fr 1fr;
    align-items: center; gap: 14px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, .12);
}
.igop-searchbar.is-stuck .igop-searchbar-count { display: block; }
.igop-searchbar.is-stuck .igop-sfield {
    display: flex; align-items: center; gap: 10px;
}
.igop-searchbar.is-stuck .igop-sfield label {
    margin-bottom: 0; white-space: nowrap; font-size: .82em;
}
.igop-finder2 .igop-searchbar.is-stuck .igop-sselect {
    padding: 9px 34px 9px 12px; font-size: .84em; border-color: transparent;
    background-color: var(--surface, #f6f8fb);
}

/* ═══════════ LEVEL PILLS + SORT ═══════════ */

.igop-levelbar {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin-bottom: 12px;
}
.igop-lvl {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 18px; border-radius: 9px; border: 1px solid var(--line);
    background: #fff; font-family: inherit; font-size: .86em; font-weight: 700;
    color: var(--body); cursor: pointer; transition: .16s; white-space: nowrap;
}
.igop-lvl:hover { border-color: var(--navy); color: var(--navy); }
.igop-lvl.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Live count of what the pill would show. */
.igop-lvl em {
    font-style: normal; font-size: .82em; font-weight: 800;
    color: var(--muted); background: #f1f5f9;
    border-radius: 999px; padding: 1px 7px; min-width: 20px; text-align: center;
}
.igop-lvl.is-active em { color: #fff; background: rgba(255, 255, 255, .22); }
.igop-lvl:hover em { color: var(--navy); }
.igop-lvl.is-active:hover em { color: #fff; }

.igop-sortwrap { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.igop-sortsel {
    border: none; background: none; font-family: inherit; font-size: .86em;
    font-weight: 700; color: var(--ink); cursor: pointer; padding: 6px 4px;
}
.igop-sortsel:focus { outline: 2px solid var(--navy); outline-offset: 2px; border-radius: 5px; }

.igop-resultline {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.igop-resultline strong { font-size: 1.15em; color: var(--ink); }
.igop-active-tag {
    background: #eef2f7; color: #475569; border-radius: 999px;
    padding: 4px 13px; font-size: .8em; font-weight: 700;
}

/* ═══════════ FILTER RAIL ═══════════ */

/* The twin search bar pins itself to the very top once you scroll, so the
   sticky rail has to start below it or its heading disappears underneath. */
.igop-finder2 .igop-rail { top: 92px; max-height: calc(100vh - 112px); }
.igop-finder2 .igop-finder-layout { grid-template-columns: 288px minmax(0, 1fr); }

@media (max-width: 900px) {
    .igop-finder2 .igop-rail { top: 0; max-height: none; }
}

.igop-fgroup { padding: 15px 0; border-bottom: 1px solid var(--line); }
.igop-fgroup:last-of-type { border-bottom: none; }
.igop-fhead {
    display: flex; align-items: center; gap: 8px;
    font-size: .93em; font-weight: 800; color: var(--ink); margin-bottom: 11px;
}

.igop-fcheck {
    display: flex; align-items: flex-start; gap: 9px; cursor: pointer;
    font-size: .84em; color: var(--body); padding: 5px 0; line-height: 1.4;
}
.igop-fcheck input { margin-top: 2px; flex-shrink: 0; accent-color: var(--orange); width: 15px; height: 15px; }
.igop-fcheck:hover span { color: var(--ink); }
.igop-fcheck.is-hidden { display: none; }

.igop-fexpand { margin-top: 5px; margin-left: 24px; }

.igop-fcount {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 19px; height: 19px; padding: 0 5px; margin-left: 7px;
    background: var(--danger); color: #fff; border-radius: 999px;
    font-size: .74em; font-weight: 800;
}

/* ═══════════ CARD GRID ═══════════ */

.igop-cardgrid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); gap: 16px;
}

.igop-ccard {
    background: #fff; border: 1px solid var(--line); border-radius: 14px;
    padding: 20px; display: flex; flex-direction: column; gap: 11px;
    transition: box-shadow .18s, transform .18s, border-color .18s;
}
.igop-ccard:hover {
    box-shadow: 0 12px 30px rgba(15, 23, 42, .1);
    transform: translateY(-2px); border-color: #cbd5e1;
}
.igop-ccard.is-requested { border-color: var(--ok-border); background: #fcfffd; }

.igop-ccard-top { display: flex; align-items: flex-start; gap: 12px; }
.igop-ccard-logo {
    width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
    background: #fff; border: 1px solid var(--line); overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.igop-ccard-logo img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.igop-ccard-logo span { font-size: .82em; font-weight: 800; color: var(--navy); }

.igop-ccard-uni { min-width: 0; flex: 1; }
.igop-ccard-uniname { font-size: .87em; font-weight: 600; color: var(--ink); line-height: 1.35; }
.igop-ccard-city { font-size: .82em; color: var(--muted); margin-top: 2px; }

.igop-ccard-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.igop-cbadge {
    font-size: .7em; color: var(--muted); background: #f6f8fb;
    border-radius: 6px; padding: 4px 9px; white-space: nowrap;
}

.igop-ccard-name {
    font-size: 1.06em; font-weight: 800; color: var(--ink); line-height: 1.3;
}

.igop-ccard-degree {
    display: flex; align-items: center; gap: 7px;
    font-size: .85em; color: var(--body);
    padding-bottom: 11px; border-bottom: 1px solid var(--line);
}
.igop-clang { font-size: 1.05em; line-height: 1; }

.igop-ccard-dl {
    font-size: .8em; color: var(--body); line-height: 1.45;
    padding-bottom: 11px; border-bottom: 1px solid var(--line);
}

.igop-ccard-foot {
    display: flex; align-items: flex-end; gap: 12px; margin-top: auto; padding-top: 4px;
}
.igop-ccard-fee, .igop-ccard-dur { display: flex; flex-direction: column; gap: 2px; }
.igop-ccard-fee { flex: 1; }
.igop-ccard-fee strong, .igop-ccard-dur strong {
    font-size: 1.02em; font-weight: 800; color: var(--ink); line-height: 1.2;
}
.igop-ccard-fee strong.is-free { color: var(--ink); }
.igop-ccard-fee span, .igop-ccard-dur span {
    font-size: .72em; color: var(--muted); line-height: 1.35;
}

.igop-cheart {
    width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
    border: 1px solid var(--danger-border); background: #fff; color: var(--danger);
    font-size: 1.15em; cursor: pointer; transition: .16s;
    display: flex; align-items: center; justify-content: center; font-family: inherit;
}
.igop-cheart:hover { background: var(--danger-bg); transform: scale(1.08); }
.igop-cheart.is-on {
    border-color: var(--ok-border); background: var(--ok-bg); color: var(--ok); cursor: default;
}

/* ═══════════ RESPONSIVE ═══════════ */

@media (max-width: 1100px) {
    .igop-cardgrid { grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); }
}

@media (max-width: 900px) {
    .igop-searchbar { grid-template-columns: 1fr; gap: 12px; padding: 15px; }
    .igop-searchbar.is-stuck {
        grid-template-columns: 1fr; padding: 10px 14px;
    }
    .igop-searchbar.is-stuck .igop-sfield label { display: none; }
    .igop-searchbar.is-stuck .igop-searchbar-count { display: none; }
    .igop-sortwrap { margin-left: 0; width: 100%; }
}

@media (max-width: 680px) {
    .igop-cardgrid { grid-template-columns: 1fr; }
    .igop-levelbar { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 5px; }
    .igop-lvl { flex-shrink: 0; }
    .igop-sortwrap { flex-shrink: 0; }
    .igop-resultline { gap: 9px; }
    .igop-ccard { padding: 16px; }
}
