/* ═══════════════════════════════════════════════════
   EduSphere — Courses List Page
   ═══════════════════════════════════════════════════ */

.cl-main {
    background: var(--bg);
    min-height: calc(100vh - 66px);
    padding: 36px 0 60px;
}

/* ── Page heading ── */
.cl-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}
.cl-page-head__title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 4px;
}
.cl-page-head__sub {
    font-size: .88rem;
    color: var(--muted);
    margin: 0;
}
.cl-result-count {
    font-size: .85rem;
    color: var(--muted);
    font-weight: 500;
    white-space: nowrap;
}

/* ── Filter wrapper — khung bo góc bao tabs + filter bar ── */
.cl-filter-wrapper {
    background: var(--white);
    border: 2px solid #BAE0FD;
    border-radius: var(--r16);
    box-shadow: 0 2px 12px rgba(27,154,245,.07);
    padding: 18px 20px 16px;
    margin-bottom: 28px;
}

.cl-filter-divider {
    height: 1px;
    background: var(--line);
    margin: 14px 0;
}

/* ── Category tabs ── */
.cl-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.cl-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 18px;
    border-radius: 999px;
    font-size: .83rem;
    font-weight: 600;
    color: var(--ink-2);
    background: var(--white);
    border: 1.5px solid var(--line);
    cursor: pointer;
    transition: all .18s ease;
    text-decoration: none;
    white-space: nowrap;
}
.cl-tab:hover {
    border-color: var(--blue);
    color: var(--blue);
    background: var(--blue-light);
    text-decoration: none;
}
.cl-tab--active {
    background: var(--blue);
    color: var(--white);
    border-color: var(--blue);
    box-shadow: 0 3px 12px rgba(27,154,245,.30);
}
.cl-tab--active:hover {
    background: var(--blue-dark);
    color: var(--white);
    text-decoration: none;
}

/* ── Filter bar ── */
.cl-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.cl-filter-bar__left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.cl-filter-bar__label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .83rem;
    font-weight: 600;
    color: var(--ink-2);
}

.cl-select {
    height: 36px;
    padding: 0 32px 0 12px;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    font-size: .83rem;
    color: var(--ink-2);
    background: var(--bg) url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center;
    appearance: none;
    cursor: pointer;
    font-family: inherit;
    transition: border .18s;
    outline: none;
}
.cl-select:focus { border-color: var(--blue); }

/* Search bên phải filter bar */
.cl-filter-bar__right { flex-shrink: 0; }

.cl-search-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    overflow: hidden;
    background: var(--bg);
    transition: border .18s;
}
.cl-search-wrap:focus-within { border-color: var(--blue); }

.cl-search-input {
    width: 220px;
    height: 36px;
    padding: 0 14px;
    border: none;
    background: transparent;
    font-size: .85rem;
    color: var(--ink);
    outline: none;
    font-family: inherit;
}
.cl-search-input::placeholder { color: var(--muted-2); }

.cl-search-btn {
    width: 40px;
    height: 36px;
    background: var(--blue);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .18s;
    flex-shrink: 0;
}
.cl-search-btn:hover { background: var(--blue-dark); }

/* ── Course grid ── */
.cl-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* ── Course card ── */
.cl-card {
    background: var(--white);
    border-radius: var(--r16);
    overflow: hidden;
    border: 1px solid var(--line);
    transition: all .22s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.cl-card:hover {
    box-shadow: 0 8px 28px rgba(27,154,245,.15);
    transform: translateY(-4px);
    border-color: var(--blue);
}

/* Thumbnail */
.cl-card__thumb {
    position: relative;
    height: 150px;
    overflow: hidden;
    background: var(--blue-light);
}
.cl-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}
.cl-card:hover .cl-card__img { transform: scale(1.04); }

.cl-card__thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: linear-gradient(135deg, #DBEAFE, #BFDBFE);
}

.cl-card__level-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    font-size: .68rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.90);
    color: var(--blue-dark);
    backdrop-filter: blur(4px);
}

/* Card body */
.cl-card__body {
    padding: 16px 16px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
}
.cl-card__cat {
    font-size: .7rem;
    font-weight: 700;
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.cl-card__title {
    font-size: .92rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.35;
    flex: 1;
    margin: 0;
}
.cl-card__title a { color: var(--ink); transition: color .18s; }
.cl-card__title a:hover { color: var(--blue); text-decoration: none; }

.cl-card__instructor {
    font-size: .78rem;
    color: var(--muted);
    margin: 0;
}

/* Card footer */
.cl-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}
.cl-card__price {
    font-size: .95rem;
    font-weight: 800;
    color: var(--blue-dark);
}
.cl-card__price--free { color: #16a34a; }

.cl-card__arrow {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--blue-light);
    color: var(--blue);
    display: flex; align-items: center; justify-content: center;
    font-size: .9rem;
    font-weight: 700;
    transition: all .18s;
    text-decoration: none;
    flex-shrink: 0;
}
.cl-card__arrow:hover { background: var(--blue); color: var(--white); text-decoration: none; }

/* ── Empty state ── */
.cl-empty {
    text-align: center;
    padding: 64px 32px;
    background: var(--white);
    border-radius: var(--r16);
    border: 1px solid var(--line);
}
.cl-empty__icon { font-size: 3rem; margin-bottom: 16px; display: block; }
.cl-empty h3 { font-size: 1.1rem; font-weight: 700; color: var(--ink); margin-bottom: 10px; }
.cl-empty p  { font-size: .88rem; color: var(--muted); margin-bottom: 24px; }

/* ── Pagination ── */
.cl-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 36px;
}
.cl-page-btn {
    display: inline-flex;
    align-items: center;
    padding: 9px 22px;
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--blue);
    border: 1.5px solid var(--blue);
    background: var(--white);
    transition: all .18s;
    text-decoration: none;
}
.cl-page-btn:hover { background: var(--blue); color: var(--white); text-decoration: none; }
.cl-page-info {
    font-size: .85rem;
    font-weight: 600;
    color: var(--muted);
}

/* ── Responsive ── */
@media (max-width: 1100px) {
    .cl-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
    .cl-grid { grid-template-columns: repeat(2, 1fr); }
    .cl-filter-bar { flex-direction: column; align-items: stretch; gap: 12px; }
    .cl-filter-bar__right { width: 100%; }
    .cl-search-wrap { width: 100%; }
    .cl-search-input { flex: 1; width: auto; }
}
@media (max-width: 540px) {
    .cl-grid { grid-template-columns: 1fr; }
}
