/* DarsMarket "Wisdom" teacher shell — scoped to body.page-dashboard and
   body.page-community only (set by inc/view.php). Never touches the global
   tokens in style.css, so the rest of the site keeps its own look.

   Tokens below are proposed approximations of the reference app screens,
   not measured official values (per the brief). */

:root {
    --w-bg-top: #bceaf5;
    --w-bg-mid: #effaff;
    --w-bg-base: #ffffff;
    --w-accent: #00a7d8;
    --w-accent-dark: #007ca8;
    --w-accent-soft: #e2f7fd;
    --w-card: #f8fafc;
    --w-card-solid: #ffffff;
    --w-border: #b5dde7;
    --w-ink: #111827;
    --w-ink-muted: #596b7b;
    --w-icon: #667287;
    --w-radius-lg: 26px;
    --w-radius-md: 20px;
    --w-radius-sm: 14px;
    --w-shadow-soft: 0 4px 0 #a9dce8;
    --w-shadow-card: 0 10px 24px rgba(0, 124, 168, 0.1);
}

body.wisdom-shell {
    background: linear-gradient(180deg, var(--w-bg-top) 0%, var(--w-bg-mid) 42%, var(--w-bg-base) 100%);
    background-attachment: fixed;

    /* bridge: every existing community.css rule reads these global tokens via
       var(--accent, ...) etc. — redefining them here recolors the whole
       community shell cyan without touching community.css's own rules. */
    --ink: var(--w-ink);
    --ink-muted: var(--w-ink-muted);
    --ink-faint: var(--w-icon);
    --surface: var(--w-card-solid);
    --surface-sunk: var(--w-card);
    --border: var(--w-border);
    --border-strong: var(--w-border);
    --accent: var(--w-accent);
    --accent-dark: var(--w-accent-dark);
    --accent-soft: var(--w-accent-soft);
    --link: var(--w-accent-dark);
}

/* .community-shell sets its own --c-* tokens locally, so the bridge above
   can't reach them through normal cascade — override at equal depth. */
body.page-community .community-shell {
    --c-radius: var(--w-radius-md);
    --c-radius-sm: var(--w-radius-sm);
    --c-pad: 20px;
    --c-gap: 14px;
}

/* the admin screen stays a plain working console, not a consumer app screen */
body.page-community .community-shell[data-community-screen="admin"] {
    --ink: #172b4d;
    --ink-muted: #4f5e78;
    --ink-faint: #7c8aa3;
    --surface: #ffffff;
    --surface-sunk: #eef2f7;
    --border: #d8e1eb;
    --border-strong: #c3d0de;
    --accent: #0f766e;
    --accent-dark: #0b5c56;
    --accent-soft: #e1f2f0;
    --link: #1d4ed8;
    --c-radius: 12px;
    --c-radius-sm: 8px;
}

body.page-community:has(.community-shell[data-community-screen="admin"]) {
    background: #f6f8fb;
}

body.page-community:has(.community-shell[data-community-screen="admin"]) .wisdom-bottom-nav {
    display: none;
}

body.wisdom-shell .site-container {
    max-width: 1220px;
    padding-bottom: 96px;
}

@media (max-width: 767.98px) {
    body.wisdom-shell .site-container {
        padding-left: 16px;
        padding-right: 16px;
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px) + 16px);
    }
}

/* on the wisdom shell, the site header/nav read as a quiet top strip, not a
   competing bar — the gradient and the shell's own top row carry the brand */
body.wisdom-shell .site-navbar {
    background: transparent;
    border-bottom: none;
}

body.wisdom-shell .site-header {
    position: static;
}

@media (max-width: 767.98px) {
    /* the new avatar/bell row already covers notifications + profile access */
    body.wisdom-shell .site-topbar {
        display: none;
    }
}

/* ---------- top identity row (dashboard "A") ---------- */

.wisdom-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0 18px;
}

.wisdom-topbar-avatar {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    background: var(--w-card-solid);
    border: 2px solid #fff;
    box-shadow: var(--w-shadow-card);
    color: var(--w-accent-dark);
    font-size: 16px;
    font-weight: 700;
    overflow: hidden;
}

.wisdom-topbar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wisdom-topbar-body {
    flex: 1 1 auto;
    min-width: 0;
}

.wisdom-topbar-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--w-ink);
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wisdom-topbar-sub {
    font-size: 13px;
    color: var(--w-ink-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wisdom-bell {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: var(--w-card-solid);
    box-shadow: var(--w-shadow-card);
    color: var(--w-accent-dark);
    position: relative;
}

.wisdom-bell svg {
    width: 20px;
    height: 20px;
}

.wisdom-bell-count {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--w-accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

/* ---------- banner card (dashboard "B") ---------- */

.wisdom-banner {
    position: relative;
    overflow: hidden;
    min-height: 160px;
    padding: 22px 24px;
    border-radius: var(--w-radius-lg);
    background: linear-gradient(120deg, var(--w-accent) 0%, var(--w-accent-dark) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.wisdom-banner-body {
    flex: 1 1 auto;
    min-width: 0;
}

.wisdom-banner h2 {
    font-size: clamp(1.15rem, 1rem + 1vw, 1.5rem);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 8px;
    color: #fff;
}

.wisdom-banner-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 10px 18px;
    border-radius: 999px;
    background: #fff;
    color: var(--w-accent-dark);
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none;
}

.wisdom-banner-icon {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--w-radius-sm);
    background: rgba(255, 255, 255, 0.18);
}

.wisdom-banner-icon svg {
    width: 34px;
    height: 34px;
}

/* ---------- rounded search (dashboard "C") ---------- */

.wisdom-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    margin-bottom: 20px;
    border-radius: 999px;
    background: var(--w-card-solid);
    border: 1px solid var(--w-border);
    box-shadow: var(--w-shadow-card);
}

.wisdom-search svg {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    color: var(--w-icon);
}

.wisdom-search input {
    flex: 1 1 auto;
    min-width: 0;
    border: none;
    background: none;
    font-size: 15px;
    color: var(--w-ink);
    outline: none;
}

.wisdom-search input::placeholder {
    color: var(--w-ink-muted);
}

.wisdom-search button {
    flex: 0 0 auto;
    border: none;
    background: var(--w-accent);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 9px 16px;
    border-radius: 999px;
}

/* ---------- module grid (dashboard "D") ---------- */

.wisdom-module-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.wisdom-module-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 132px;
    padding: 18px;
    border-radius: var(--w-radius-md);
    background: var(--w-card);
    border: 1px solid var(--w-border);
    color: var(--w-ink);
    text-decoration: none;
    overflow: hidden;
}

.wisdom-module-card:hover {
    color: var(--w-ink);
    border-color: var(--w-accent);
}

.wisdom-module-title {
    font-size: 15.5px;
    font-weight: 700;
    line-height: 1.3;
    max-width: 75%;
}

.wisdom-module-desc {
    display: block;
    margin-top: 4px;
    font-size: 12.5px;
    font-weight: 400;
    color: var(--w-ink-muted);
    max-width: 75%;
}

.wisdom-module-icon {
    position: absolute;
    right: 14px;
    bottom: 14px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--w-radius-sm);
    background: var(--w-accent-soft);
    color: var(--w-accent-dark);
}

.wisdom-module-icon svg {
    width: 24px;
    height: 24px;
}

/* ---------- full-width wide card (dashboard "E") ---------- */

.wisdom-wide-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-radius: var(--w-radius-lg);
    background: var(--w-card);
    border: 1px solid var(--w-border);
    color: var(--w-ink);
    text-decoration: none;
    margin-bottom: 22px;
}

.wisdom-wide-card:hover {
    color: var(--w-ink);
    border-color: var(--w-accent);
}

.wisdom-wide-card .wisdom-module-icon {
    position: static;
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
}

.wisdom-wide-card .wisdom-module-icon svg {
    width: 30px;
    height: 30px;
}

.wisdom-wide-card-body {
    flex: 1 1 auto;
    min-width: 0;
}

.wisdom-wide-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 3px;
}

.wisdom-wide-card p {
    font-size: 13px;
    color: var(--w-ink-muted);
    margin: 0;
}

/* ---------- generic row-card (used on profile + settings lists) ---------- */

.wisdom-row-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 76px;
    padding: 14px 18px;
    border-radius: var(--w-radius-md);
    background: var(--w-card-solid);
    border: 1px solid var(--w-border);
    margin-bottom: 10px;
    color: inherit;
    text-decoration: none;
}

a.wisdom-row-card:hover {
    border-color: var(--w-accent);
}

.wisdom-row-icon {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--w-accent-soft);
    color: var(--w-accent-dark);
}

.wisdom-row-icon svg {
    width: 20px;
    height: 20px;
}

.wisdom-row-body {
    flex: 1 1 auto;
    min-width: 0;
}

.wisdom-row-label {
    display: block;
    font-size: 13px;
    color: var(--w-ink-muted);
    margin-bottom: 2px;
}

.wisdom-row-value {
    display: block;
    font-size: 15.5px;
    font-weight: 700;
    color: var(--w-ink);
}

.wisdom-row-value.is-empty {
    font-weight: 500;
    color: var(--w-ink-muted);
}

.wisdom-row-chevron {
    flex: 0 0 auto;
    color: var(--w-icon);
}

.wisdom-row-chevron svg {
    width: 18px;
    height: 18px;
}

/* a wide accent-filled row/card, used for the contact CTA on the profile
   (replaces the reference app's Premium banner) */
.wisdom-cta-card {
    padding: 20px;
    border-radius: var(--w-radius-lg);
    background: linear-gradient(120deg, var(--w-accent) 0%, var(--w-accent-dark) 100%);
    color: #fff;
    margin-bottom: 14px;
}

.wisdom-cta-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.wisdom-cta-card p {
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 14px;
}

.wisdom-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.wisdom-cta-actions a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    background: #fff;
    color: var(--w-accent-dark);
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none;
}

/* ---------- bottom mobile nav ---------- */

.wisdom-bottom-nav {
    display: none;
}

@media (max-width: 767.98px) {
    .wisdom-bottom-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1050;
        justify-content: space-around;
        align-items: stretch;
        height: calc(72px + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: #fff;
        border-top: 1px solid var(--w-border);
        box-shadow: 0 -6px 18px rgba(17, 24, 39, 0.06);
    }

    .wisdom-bottom-nav a {
        flex: 1 1 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: var(--w-icon);
        text-decoration: none;
        font-size: 11px;
        font-weight: 600;
        padding: 6px 2px;
    }

    .wisdom-bottom-nav a svg {
        width: 24px;
        height: 24px;
    }

    .wisdom-bottom-nav a .wisdom-nav-icon-wrap {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 52px;
        height: 30px;
        border-radius: 999px;
    }

    .wisdom-bottom-nav a[aria-current="page"] {
        color: var(--w-accent);
    }

    .wisdom-bottom-nav a[aria-current="page"] .wisdom-nav-icon-wrap {
        background: var(--w-accent-soft);
    }
}

/* ---------- profile hero (teacher.php) ---------- */

.wisdom-profile-hero {
    text-align: center;
    padding: 20px 0 8px;
}

.wisdom-profile-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    border-radius: 999px;
    background: var(--w-card-solid);
    border: 4px solid #fff;
    box-shadow: var(--w-shadow-card);
    color: var(--w-accent-dark);
    font-size: 26px;
    font-weight: 700;
    overflow: hidden;
}

.wisdom-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wisdom-profile-hero h1 {
    margin: 14px 0 2px;
    font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.6rem);
    font-weight: 700;
    color: var(--w-ink);
}

.wisdom-profile-hero .wisdom-profile-meta {
    font-size: 13.5px;
    color: var(--w-ink-muted);
}

.wisdom-profile-edit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--w-card-solid);
    border: 1px solid var(--w-border);
    color: var(--w-accent-dark);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

@media (min-width: 1024px) {
    .wisdom-profile-layout {
        display: grid;
        grid-template-columns: minmax(0, 32%) minmax(0, 1fr);
        gap: 18px;
        align-items: start;
        margin-top: 18px;
    }
}

/* generic icon sizing fix inside inline svg icon sprite usage */
.wisdom-icon {
    display: inline-flex;
}

.wisdom-icon svg {
    width: 1em;
    height: 1em;
}

@media (prefers-reduced-motion: reduce) {
    .wisdom-module-card,
    .wisdom-wide-card,
    a.wisdom-row-card {
        transition: none;
    }
}

/* Release review: keep the mobile menu usable and the reading/search flow in
   one shell. Preserve source text and backend names; only presentation changes. */
.wisdom-topbar-name, .wisdom-topbar-sub { display: block; }
.wisdom-topbar-name { margin: 0; white-space: normal; overflow-wrap: anywhere; }
.wisdom-banner-action { white-space: nowrap; min-height: 44px; font-size: 14px; }
.wisdom-banner-action svg, .wisdom-profile-edit svg {
    width: 20px; height: 20px; flex: 0 0 20px;
}
.wisdom-banner, .wisdom-cta-card {
    background: linear-gradient(120deg, #007ca8, #006b93);
}
.wisdom-search button, .wisdom-bell-count,
body.wisdom-shell .btn-primary {
    background-color: var(--w-accent-dark); border-color: var(--w-accent-dark);
}
.wisdom-search button { min-height: 44px; font-size: 14px; }
.wisdom-topbar-sub, .wisdom-module-desc, .wisdom-profile-meta {
    font-size: 14px; color: #596b7b;
}
.wisdom-module-card { padding: 16px 16px 66px; min-height: 172px; }
.wisdom-module-title { display: block; max-width: 100%; font-size: 16px; }
.wisdom-module-desc {
    max-width: 100%; line-height: 1.4;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
    overflow: hidden;
}
.wisdom-profile-avatar { width: 112px; height: 112px; font-size: 34px; }
.wisdom-profile-hero h1 { font-size: clamp(24px, 2.5vw, 30px); overflow-wrap: anywhere; }
body.wisdom-shell :is(a, button, input, select, textarea):focus-visible {
    outline: 3px solid #006b93; outline-offset: 3px;
}
@media (min-width: 1200px) {
    .wisdom-module-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
    .wisdom-bottom-nav a[aria-current="page"] { color: var(--w-accent-dark); }
    .wisdom-bottom-nav { z-index: 1030; }
    body.wisdom-shell .site-footer { background: transparent; padding-top: 12px; }
    body.wisdom-shell .site-footer .footer_top { display: none; }
    body.wisdom-shell .site-footer .copy-right_text {
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    }
}

body.wisdom-shell .community-tabs a { color: #536576; }
body.wisdom-shell .community-tabs a[aria-current="page"] {
    background: var(--w-accent-dark); border-color: var(--w-accent-dark); color: #fff;
}

@media (max-width: 767.98px) {
    body.wisdom-shell .site-footer .copy-right_text small { color: #596b7b; }
}

/* Unified entry and public pages: the same app identity before signing in. */
body.wisdom-shell { --accent-soft-line: #b5dde7; --link-dark: #00678f; }
body.wisdom-shell :is(.card,.resource-card,.store-card,.page-hero) {
    border-radius: 24px; border-color: var(--w-border);
}
body.wisdom-shell :is(.form-control,.form-select) {
    border-radius: 16px; min-height: 46px;
}
body.wisdom-shell :is(.btn-primary,.btn-outline-primary) {
    border-radius: 999px; min-height: 44px;
}
body.wisdom-shell .auth-shell {
    display: flex; flex-direction: column;
    width: 100%; max-width: 560px; margin: 0 auto;
    border: 0; background: transparent; overflow: visible;
    gap: 20px;
}
body.wisdom-shell .auth-shell > .auth-aside {
    order: 0; min-height: 0; padding: 8px 8px 0;
    background: transparent; border: 0; text-align: center;
    align-items: center;
}
.wisdom-auth-mark {
    display: flex; align-items: center; justify-content: center;
    width: 88px; height: 88px; margin: 0 auto 18px;
    border: 5px solid #fff; border-radius: 50%;
    background: #e2f7fd; color: #007ca8;
    font-size: 28px; font-weight: 750;
    box-shadow: 0 8px 24px rgba(0,124,168,.12);
}
body.wisdom-shell .auth-aside .stat-stack { display: none; }
body.wisdom-shell .auth-aside h1 { font-size: clamp(26px,4vw,32px); }
body.wisdom-shell .auth-aside .lead { margin-bottom: 0 !important; font-size: 15px; }
body.wisdom-shell .auth-shell .auth-card {
    order: 1; width: 100%; border: 1px solid var(--w-border);
    background: #fff; box-shadow: 0 5px 0 #b5dde7;
}
body.wisdom-shell .auth-card .card-body { padding: 28px !important; }
body.wisdom-shell .auth-card .form-control {
    background: #f8fcfe; border-color: #b5dde7; min-height: 50px;
}
body.wisdom-shell .auth-card .password-toggle { color: #007ca8; }
body.wisdom-shell .auth-card :is(.section-heading,h2) { font-size: 24px; }
@media (max-width: 575.98px) {
    body.wisdom-shell .auth-card .card-body { padding: 22px !important; }
    body.wisdom-shell .auth-aside .eyebrow { display: none; }
    body.wisdom-shell .auth-shell { gap: 16px; }
}
/* O‘qituvchining tez-tez bajaradigan vazifalari */
.dashboard-actions {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:0 0 20px}
.dashboard-actions a {display:flex;align-items:center;justify-content:center;min-height:48px;padding:10px 12px;text-align:center;text-decoration:none;font-weight:650;background:#fff;border:1px solid #b5dde7;border-radius:14px;color:#075b7b}
.library-shortcuts {display:flex;gap:8px;overflow-x:auto;padding-bottom:6px}
.library-shortcuts a {flex:none;padding:8px 12px;border:1px solid #b5dde7;border-radius:999px;background:#fff;text-decoration:none;white-space:nowrap}
.editor-jumps {display:flex;gap:12px;flex-wrap:wrap;margin-top:18px}.editor-extra {margin-bottom:12px}.editor-extra summary {cursor:pointer;padding:10px 12px;background:#f3f9fb;border:1px solid #b5dde7;border-radius:10px}
#resource-actions,#resource-preview,#editor-steps,#editor-publish {scroll-margin-top:20px}
@media(max-width:767.98px){
 .dashboard-actions {grid-template-columns:repeat(2,minmax(0,1fr))}
 .wisdom-module-card {min-height:110px;padding:14px;gap:8px}
 .wisdom-module-card .wisdom-module-icon {position:static;align-self:flex-end;margin-top:auto;flex:none}
 .wisdom-module-desc {display:-webkit-box;-webkit-line-clamp:3}
 .resource-hero .resource-meta {display:flex;flex-direction:row;flex-wrap:wrap}
 .resource-hero .resource-meta .meta-badge {width:auto}
 .resource-hero-strip {display:none}
}
.resource-meta .pill-counter { margin-inline-start: .3em; }
.resource-meta .js-helpful-count { margin-inline-start: .3em; }
