/* Learner, buyer and visitor pages: player progress, learner cards, shop header, search, phone layouts.
   Loaded after app.css, so rules here refine the shared ones. */

/* ================= Course player: progress and what a chapter asks before Next ================= */
.cplay__maintop { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cplay__overall { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; color: var(--muted); }
.cplay__bar { width: 160px; height: 8px; border-radius: 999px; background: var(--surface-4); overflow: hidden; }
.cplay__bar-fill { height: 100%; background: #10b981; border-radius: 999px; transition: width .2s ease; }
.cplay__mark { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 28px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.cplay__mark-hint { font-size: 13px; color: var(--muted); }
.cplay__mark + .cplay__nav, .cplay__gate + .cplay__nav { margin-top: 14px; }
.cplay__req { display: flex; align-items: center; gap: 6px; margin: -6px 0 18px; font-size: 13px; font-weight: 600; color: var(--muted); }
.cplay__req--met { color: var(--success-ink); }
.cplay__gate { margin: 28px 0 0; padding: 12px 14px; border: 1px solid var(--warn-line); border-radius: 12px; background: var(--tint-warn); color: var(--warn-ink); font-size: 14px; line-height: 1.5; }
.cplay__gate strong { margin-right: 4px; }
@media (max-width: 600px) { .cplay__maintop, .cplay__content { padding-left: 16px; padding-right: 16px; } .cplay__bar { width: 110px; } }

/* ================= Learner cards (My Learning, Favourites) ================= */
.lgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.lcard { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.lcard__art { position: relative; height: 112px; display: grid; place-items: end start; padding: 10px; color: #fff; }
.lcard__art--img { background-size: cover; background-position: center; }
.lcard__kind { background: rgba(17, 17, 31, .58); color: #fff; font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 8px; }
.lcard__fav { z-index: 2; }
.lcard__body { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 16px; flex: 1; }
.lcard__title { font-size: 15px; font-weight: 700; line-height: 1.35; }
.lcard__title a { text-decoration: none; }
.lcard__title a:hover { text-decoration: underline; }
.lcard__by { font-size: 12px; color: var(--muted); }
.lcard__progress { display: flex; flex-direction: column; gap: 6px; }
.lcard__progress--none { font-size: 13px; font-weight: 600; color: var(--muted); }
.lcard__bar { height: 8px; border-radius: 999px; background: var(--surface-4); overflow: hidden; }
.lcard__bar-fill { height: 100%; background: var(--brand); border-radius: 999px; }
.lcard__bar-fill--done { background: #10b981; }
.lcard__pct { font-size: 12px; font-weight: 600; color: var(--muted); }
.lcard__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.lcard__actions .btn { flex: 1 1 auto; justify-content: center; text-align: center; }

/* Library cards seen by a learner: my progress instead of the author's figures. */
.ccard__mine { display: flex; flex-direction: column; gap: 6px; min-height: 32px; margin-bottom: 14px; }
/* The Draft badge sits left of the favourite heart instead of under it. */
.ccard__badge--draft { right: 48px; }

/* ================= Shop header, catalogue filters, search ================= */
.pub__top { gap: 16px; }
.pub__search { flex: 0 1 320px; margin-right: auto; }
.pub__search input { width: 100%; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font-size: 14px; outline: none; background: var(--surface); }
.pub__search input:focus { border-color: var(--brand); }
.pub__menubtn { display: none; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; width: 40px; height: 40px; place-items: center; cursor: pointer; color: var(--ink); }
.catalog__filtertoggle { display: none; }
.catalog__clear { margin-left: 8px; border: 0; background: none; color: var(--brand-ink); cursor: pointer; }
.tablewrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.searchpage { max-width: 1200px; margin: 0 auto; padding: 24px 28px 60px; display: grid; gap: 22px; }
.searchpage__h1 { font-size: 24px; font-weight: 800; }
.searchpage__form { display: flex; gap: 10px; max-width: 560px; }
.searchpage__form input { flex: 1; }
.searchpage__group { display: grid; gap: 12px; }
.search-results__all { display: block; padding: 8px; font-size: 13px; font-weight: 700; color: var(--brand-ink); text-decoration: none; border-bottom: 1px solid var(--line); margin-bottom: 4px; }

@media (max-width: 720px) {
    .pub__top { flex-wrap: wrap; padding: 10px 16px; }
    .pub__search { order: 3; flex: 1 1 100%; margin-right: 0; }
    .pub__menubtn { display: grid; margin-left: auto; }
    .pub__nav { display: none; order: 4; flex: 1 1 100%; flex-direction: column; align-items: stretch; gap: 4px; padding-top: 6px; }
    .pub__nav--open { display: flex; }
    .pub__nav a { padding: 10px 4px; }
    .pub__nav .btn--solid { text-align: center; }
    .pubhero { padding: 18px 4px 14px; }
    .pubhero h1 { font-size: 24px; }
    .catalog { grid-template-columns: 1fr; gap: 12px; }
    .catalog__filtertoggle { display: inline-flex; justify-self: start; }
    .catalog__filters { display: none; }
    .catalog__filters--open { display: flex; padding: 4px 12px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
    .searchpage { padding: 18px 16px 48px; }
    .admintable { font-size: 12.5px; }
}

/* ================= Course page, cart, sign-up ================= */
.previewdlg { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(17, 17, 31, .5); }
.previewdlg__box { width: min(760px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; margin: 0; }
.previewdlg__box:focus { outline: none; }
.reviews__avg--none { font-size: 15px; font-weight: 600; color: var(--muted); }
.checkoutterms { margin-top: 8px; }
.login__terms { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--muted); margin: 6px 0 12px; }
.login__terms input { margin-top: 2px; width: 16px; height: 16px; flex: none; }
.forbidden h1 { font-size: 26px; }
.forbidden .btn { justify-self: center; margin-top: 10px; }

/* ================= Course home (learner view) ================= */
.dch__done { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; font-size: 10px; color: #fff; }
.dch__done--yes { background: #10b981; border-color: #10b981; }

/* ================= Achievements ================= */
.cert { flex-wrap: wrap; }
.cert__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cert:target { box-shadow: 0 0 0 2px var(--brand); }

/* ================= Learner dashboard ================= */
.infotip { position: relative; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: var(--faint); font-size: 13px; font-weight: 400; cursor: help; outline: none; }
.infotip:focus-visible { box-shadow: 0 0 0 2px var(--brand); }
.infotip__text { display: none; position: absolute; z-index: 30; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 260px; padding: 8px 10px; border-radius: 8px; background: #16161f; color: #fff; font-size: 12px; font-weight: 500; line-height: 1.4; text-align: left; white-space: normal; box-shadow: 0 8px 24px rgba(20, 20, 40, .2); }
.infotip:hover .infotip__text, .infotip:focus .infotip__text { display: block; }
.card__info.infotip .infotip__text { left: auto; right: 0; transform: none; }
.greeting__stats { flex-wrap: wrap; }
.course-card--link { position: relative; }
.course-card__link { color: inherit; text-decoration: none; }
.course-card__link::after { content: ""; position: absolute; inset: 0; }
.course-card--link:hover { box-shadow: 0 8px 24px rgba(20, 20, 40, .08); }
@media (max-width: 600px) {
    .greeting__stats { width: 100%; }
    .stat-pill { flex: 1 1 calc(33% - 12px); min-width: 0; padding: 8px 10px; }
    .tabs__inner { gap: 18px; padding: 0 16px; overflow-x: auto; }
    .app__main { padding: 18px 16px 48px; }
}

/* Course language versions: links on the landing page, a note on catalogue cards */
.landing__langs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 8px; font-size: 13px; color: var(--muted); }
.landing__langs .link { font-weight: 600; }
.catcard__langs { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); margin: -2px 0 4px; }

/* pend-learn: back to the lesson from a linked quiz or assignment, survey blocks, messaging the instructor */
.take__backlesson { margin-left: auto; font-size: 13px; font-weight: 600; white-space: nowrap; }
.take__continue { text-decoration: none; }
.lblock--survey { background: var(--tint-success); }
.landing__message { margin-top: 10px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
