/* Knowledge Center — public searchable use-case library.
   Brand: green #2AA466, text #454B54, headings #2c3e50. */

.kc-page {
    background: #f7f9f8;
    min-height: 60vh;
    padding: 0 0 64px;
}

.kc-page .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ---- Hero + search ---- */
.kc-hero {
    text-align: center;
    padding: 48px 16px 28px;
}
.kc-title {
    color: #2c3e50;
    font-size: 38px;
    font-weight: 700;
    margin: 0 0 10px;
}
.kc-subtitle {
    color: #454B54;
    font-size: 17px;
    max-width: 620px;
    margin: 0 auto 28px;
    line-height: 1.5;
}
.kc-search {
    max-width: 560px;
    margin: 0 auto;
}
.kc-search-input {
    position: relative;
}
.kc-search-input input {
    padding-right: 44px !important;
    background: #fff;
}
.kc-search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* ---- Category chips ---- */
.kc-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 26px 0 34px;
}
.kc-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #cdcfd4;
    background: #fff;
    color: #454B54;
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s ease;
}
/* color dot on each filter chip */
.kc-chip .kc-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #9aa0a6;
    flex: 0 0 auto;
}
.kc-chip.active .kc-dot { background: #fff; }

/* ---- Category color coding (chips + card badge) ----
   All = slate, Buyers = blue, Suppliers = brand green, Resellers = amber. */
.kc-chip.kc-cat-all      .kc-dot { background: #6b7280; }
.kc-chip.kc-cat-buyers   .kc-dot { background: #2563eb; }
.kc-chip.kc-cat-suppliers .kc-dot { background: #2AA466; }
.kc-chip.kc-cat-resellers .kc-dot { background: #d9822b; }

.kc-chip.kc-cat-all:hover      { border-color: #6b7280; color: #6b7280; }
.kc-chip.kc-cat-buyers:hover   { border-color: #2563eb; color: #2563eb; }
.kc-chip.kc-cat-suppliers:hover{ border-color: #2AA466; color: #2AA466; }
.kc-chip.kc-cat-resellers:hover{ border-color: #d9822b; color: #d9822b; }

.kc-chip.kc-cat-all.active      { background: #6b7280; border-color: #6b7280; color: #fff; }
.kc-chip.kc-cat-buyers.active   { background: #2563eb; border-color: #2563eb; color: #fff; }
.kc-chip.kc-cat-suppliers.active{ background: #2AA466; border-color: #2AA466; color: #fff; }
.kc-chip.kc-cat-resellers.active{ background: #d9822b; border-color: #d9822b; color: #fff; }

/* ---- Card grid ---- */
.kc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
}
.kc-card {
    display: flex;
    flex-direction: column;
    text-align: left;
    background: #fff;
    border: 1px solid #e7eae9;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    transition: box-shadow .18s ease, transform .18s ease;
}
.kc-card:hover {
    box-shadow: 0 10px 28px rgba(42, 164, 102, .14);
    transform: translateY(-3px);
    border-color: #d7efe3;
}
.kc-card-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
    background-color: #e9efed;
}
.kc-card-thumb--placeholder {
    background-image: linear-gradient(135deg, #2AA466 0%, #1f8a55 100%);
}
.kc-play {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(23, 24, 26, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease;
}
.kc-card:hover .kc-play {
    background: #2AA466;
}
.kc-duration {
    position: absolute;
    right: 10px;
    bottom: 10px;
    background: rgba(23, 24, 26, .78);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
}
/* "Watched" badge — top-left of the thumbnail, shown only on watched cards */
.kc-watched-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    display: none;
    align-items: center;
    gap: 5px;
    background: rgba(42, 164, 102, .96);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 9px 4px 7px;
    border-radius: 999px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .22);
    z-index: 3;
}
.kc-card.is-watched .kc-watched-badge { display: inline-flex; }
.kc-card-body {
    padding: 16px 18px 20px;
}
.kc-card-cat {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #2AA466;
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
}
/* colored pill per audience group */
.kc-card-cat.kc-cat-all      { color: #4b5563; background: #eef0f2; }
.kc-card-cat.kc-cat-buyers   { color: #1d4ed8; background: #eaf1ff; }
.kc-card-cat.kc-cat-suppliers{ color: #1f8a55; background: #e7f7ef; }
.kc-card-cat.kc-cat-resellers{ color: #b4641a; background: #fbeede; }
.kc-card-title {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.3;
}
.kc-card-summary {
    color: #454B54;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

/* ---- States ---- */
.kc-state {
    text-align: center;
    color: #454B54;
    padding: 60px 16px;
}
.kc-spinner {
    width: 38px;
    height: 38px;
    border: 3px solid #d7efe3;
    border-top-color: #2AA466;
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: kc-spin .8s linear infinite;
}
@keyframes kc-spin { to { transform: rotate(360deg); } }

/* ---- Modal (rides on the global .popup-main shell) ---- */
/* 80% of the screen height. Uses % (not vh) on purpose: the .popup-wrapper is a
   fixed full-viewport box, so % is true to the real screen, while the site-wide
   `html { zoom: 0.8 }` (>=1024px) makes vh resolve to only ~64% visually. */
.kc-popup .popup-inner {
    max-width: 940px;
    width: 94vw;
    height: 80%;
    max-height: 80%;
}
/* global .popup-content centers text; the use-case body reads left-aligned */
.kc-popup .popup-content {
    text-align: left;
}
.kc-video-wrap {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    margin-bottom: 16px;
}
.kc-video-wrap video {
    width: 100%;
    display: block;
    aspect-ratio: 16 / 9;
    max-height: 70vh;
    background: #000;
    cursor: pointer;
}
/* ---- Custom video controls (fill + thumb both from currentTime) ---- */
.kc-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, .78), rgba(0, 0, 0, 0));
    opacity: 1;
    pointer-events: auto;
}
.kc-cbtn {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    border-radius: 6px;
}
.kc-cbtn:hover { background: rgba(255, 255, 255, .16); }
.kc-ic { display: none; }
.kc-video-wrap.kc-paused .kc-ic-play { display: block; }
.kc-video-wrap:not(.kc-paused) .kc-ic-pause { display: block; }
.kc-video-wrap:not(.kc-muted) .kc-ic-vol { display: block; }
.kc-video-wrap.kc-muted .kc-ic-muted { display: block; }
.kc-time {
    flex: 0 0 auto;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    min-width: 84px;
    text-align: center;
}
.kc-seek {
    flex: 1 1 auto;
    padding: 10px 0;
    cursor: pointer;
    touch-action: none;
}
.kc-seek-track {
    position: relative;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .3);
}
.kc-seek-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: #2AA466;
    border-radius: 999px;
}
.kc-seek-thumb {
    position: absolute;
    top: 50%;
    left: 0;
    width: 13px;
    height: 13px;
    margin-left: -6.5px;
    border-radius: 50%;
    background: #fff;
    transform: translateY(-50%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}

/* Footer: a single centered Close button with breathing room below */
.kc-popup .popup-footer {
    display: flex;
    justify-content: center;
    padding: 6px 20px 26px;
}
.kc-popup .popup-footer .btn {
    min-width: 220px;
    width: auto;
    margin: 0;
    justify-content: center;
}
.kc-popup-category {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #2AA466;
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
}
.kc-popup-category.kc-cat-all      { color: #4b5563; background: #eef0f2; }
.kc-popup-category.kc-cat-buyers   { color: #1d4ed8; background: #eaf1ff; }
.kc-popup-category.kc-cat-suppliers{ color: #1f8a55; background: #e7f7ef; }
.kc-popup-category.kc-cat-resellers{ color: #b4641a; background: #fbeede; }
.kc-popup-summary {
    color: #454B54;
    font-size: 15px;
    line-height: 1.55;
    margin: 0 0 18px;
}
.kc-steps-heading {
    color: #2c3e50;
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 12px;
}
.kc-steps {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: kc-step;
}
.kc-steps li {
    position: relative;
    counter-increment: kc-step;
    padding: 0 0 16px 44px;
    color: #454B54;
    font-size: 15px;
    line-height: 1.55;
}
.kc-steps li::before {
    content: counter(kc-step);
    position: absolute;
    left: 0;
    top: -2px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #2AA466;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.kc-steps li:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 13px;
    top: 30px;
    bottom: 4px;
    width: 2px;
    background: #d7efe3;
}

/* ---- Transcript (expandable in the popup; in the DOM for crawlers) ---- */
.kc-transcript {
    margin: 22px 0 4px;
    border-top: 1px solid #e7eae9;
    padding-top: 16px;
}
.kc-transcript-summary {
    cursor: pointer;
    list-style: none;
    color: #2AA466;
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    user-select: none;
}
.kc-transcript-summary::-webkit-details-marker { display: none; }
.kc-transcript-summary::before {
    content: "";
    width: 0;
    height: 0;
    border-left: 6px solid #2AA466;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    transition: transform .15s ease;
}
.kc-transcript[open] .kc-transcript-summary::before { transform: rotate(90deg); }
.kc-transcript-body {
    margin-top: 12px;
}
.kc-transcript-body p {
    color: #454B54;
    font-size: 14.5px;
    line-height: 1.6;
    margin: 0 0 12px;
}
.kc-fullpage-link {
    display: inline-block;
    margin: 14px 0 4px;
    color: #2AA466;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}
.kc-fullpage-link:hover { text-decoration: underline; }

/* ---- Detail page (/knowledge-center/<slug>) ---- */
.kc-detail-page { padding-top: 0; }
.kc-detail {
    max-width: 820px;
    padding-top: 64px;
}
@media (max-width: 600px) {
    .kc-detail { padding-top: 40px; }
}
.kc-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 18px;
}
.kc-breadcrumb a { color: #2AA466; text-decoration: none; }
.kc-breadcrumb a:hover { text-decoration: underline; }
.kc-breadcrumb-current { color: #6b7280; }
.kc-detail-cat {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    padding: 4px 12px;
    border-radius: 999px;
    text-decoration: none;
    margin-bottom: 12px;
}
.kc-detail-cat.kc-cat-all      { color: #4b5563; background: #eef0f2; }
.kc-detail-cat.kc-cat-buyers   { color: #1d4ed8; background: #eaf1ff; }
.kc-detail-cat.kc-cat-suppliers{ color: #1f8a55; background: #e7f7ef; }
.kc-detail-cat.kc-cat-resellers{ color: #b4641a; background: #fbeede; }
.kc-detail-title {
    color: #2c3e50;
    font-size: 30px;
    font-weight: 700;
    margin: 0 0 12px;
    line-height: 1.25;
}
.kc-detail-summary {
    color: #454B54;
    font-size: 17px;
    line-height: 1.55;
    margin: 0 0 22px;
}
.kc-detail-video {
    border-radius: 14px;
    overflow: hidden;
    background: #000;
    margin-bottom: 26px;
}
.kc-detail-video video {
    width: 100%;
    display: block;
    aspect-ratio: 16 / 9;
    background: #000;
}
.kc-detail .kc-steps-heading { margin-top: 28px; }
.kc-detail-transcript p {
    color: #454B54;
    font-size: 16px;
    line-height: 1.7;
    margin: 0 0 16px;
}
.kc-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 26px 0 4px;
}
.kc-detail-tag {
    font-size: 12px;
    color: #6b7280;
    background: #f0f2f4;
    border-radius: 999px;
    padding: 4px 12px;
}
.kc-detail-back {
    margin: 30px 0 10px;
}
.kc-detail-back .btn { min-width: 240px; }

@media (max-width: 600px) {
    .kc-detail-title { font-size: 24px; }
}

body.kc-popup-open {
    overflow: hidden;
}

@media (max-width: 600px) {
    .kc-title { font-size: 30px; }
    .kc-grid { grid-template-columns: 1fr; }
}
