:root {
    --bg: #07111f;
    --bg-secondary: #0c1828;
    --card: rgba(15, 31, 50, 0.86);
    --card-hover: rgba(20, 42, 66, 0.95);

    --text: #f5f7fb;
    --text-secondary: #aebbd0;
    --text-muted: #718096;

    --primary: #6c8cff;
    --primary-hover: #829dff;

    --border: rgba(255, 255, 255, 0.10);

    --success: #38d996;
    --warning: #ffca58;

    --radius: 18px;

    --shadow:
        0 20px 60px rgba(0, 0, 0, 0.28);
}


* {
    box-sizing: border-box;
}


html {
    scroll-behavior: smooth;
}


body {
    margin: 0;
    min-height: 100vh;

    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    color: var(--text);

    background:
        radial-gradient(
            circle at 15% 10%,
            rgba(108, 140, 255, 0.15),
            transparent 30%
        ),
        radial-gradient(
            circle at 85% 20%,
            rgba(56, 217, 150, 0.08),
            transparent 28%
        ),
        var(--bg);
}


/* =========================
   HEADER
========================= */

.courses-header {
    position: sticky;
    top: 0;
    z-index: 100;

    border-bottom:
        1px solid var(--border);

    background:
        rgba(7, 17, 31, 0.86);

    backdrop-filter:
        blur(18px);
}


.header-container {
    width: min(
        1200px,
        calc(100% - 40px)
    );

    min-height: 72px;

    margin: auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 24px;
}


.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    color: var(--text);

    text-decoration: none;

    font-weight: 700;
}


.brand-mark {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    border-radius: 11px;

    background:
        linear-gradient(
            135deg,
            var(--primary),
            #9b6cff
        );

    color: white;

    font-size: 13px;
}


.brand-text {
    font-size: 16px;
}


.main-nav {
    display: flex;
    align-items: center;
    gap: 26px;
}


.main-nav a {
    color: var(--text-secondary);

    text-decoration: none;

    font-size: 14px;
    font-weight: 600;

    transition:
        color 0.2s ease;
}


.main-nav a:hover,
.main-nav a.active {
    color: white;
}


.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 10px 15px;

    border:
        1px solid var(--border);

    border-radius: 10px;

    color: var(--text);

    text-decoration: none;

    font-size: 13px;
    font-weight: 600;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}


.back-button:hover {
    background: rgba(255, 255, 255, 0.06);

    transform: translateY(-1px);
}


/* =========================
   HERO
========================= */

.courses-hero {
    padding:
        90px 20px
        70px;

    text-align: center;
}


.hero-content {
    width: min(
        820px,
        100%
    );

    margin: auto;
}


.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    margin-bottom: 18px;

    color: var(--primary);

    font-size: 12px;
    font-weight: 800;

    letter-spacing: 1.5px;
}


.courses-hero h1 {
    margin: 0;

    font-size:
        clamp(
            42px,
            6vw,
            72px
        );

    line-height: 1.05;

    letter-spacing: -2.5px;
}


.courses-hero h1 span {
    display: block;

    background:
        linear-gradient(
            90deg,
            #7d9aff,
            #b28cff
        );

    -webkit-background-clip: text;
    background-clip: text;

    color: transparent;
}


.courses-hero p {
    max-width: 680px;

    margin:
        26px auto 0;

    color: var(--text-secondary);

    font-size: 17px;

    line-height: 1.75;
}


/* =========================
   MARKETPLACE
========================= */

.course-marketplace {
    width: min(
        1200px,
        calc(100% - 40px)
    );

    margin:
        0 auto
        80px;
}


.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 28px;
}


.section-label {
    color: var(--primary);

    font-size: 11px;
    font-weight: 800;

    letter-spacing: 1.5px;
}


.section-heading h2 {
    margin:
        7px 0 5px;

    font-size: 32px;

    letter-spacing: -1px;
}


.section-heading p {
    margin: 0;

    color: var(--text-muted);
}


.course-count {
    color: var(--text-secondary);

    font-size: 14px;
    font-weight: 600;
}


/* =========================
   CONTROLS
========================= */

.course-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 18px;

    margin-bottom: 30px;

    padding: 16px;

    border:
        1px solid var(--border);

    border-radius: var(--radius);

    background:
        rgba(255, 255, 255, 0.025);
}


.search-box {
    position: relative;

    width: min(
        330px,
        100%
    );
}


.search-box i {
    position: absolute;

    left: 14px;
    top: 50%;

    transform:
        translateY(-50%);

    color: var(--text-muted);
}


.search-box input {
    width: 100%;

    padding:
        12px
        14px
        12px
        40px;

    border:
        1px solid var(--border);

    border-radius: 10px;

    outline: none;

    background:
        rgba(0, 0, 0, 0.16);

    color: var(--text);

    font: inherit;
}


.search-box input::placeholder {
    color: var(--text-muted);
}


.search-box input:focus {
    border-color:
        rgba(108, 140, 255, 0.65);

    box-shadow:
        0 0 0 3px
        rgba(108, 140, 255, 0.10);
}


.filter-buttons {
    display: flex;
    flex-wrap: wrap;

    justify-content: flex-end;

    gap: 8px;
}


.filter-button {
    padding:
        9px
        13px;

    border:
        1px solid var(--border);

    border-radius: 9px;

    background:
        transparent;

    color: var(--text-secondary);

    cursor: pointer;

    font: inherit;
    font-size: 12px;
    font-weight: 700;

    transition:
        all 0.2s ease;
}


.filter-button:hover {
    background:
        rgba(255, 255, 255, 0.05);

    color: white;
}


.filter-button.active {
    border-color:
        transparent;

    background:
        var(--primary);

    color: white;
}


/* =========================
   COURSE GRID
========================= */

.courses-grid {
    display: grid;

    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );

    gap: 22px;
}


.course-card {
    overflow: hidden;

    border:
        1px solid var(--border);

    border-radius: var(--radius);

    background:
        var(--card);

    box-shadow:
        var(--shadow);

    transition:
        transform 0.25s ease,
        border-color 0.25s ease,
        background 0.25s ease;
}


.course-card:hover {
    transform:
        translateY(-6px);

    border-color:
        rgba(108, 140, 255, 0.35);

    background:
        var(--card-hover);
}


.course-thumbnail {
    position: relative;

    aspect-ratio: 16 / 9;

    overflow: hidden;

    background:
        linear-gradient(
            135deg,
            #162a45,
            #101a2b
        );
}


.course-thumbnail img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;

    transition:
        transform 0.4s ease;
}


.course-card:hover
.course-thumbnail img {
    transform:
        scale(1.04);
}


.course-badge {
    position: absolute;

    top: 12px;
    left: 12px;

    padding:
        6px
        9px;

    border-radius: 7px;

    background:
        rgba(0, 0, 0, 0.70);

    color: white;

    font-size: 10px;
    font-weight: 800;

    letter-spacing: 0.5px;

    backdrop-filter:
        blur(8px);
}


.course-badge.featured {
    background:
        var(--primary);
}


.course-content {
    padding: 20px;
}


.course-category {
    color: var(--primary);

    font-size: 11px;
    font-weight: 800;

    letter-spacing: 0.7px;

    text-transform: uppercase;
}


.course-title {
    margin:
        8px 0;

    min-height: 52px;

    color: white;

    font-size: 19px;

    line-height: 1.35;
}


.course-description {
    display: -webkit-box;

    overflow: hidden;

    margin:
        0 0 18px;

    color: var(--text-secondary);

    font-size: 13px;

    line-height: 1.65;

    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}


.course-meta {
    display: flex;
    flex-wrap: wrap;

    gap: 12px;

    margin-bottom: 18px;

    color: var(--text-muted);

    font-size: 11px;
}


.course-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}


.course-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    padding-top: 16px;

    border-top:
        1px solid var(--border);
}


.course-price {
    display: flex;
    align-items: center;
    gap: 8px;
}


.current-price {
    color: white;

    font-size: 21px;
    font-weight: 800;
}


.original-price {
    color: var(--text-muted);

    font-size: 12px;

    text-decoration: line-through;
}


.view-course-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    padding:
        10px
        14px;

    border-radius: 9px;

    background:
        var(--primary);

    color: white;

    text-decoration: none;

    font-size: 12px;
    font-weight: 800;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}


.view-course-button:hover {
    background:
        var(--primary-hover);

    transform:
        translateY(-1px);
}


.coming-soon-button {
    background:
        rgba(255, 255, 255, 0.07);

    color:
        var(--text-secondary);

    pointer-events: none;
}


/* =========================
   LOADING
========================= */

.loading-state {
    grid-column:
        1 / -1;

    min-height: 280px;

    display: grid;
    place-items: center;

    align-content: center;

    gap: 14px;

    color: var(--text-muted);
}


.loading-spinner {
    width: 36px;
    height: 36px;

    border:
        3px solid
        rgba(255, 255, 255, 0.10);

    border-top-color:
        var(--primary);

    border-radius: 50%;

    animation:
        spin 0.8s linear infinite;
}


@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* =========================
   EMPTY
========================= */

.empty-state {
    padding:
        70px 20px;

    text-align: center;

    color: var(--text-secondary);
}


.empty-icon {
    width: 58px;
    height: 58px;

    margin:
        0 auto 16px;

    display: grid;
    place-items: center;

    border-radius: 15px;

    background:
        rgba(108, 140, 255, 0.10);

    color: var(--primary);

    font-size: 22px;
}


.empty-state h3 {
    margin: 0 0 8px;

    color: white;
}


.empty-state p {
    margin: 0;

    color: var(--text-muted);
}


/* =========================
   FOOTER
========================= */

.courses-footer {
    width: min(
        1200px,
        calc(100% - 40px)
    );

    margin:
        0 auto;

    padding:
        30px 0;

    display: flex;
    justify-content: space-between;

    border-top:
        1px solid var(--border);

    color: var(--text-muted);

    font-size: 12px;
}


.courses-footer p {
    margin: 0;
}


.courses-footer a {
    color: var(--text-secondary);

    text-decoration: none;
}


.courses-footer a:hover {
    color: white;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 950px) {

    .courses-grid {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }

    .course-controls {
        align-items: stretch;

        flex-direction: column;
    }

    .search-box {
        width: 100%;
    }

    .filter-buttons {
        justify-content: flex-start;
    }
}


@media (max-width: 650px) {

    .header-container {
        width:
            calc(100% - 24px);

        min-height: 64px;
    }

    .main-nav {
        display: none;
    }

    .courses-hero {
        padding:
            65px 16px
            50px;
    }

    .courses-hero h1 {
        letter-spacing: -1.5px;
    }

    .courses-hero p {
        font-size: 15px;
    }

    .course-marketplace {
        width:
            calc(100% - 24px);
    }

    .section-heading {
        align-items: flex-start;

        flex-direction: column;
    }

    .courses-grid {
        grid-template-columns:
            1fr;
    }

    .courses-footer {
        width:
            calc(100% - 24px);

        flex-direction: column;

        gap: 10px;
    }
}


@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}