:root {
    --page-bg: #f5f5f5;
    --card-bg: #F5F5F5;
    --text-primary: #1C1C1C;
    --text-secondary: #808080;
    --highlight: #FF2D55;
    --border-color: #EAEAEA;
    --gray-light: #F3F3F3;
    --primary-purple: #8B5CF6;
    --header-bg: #f5f5f5;
    --header-text: #464646;
    --white: #ffffff;
    --course-title: #363636;
    --module-bg: #ededed;
    --module-text: #1e1e1e;
    --btn-dark: #222121;
    --btn-light: #fff;
    --lesson-border: #FAFafa;
    --overview-text: #444;
    --font-main: "Plus Jakarta Sans", sans-serif;
    --sidebar-width: 240px;
    --navbar-height: 70px;
}



* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--page-bg);
    color: var(--text-primary);
    padding-bottom: 90px;
}

.main-container {
    width: 100%;
    max-width: 1200px; /* Slightly wider for desktop */
    margin: 0 auto;
    padding: 0 16px;
}
.header {
    /* position: sticky; */
    top: 0;
    z-index: 100;
    padding-top: 10px;
    display: flex;
    align-items: center;
    /* gap: 90px; */
    /* margin: 18px 0px; */
    background: var(--header-bg);
    color: var(--header-text);
}
/* Header & Mobile Nav */
.mobile-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 0;
}

@media (min-width: 768px) {
    .mobile-nav {
        display: none;
    }
    .content-wrapper {
        margin-left: var(--sidebar-width);
        min-height: 100vh;
    }
}

.nav-actions {
    display: flex;
    gap: 1rem;
}

.nav-icon {
    width: 24px;
    height: 24px;
}

/* Layout for Desktop */
.course-header-container {
    display: flex;
    flex-direction: column;
    /* gap: 2rem; */
}

@media (min-width: 1024px) {
    .course-header-container {
        flex-direction: row;
        align-items: flex-start;
        /* padding: 2rem 0; */
    }

    .course-main-content {
        flex: 1;
        max-width: 750px;
    }

    .course-sidebar {
        width: 400px;
        height: calc(100vh - 120px); 
        overflow-y: auto;
        padding-right: 15px;
        display: flex;
        flex-direction: column;
        gap: 2rem;
        margin-left: 25px;
    }

    /* Hide scrollbar for a cleaner premium look */
    .course-sidebar::-webkit-scrollbar {
        display: none;
    }
    .course-sidebar {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
}

/* Course Image Section */
.course-hero {
    margin-top: 1rem;
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.course-hero-img {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

/* Favorite Button Styles */
.favorite-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--white);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}


/* Unsaved Icon - Default state */
#favoriteIcon {
    width: 20px;
    height: 20px;
    transition: all 0.3s ease;
    opacity: 0.7;
}

/* Saved Icon - When toggled */
#favoriteIcon[data-saved="true"] {
    width: 24px;
    height: 24px;
    opacity: 1;
    filter: none;
}


/* Course Title & Author */
.course-info-section {
    padding: 18px 0 24px 0;
}

.course-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--course-title);
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
    .course-title {
        font-size: 24px;
    }
    .course-hero{
        margin-top: 0;
    }
}

.course-author {
    font-size: 0.9rem;
    color: #464646;
    font-weight: 500;
    margin-bottom: 24px;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    /* margin-bottom: 2rem; */
    border-radius: 1.25rem;
}

@media (min-width: 768px) {
    .info-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.info-label img {
    width: 16px;
    height: 16px;
    opacity: 0.6;
}

.info-value {
    font-size: 0.9rem;
    font-weight: 700;
}

/* About Section */
.about-section {
    margin-bottom: 24px;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}


.about-text {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #464646;
    text-align: justify;    
}


.about-text-truncated {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more-btn {
    background: var(--white);
    border: none;
    color: var(--primary-purple);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 0.75rem;
    padding: 0;
}

/* Curriculum Section */
.curriculum-header {
    margin-bottom: 1.5rem;
}

.curriculum-meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 0.25rem;
}
.vertical-line {
    margin: 0 6px;
    vertical-align: middle;
}


.module-item {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    padding: 1.25rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
}

.module-item.active {
    border-color: var(--primary-purple);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.1);
}

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.module-info-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.module-pill {
    padding: 0.35rem 0.85rem;
    background: var(--module-bg);
    border-radius: 19px;
    font-size: 14px;
    font-weight: 400;
    color: var(--module-text);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.start-btn{
    text-decoration: none;
    margin-top: 18px;
    padding: 12px 33px;
    background: var(--btn-dark);
    border-radius: 15px;
    font-size: 12px;
    font-weight: 700;
    color: var(--btn-light);
    display: flex;
    align-items: center;
    /* gap: 0.4rem; */
}

.upload-btn{
    cursor: pointer;
    margin-top: 18px;
    padding: 12px 33px;
    background: var(--btn-dark);
    border-radius: 15px;
    font-size: 12px;
    font-weight: 700;
    color: var(--btn-light);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* .module-pill.completed {
    background: #E8F5E9;
    color: #2E7D32;
} */

.icon-tick{
    width: 20px;
}

.icon-play-small {
    width: 20px;
}

.arrow-icon {
    width: 24px;
}

.module-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-top: 1rem;
}

.module-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}
.module-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-top: 1rem;
    margin-bottom: 4px;   /* 👈 tighter like image 1 */
}

.module-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;  /* 👈 space before lessons */
}

.module-qs {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.50rem;
}

.module-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
}

.module-item.active .module-content {
    max-height: 1000px;
    /* margin-top: 1.25rem; */
}

.lesson-list {
    list-style: none;
    /* border-top: 1px solid var(--border-color);
    margin-top: 1.25rem; */
}

.lesson-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* padding: 1.15rem 0; */
    padding-top: 19px;
    border-bottom: 1px solid var(--lesson-border);
}

.lesson-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.lesson-name {
    font-size: 0.95rem;
    font-weight: 500;
}

.lesson-duration {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.lesson-play {
    height: 28px;
    width: 28px;
    cursor: pointer;
}

/* Sidebar Styles */
.course-sidebar {
    display: block;
}

.sticky-card {
    display: none;
}

@media (min-width: 1024px) {
    .sticky-card {
        display: block;
    }
    
    .sticky-card {
        background: var(--white);
        border: 1px solid var(--border-color);
        border-radius: 1.5rem;
        padding: 2rem;
        box-shadow: 0 10px 30px rgba(0,0,0,0.04);
    }

    .card-title {
        font-size: 1.25rem;
        font-weight: 700;
        margin-bottom: 1.5rem;
    }

    .overview-list {
        list-style: none;
        margin-bottom: 2rem;
    }

    .overview-list li {
        display: flex;
        align-items: center;
        gap: 1rem;
        font-size: 0.95rem;
        color: var(--overview-text);
        margin-bottom: 1.25rem;
    }

    .overview-list li img {
        width: 20px;
        opacity: 0.7;
    }

    .enroll-btn {
        width: 100%;
        background: var(--text-primary);
        color: var(--white);
        border: none;
        padding: 1rem;
        border-radius: 1rem;
        font-weight: 700;
        cursor: pointer;
        transition: transform 0.2s, background 0.2s;
    }

    .enroll-btn:hover {
        background: var(--text-primary);
        transform: translateY(-2px);
    }
}



