/* ==========================================================================
   Terapan.id — Course catalog (mobile-first)
   Bergantung pada token & komponen di home.css (.th-btn, .th-card, .th-finder, dst.)
   ========================================================================== */

/* ---------- Header + search ---------- */
.tc-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 32px 0 64px;
    background:
        radial-gradient(circle at 100% 0, rgba(255, 178, 122, .22), transparent 42%),
        radial-gradient(circle at 0 100%, rgba(79, 209, 165, .12), transparent 40%),
        linear-gradient(160deg, var(--th-primary) 0%, var(--th-primary-dark) 70%);
    color: #fff;
}

.tc-title {
    color: #fff;
    font-size: var(--th-fs-h1);
    font-weight: 700;
    line-height: 1.18;
}

.tc-title span {
    color: #ffb27a;
}

.tc-desc {
    margin-top: 12px !important;
    max-width: 620px;
    color: rgba(255, 255, 255, .86);
    font-size: var(--th-fs-base);
    line-height: 1.6;
}

.tc-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 720px;
    margin-top: 24px;
    padding: 6px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
}

.tc-search:focus-within {
    box-shadow: 0 0 0 3px #ffb27a, 0 10px 30px rgba(0, 0, 0, .22);
}

.tc-search-icon {
    flex: 0 0 auto;
    margin-left: 10px;
    color: var(--th-muted);
    font-size: 16px;
}

.tc-search input {
    flex: 1 1 auto;
    min-width: 0;
    height: 48px;
    padding: 0 4px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--th-text);
    font-size: var(--th-fs-base); /* >=16px: cegah auto-zoom iOS */
    -webkit-appearance: none;
    appearance: none;
}

.tc-search input::placeholder {
    color: #7b8a8f;
}

.tc-search input::-webkit-search-cancel-button {
    display: none;
}

.tc-search-clear {
    display: grid;
    place-items: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #eef3f4;
    color: var(--th-muted);
    cursor: pointer;
}

.tc-search-clear[hidden] {
    display: none;
}

.tc-search-clear:hover {
    background: #e1eaec;
    color: var(--th-text);
}

.tc-search-btn {
    flex: 0 0 auto;
    min-height: 48px;
    padding: 10px 16px;
    box-shadow: none;
}

.tc-search-btn .fa-arrow-right {
    display: none;
}




/* ---------- Finder (collapsible) ---------- */
.tc-finder-wrap {
    position: relative;
    z-index: 2;
    margin-top: -36px;
}

.th-finder.tc-finder {
    padding: 0;
    overflow: hidden;
}

.tc-finder-summary {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 72px;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
    -webkit-tap-highlight-color: transparent;
}

.tc-finder-summary::-webkit-details-marker {
    display: none;
}

.tc-finder-summary:focus-visible {
    outline: 3px solid var(--th-accent);
    outline-offset: -3px;
}

.tc-finder-icon {
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--th-accent-soft);
    color: var(--th-accent);
    font-size: 18px;
}

.tc-finder-text {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    line-height: 1.35;
}

.tc-finder-text b {
    color: var(--th-primary-dark);
    font-family: poppins, sans-serif;
    font-size: var(--th-fs-base);
    font-weight: 600;
}

.tc-finder-text small {
    margin-top: 2px;
    color: var(--th-muted);
    font-size: var(--th-fs-sm);
}

.tc-finder-caret {
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--th-primary-soft);
    color: var(--th-primary);
    font-size: 13px;
    transition: transform .25s;
}

.tc-finder[open] .tc-finder-caret {
    transform: rotate(180deg);
}

.tc-finder-body {
    padding: 18px 16px 20px;
    border-top: 1px solid var(--th-border);
}

/* ---------- Results ---------- */
.tc-results {
    padding: 28px 0 48px;
}

.tc-count {
    margin-bottom: 16px !important;
    color: var(--th-muted);
    font-size: var(--th-fs-base);
}

.tc-count b {
    color: var(--th-primary-dark);
}

.tc-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

.tc-grid[hidden] {
    display: none;
}

.tc-grid .th-card {
    flex: none;
    max-width: none;
}

.tc-grid .th-card-body {
    padding-bottom: 4px;
}

.tc-grid .th-card-title {
    margin-bottom: 8px !important;
    font-size: var(--th-fs-md);
}

.tc-card-provider {
    display: flex;
    gap: 8px;
    align-items: center;
    color: var(--th-muted);
    font-size: var(--th-fs-sm);
}

.tc-card-provider i {
    color: var(--th-primary);
}

.tc-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 12px 18px 0;
    padding: 14px 0 16px;
    border-top: 1px solid var(--th-border);
}

.tc-card-btn {
    display: flex;
    flex: 1;
    justify-content: center;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 14px;
    border-radius: 10px;
    background: var(--th-accent);
    color: #fff;
    font-family: poppins, sans-serif;
    font-size: var(--th-fs-sm);
    font-weight: 600;
    white-space: nowrap;
    transition: background-color .2s;
}

.tc-card-btn i {
    font-size: 12px;
    transition: transform .2s;
}

.th-card:hover .tc-card-btn {
    background: var(--th-accent-hover);
}

.th-card:hover .tc-card-btn i {
    transform: translateX(3px);
}

/* Skeleton */
.tc-skeleton {
    overflow: hidden;
    border: 1px solid var(--th-border);
    border-radius: var(--th-radius);
    background: #fff;
}

.tc-skeleton span,
.tc-skeleton i {
    display: block;
    background: linear-gradient(90deg, #eef3f4 0%, #f7fafb 50%, #eef3f4 100%);
    background-size: 200% 100%;
    animation: tc-shimmer 1.2s linear infinite;
}

.tc-skeleton span {
    aspect-ratio: 16 / 10;
}

.tc-skeleton i {
    height: 14px;
    margin: 16px 18px 0;
    border-radius: 6px;
}

.tc-skeleton i:nth-of-type(2) {
    width: 60%;
    margin-top: 10px;
}

.tc-skeleton i:last-child {
    width: 45%;
    height: 34px;
    margin: 22px 18px 18px;
}

@keyframes tc-shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

/* Empty / error */
.tc-empty {
    max-width: 560px;
    margin: 8px auto 0;
    padding: 32px 20px;
    border: 1px dashed #c6dadf;
    border-radius: 18px;
    background: #f7fbfc;
    text-align: center;
}

.tc-empty-icon {
    display: inline-grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin-bottom: 14px;
    border-radius: 50%;
    background: var(--th-primary-soft);
    color: var(--th-primary);
    font-size: 20px;
}

.tc-empty h2 {
    color: var(--th-primary-dark);
    font-size: var(--th-fs-lg);
    font-weight: 700;
}

.tc-empty p {
    margin-top: 8px !important;
    color: var(--th-muted);
    font-size: var(--th-fs-base);
}

.tc-empty-actions {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}

.tc-empty-actions [hidden] {
    display: none !important;
}

.tc-error {
    grid-column: 1 / -1;
    padding: 24px;
    border-radius: var(--th-radius);
    background: #fff5f0;
    color: #8a3a06;
    text-align: center;
}

.tc-error .th-btn {
    margin-top: 12px;
}

/* Pagination (markup dari CI pagination) */
.tc-pagination:empty {
    display: none;
}

.tc-pagination .pagination-wrap {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 28px 0 0 !important;
    padding: 0;
    list-style: none;
}

.tc-pagination .pagination-wrap li {
    display: grid !important;
    place-items: center;
    min-width: 44px;
    height: 44px;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid var(--th-border) !important;
    border-radius: 10px;
    background: #fff !important;
    color: var(--th-primary-dark);
    font-family: poppins, sans-serif;
    font-size: var(--th-fs-base);
    font-weight: 600;
    line-height: 1 !important;
    overflow: hidden;
}

.tc-pagination .pagination-wrap li.active {
    border-color: var(--th-primary) !important;
    background: var(--th-primary) !important;
    color: #fff;
}

.tc-pagination .pagination-wrap li a {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    padding: 0 12px;
    background: transparent !important;
    color: var(--th-primary-dark) !important;
    text-decoration: none !important;
}

.tc-pagination .pagination-wrap li a:hover {
    background: var(--th-primary-soft) !important;
}

.tc-pagination .pagination-wrap li a:focus-visible {
    outline: 3px solid var(--th-accent);
    outline-offset: -3px;
}

/* Final CTA di halaman ini */
.tc-page .th-final {
    padding-bottom: 48px;
}

/* ---------- ≥576px ---------- */
@media (min-width: 576px) {
    .tc-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tc-search-btn {
        padding: 10px 22px;
    }

    .tc-search-btn .fa-arrow-right {
        display: inline-block;
    }

    .tc-empty-actions {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* ---------- ≥768px ---------- */
@media (min-width: 768px) {
    .tc-hero {
        padding: 56px 0 84px;
    }

    .tc-finder-wrap {
        margin-top: -44px;
    }

    .tc-finder-summary {
        padding: 16px 24px;
    }

    .tc-finder-body {
        padding: 22px 24px 24px;
    }

    .tc-results {
        padding: 40px 0 64px;
    }

    .tc-grid {
        gap: 24px;
    }

    .tc-page .th-final {
        padding-bottom: 72px;
    }
}

/* ---------- ≥992px ---------- */
@media (min-width: 992px) {
    .tc-hero {
        padding: 64px 0 92px;
    }

    .tc-hero .container {
        text-align: center;
    }

    .tc-hero .tc-desc,
    .tc-search {
        margin-right: auto;
        margin-left: auto;
    }

    .tc-hero .tc-desc {
        font-size: var(--th-fs-md);
    }


    .tc-finder .th-finder-title,
    .tc-finder .th-finder-desc {
        display: none;
    }

    .tc-finder-body {
        padding-top: 20px;
    }

    .tc-finder form {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
        align-items: end;
        column-gap: 16px;
    }

    .tc-finder form .th-btn {
        grid-column: auto;
        width: auto;
        margin: 0 0 14px;
        padding: 10px 24px;
    }

    .tc-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    /* WA float: geser ke gutter agar tidak menutupi konten */
    body .float {
        left: 16px;
        bottom: 24px;
        width: 52px;
        height: 52px;
        font-size: 26px;
    }

    body .float .my-float {
        margin-top: 13px;
    }
}

/* "For : peruntukan" di card course (sama seperti Home) */
.tc-card-for {
    margin-bottom: 6px !important;
    color: var(--th-muted);
    font-size: var(--th-fs-sm);
    line-height: 1.45;
}
