:root {
    --youtube: #ff0000;
    --youtube-dark: #cc0000;
    --youtube-light: #ff4b4b;
    --ssc1: #0f5fd7;
    --ssc2: #7c3aed;
    --hssc1: #f2c230;
    --hssc2: #ef4444;
}

.courses-pattern {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(15,95,215,.03) 1px,transparent 1px),

    linear-gradient(90deg,
    rgba(15,95,215,.03) 1px,
    transparent 1px);
    background-size: 45px 45px;
    mask-image: linear-gradient(to bottom,
    rgba(0,0,0,.5),
    transparent);
}

/* =====================================================
    SEARCH BAR
===================================================== */

/* =====================================================
    HERO STATS
===================================================== */

/* =====================================================
    DASHBOARD
===================================================== */

.courses-dashboard {
    margin-top: -35px;
    position: relative;
    z-index: 5;
    margin-bottom: 70px;
}

/* =====================================================
    GRADE TABS
===================================================== */

.grade-tabs {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 25px;
    scrollbar-width: none;
}

.grade-tabs::-webkit-scrollbar {
    display: none;
}

.grade-tab {
    min-width: 170px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px;
    cursor: pointer;
    transition: .35s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.grade-tab span {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.grade-tab small {
    color: var(--muted);
    margin-top: 5px;
}

.grade-tab:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.grade-tab.active {
    background: linear-gradient(
    135deg,
    var(--primary),
    #6d5dfc);
    color: white;
    border: none;
}

.grade-tab.active span,

.grade-tab.active small {
    color: white;
}

/* =====================================================
    FILTER ROW
===================================================== */

.courses-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    align-items: end;
    background: white;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 28px;
    box-shadow: var(--shadow-sm);
}

.filter-group {
    flex: 1;
    min-width: 220px;
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: .82rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
}

.filter-group label i {
    color: var(--primary);
}

.filter-group select {
    width: 100%;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    font-family: inherit;
    cursor: pointer;
    transition: .3s;
}

.filter-group select:hover,

.filter-group select:focus {
    border-color: var(--primary);
    background: white;
    outline: none;
}

.reset-btn {
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    background: #fee2e2;
    color: #dc2626;
    font-weight: 700;
    cursor: pointer;
    transition: .3s;
}

.reset-btn:hover {
    transform: translateY(-2px);
    background: #fecaca;
}

/* =====================================================
    ACTIVE FILTER CHIPS
===================================================== */

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.active-filters:empty {
    display: none;
}

.filter-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: rgba(15,95,215,.08);
    color: var(--primary);
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 600;
}

.filter-chip i {
    cursor: pointer;
}

/* =====================================================
    RESULTS SECTION
===================================================== */

.courses-section {
    margin-bottom: 70px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 35px;
    flex-wrap: wrap;
}

.results-header h2 {
    font-family: "Alice", serif;
    font-size: 2rem;
    color: var(--text);
}

#resultsCount {
    color: var(--muted);
    font-weight: 600;
}

/* =====================================================
    PLAYLIST GRID
===================================================== */

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 30px;
}

/* =====================================================
    PLAYLIST CARD
===================================================== */

.playlist-card {
    position: relative;
    background: white;
    border: 1px solid var(--border);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: .35s ease;
    animation: cardAppear .45s ease;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.playlist-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

/* =====================================================
    THUMBNAIL
===================================================== */

.playlist-thumbnail {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: linear-gradient(135deg,
            var(--primary),
            var(--youtube));
}

/* Later you can simply place an image */

.playlist-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* placeholder */

.thumbnail-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: rgba(255,255,255,.9);
    gap: 16px;
}

.thumbnail-placeholder i {
    font-size: 4rem;
    opacity: .9;
}

.thumbnail-placeholder span {
    font-size: .9rem;
    font-weight: 600;
    letter-spacing: .4px;
}

/* =====================================================
    PLAY BUTTON
===================================================== */

.play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(
            rgba(0,0,0,.15),
            rgba(0,0,0,.25));
    transition: .35s;
}

.play-button {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(255,255,255,.94);
    color: var(--youtube);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    transition: .35s;
    backdrop-filter: blur(12px);
    box-shadow: 0 15px 40px rgba(0,0,0,.18);
}

.playlist-card:hover .play-button {
    transform: scale(1.12);
    background: white;
}

.playlist-card:hover .play-overlay {
    background: rgba(0,0,0,.12);
}

/* =====================================================
    FEATURED BADGES
===================================================== */

.course-ribbon {
    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 5;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    color: white;
}

.ribbon-featured {
    background: linear-gradient(
            135deg,
            #f2c230,
            #f97316);
}

.ribbon-new {
    background: linear-gradient(
            135deg,
            #10b981,
            #059669);
}

/* =====================================================
    CARD BODY
===================================================== */

.playlist-content {
    padding: 24px;
}

.course-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.course-grade,

.course-subject {
    padding: 7px 14px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
}

.course-grade {
    background: rgba(15,95,215,.09);
    color: var(--primary);
}

.course-subject {
    background: rgba(239,68,68,.08);
    color: var(--youtube);
}

.chapter-title {
    font-family: "Alice", serif;
    font-size: 1.55rem;
    color: var(--text);
    margin-bottom: 10px;
    line-height: 1.3;
}

.chapter-description {
    color: var(--muted);
    line-height: 1.7;
    font-size: .92rem;
    margin-bottom: 24px;
}

/* =====================================================
    COURSE META
===================================================== */

.course-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 26px;
    color: var(--muted);
    font-size: .85rem;
}

.course-meta span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.course-meta i {
    color: var(--primary);
}

/* =====================================================
    WATCH BUTTON
===================================================== */

.watch-playlist {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 15px;
    border-radius: 14px;
    background: linear-gradient(
            135deg,
            var(--youtube),
            var(--youtube-dark));
    color: white;
    font-weight: 700;
    transition: .3s;
}

.watch-playlist:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
    box-shadow: 0 15px 35px rgba(255,0,0,.22);
}

.watch-playlist i {
    font-size: 1.1rem;
}

/* =====================================================
    EMPTY STATE
===================================================== */

.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 90px 20px;
    color: var(--muted);
}

.empty-state.visible {
    display: flex;
}

.empty-state i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-family: "Alice", serif;
    color: var(--text);
    font-size: 1.6rem;
    margin-bottom: 12px;
}

.empty-state p {
    margin-bottom: 30px;
}

/* =====================================================
    WHY BNA COURSES
===================================================== */

.courses-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin: 90px auto 120px;
}

.feature-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 35px 30px;
    text-align: center;
    overflow: hidden;
    transition: .35s ease;
    box-shadow: var(--shadow-sm);
}

.feature-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(
            90deg,
            var(--primary),
            var(--youtube));
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.feature-card i {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 22px;
    border-radius: 18px;
    font-size: 1.8rem;
    color: white;
    background: linear-gradient(
            135deg,
            var(--primary),
            var(--youtube));
    box-shadow: 0 15px 35px rgba(15,95,215,.18);
}

.feature-card h3 {
    font-family: "Alice", serif;
    font-size: 1.45rem;
    color: var(--text);
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--muted);
    line-height: 1.8;
    font-size: .95rem;
}

/* =====================================================
    HOVER MICRO ANIMATIONS
===================================================== */

.playlist-card,
.feature-card,
.grade-tab,
.reset-btn,
.watch-playlist {
    transition: transform .35s ease,
        box-shadow .35s ease,
        background .35s ease,
        color .35s ease,
        border-color .35s ease;
}

.watch-playlist i {
    transition: transform .3s;
}

.watch-playlist:hover i {
    transform: translateX(4px);
}

.grade-tab:hover span {
    color: var(--primary);
}

.grade-tab.active:hover span,

.grade-tab.active:hover small {
    color: white;
}

/* =====================================================
    SCROLLBAR
===================================================== */

.grade-tabs::-webkit-scrollbar {
    height: 7px;
}

.grade-tabs::-webkit-scrollbar-thumb {
    background: rgba(15,95,215,.25);
    border-radius: 20px;
}

.grade-tabs::-webkit-scrollbar-track {
    background: transparent;
}

/* =====================================================
    TABLET
===================================================== */

@media (max-width:992px) {
    
.courses-grid {
        grid-template-columns: repeat(auto-fill,minmax(300px,1fr));
    }

    
}

/* =====================================================
    MOBILE
===================================================== */

@media (max-width:768px) {
    
.courses-dashboard {
        margin-top: -15px;
    }

    .courses-filter-row {
        padding: 20px;
    }

    .filter-group {
        min-width: 100%;
    }

    .reset-btn {
        width: 100%;
    }

    .courses-grid {
        grid-template-columns: 1fr;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .playlist-content {
        padding: 20px;
    }

    .chapter-title {
        font-size: 1.35rem;
    }

    .play-button {
        width: 72px;
        height: 72px;
        font-size: 1.6rem;
    }

    .feature-card {
        padding: 30px 24px;
    }
}

/* =====================================================
    SMALL DEVICES
===================================================== */

@media (max-width:480px) {
    
.grade-tab {
        min-width: 145px;
        padding: 18px;
    }

    .course-meta {
        flex-direction: column;
        gap: 12px;
    }

    .watch-playlist {
        padding: 14px;
        font-size: .9rem;
    }
}

/* =====================================================
    ACCESSIBILITY
===================================================== */

.watch-playlist:focus,
.reset-btn:focus,
.grade-tab:focus,
select:focus,
input:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(15,95,215,.18);
}

/* =====================================================
    REDUCED MOTION
===================================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
