/**
 * Courses catalog page — subject tabs, horizontal scroll cards.
 */

.catalog-page {
    background: var(--color-bg, #f4f6f9);
}

.catalog-hero {
    background: var(--color-navy, #0f2d5a);
    color: #fff;
    padding: 3rem 0 2.5rem;
}

.catalog-hero h1 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.catalog-hero p {
    opacity: 0.88;
    font-size: 1rem;
    margin-bottom: 0;
}

.catalog-search {
    max-width: 480px;
}

.catalog-search input {
    border-radius: 24px 0 0 24px;
    border: 1px solid var(--color-border);
    padding: 8px 18px;
}

.catalog-search button {
    border-radius: 0 24px 24px 0;
    background: var(--color-navy);
    color: #fff;
    border: none;
    padding: 8px 18px;
}

/* Search sits on the navy hero — invert so the control is visible. */
.catalog-hero .catalog-search button {
    background: #fff;
    color: #0f2d5a;
}

.catalog-hero-stat .value {
    font-size: 1.75rem;
    font-weight: 700;
}

.catalog-hero-stat .label {
    opacity: 0.85;
    font-size: 0.85rem;
}

/* Subject anchor tabs */
.subject-tabs {
    background: #fff;
    border-bottom: 2px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.subject-tabs .tab-btn {
    border: none;
    background: transparent;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 0.88rem;
    color: #555;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
}

.subject-tabs .tab-btn:hover { color: var(--color-navy); }
.subject-tabs .tab-btn.active { color: var(--color-navy); border-bottom-color: var(--color-navy); }

.subject-tabs-inner {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 4px;
}

.subject-tabs-inner::-webkit-scrollbar { display: none; }

/* Subject sections */
.subject-section { padding: 2.25rem 0 1.25rem; }
.subject-section + .subject-section { border-top: 1px solid var(--color-border); }

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.125rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0;
}

.course-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: #ccd6e0 transparent;
}

.course-scroll::-webkit-scrollbar { height: 5px; }
.course-scroll::-webkit-scrollbar-track { background: transparent; }
.course-scroll::-webkit-scrollbar-thumb { background: #ccd6e0; border-radius: 4px; }

.course-card {
    flex: 0 0 240px;
    background: #fff;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    overflow: hidden;
    scroll-snap-align: start;
    transition: box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.course-card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(15, 45, 90, 0.2);
    color: inherit;
}

.card-header-stripe { height: 6px; }

.card-body-inner {
    padding: 14px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-level {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-navy);
    margin-bottom: 4px;
}

.card-title-text {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.35;
    margin-bottom: 8px;
    flex: 1;
}

.card-desc {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
}

.card-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid #f0f2f5;
}

.module-count { font-size: 0.75rem; color: #888; }

.enroll-btn {
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
}

/* Subject colours */
.col-math   { background: linear-gradient(90deg, #0f2d5a, #3a8fd4); }
.col-phys   { background: linear-gradient(90deg, #e84393, #b5276e); }
.col-chem   { background: linear-gradient(90deg, #f7941d, #c76b0a); }
.col-bio    { background: linear-gradient(90deg, #27ae60, #1e8449); }
.col-cs     { background: linear-gradient(90deg, #8e44ad, #6c3483); }
.col-ai     { background: linear-gradient(90deg, #16a085, #0e6655); }
.col-other  { background: linear-gradient(90deg, #7f8c8d, #555); }

.icon-math  { background: #0f2d5a; }
.icon-phys  { background: #e84393; }
.icon-chem  { background: #f7941d; }
.icon-bio   { background: #27ae60; }
.icon-cs    { background: #8e44ad; }
.icon-ai    { background: #16a085; }
.icon-other { background: #7f8c8d; }

.btn-math   { background: #0f2d5a; color: #fff; border: none; }
.btn-math:hover   { background: #1a4a8a; color: #fff; }
.btn-phys   { background: #e84393; color: #fff; border: none; }
.btn-phys:hover   { background: #b5276e; color: #fff; }
.btn-chem   { background: #f7941d; color: #fff; border: none; }
.btn-chem:hover   { background: #c76b0a; color: #fff; }
.btn-bio    { background: #27ae60; color: #fff; border: none; }
.btn-bio:hover    { background: #1e8449; color: #fff; }
.btn-cs     { background: #8e44ad; color: #fff; border: none; }
.btn-cs:hover     { background: #6c3483; color: #fff; }
.btn-ai     { background: #16a085; color: #fff; border: none; }
.btn-ai:hover     { background: #0e6655; color: #fff; }
.btn-other  { background: #7f8c8d; color: #fff; border: none; }

.empty-subject {
    background: #f8fafc;
    border: 1px dashed #ccd6e0;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    color: #999;
    font-size: 0.9rem;
    min-width: 220px;
}
