/**
 * Course Details Page - Professional E-learning (Udemy/Coursera style)
 * Blue/Purple education theme, responsive, animations, production-ready
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@400;500;600;700&display=swap');

/* ========== Font & variables ========== */
.course-page {
    font-family: 'Poppins', 'Inter', 'Plus Jakarta Sans', sans-serif;
    scroll-behavior: smooth;
}

/* Defaults; .course-page overrides via inline theme block (site primary/secondary) */
:root {
    --course-primary: #28c76f;
    --course-secondary: #64748b;
    --course-primary-dark: #1fa75d;
    --course-accent: #34d399;
    --course-hero-start: #14532d;
    --course-hero-mid: #28c76f;
    --course-hero-end: #64748b;
    --course-enroll-start: #28c76f;
    --course-enroll-end: #475569;
    --course-radius: 12px;
    --course-radius-lg: 16px;
    --course-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
    --course-shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
    --course-transition: 0.25s ease;
}

/*
 * Site admin colors on .course-page (see course_details.php inline #course-theme-vars).
 * style.css sets .btn-primary { background: linear-gradient(...) } — must override with full background.
 */
.course-page .btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--course-primary);
    --bs-btn-border-color: var(--course-primary);
    --bs-btn-hover-bg: var(--course-primary-dark);
    --bs-btn-hover-border-color: var(--course-primary-dark);
    --bs-btn-active-bg: var(--course-primary-dark);
    --bs-btn-active-border-color: var(--course-primary-dark);
    --bs-btn-disabled-bg: var(--course-primary);
    --bs-btn-disabled-border-color: var(--course-primary);
    background: linear-gradient(135deg, var(--course-primary) 0%, var(--course-primary-dark) 100%) !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22) !important;
}

.course-page .btn-primary:hover,
.course-page .btn-primary:focus,
.course-page .btn-primary:active {
    color: #fff !important;
    filter: brightness(1.05);
}

.course-page .text-primary {
    color: var(--course-primary) !important;
}

/* ========== Breadcrumb ========== */
.course-breadcrumb {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.course-breadcrumb .breadcrumb-item a {
    color: var(--course-primary);
}

.course-breadcrumb .breadcrumb-item.active {
    color: #64748b;
}

/* ========== Course Hero ========== */
.course-hero {
    position: relative;
    padding: 2.5rem 0 3rem;
    color: #fff;
    overflow: hidden;
}

.course-hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--course-hero-start) 0%, var(--course-hero-mid) 45%, var(--course-hero-end) 100%);
    z-index: 0;
}

.course-hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.8;
}

.course-hero .container {
    position: relative;
    z-index: 1;
}

.course-badge-category {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    margin-bottom: 0.75rem;
    display: inline-block;
}

.course-hero-title {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.course-hero-desc {
    font-size: 1rem;
    opacity: 0.95;
    max-width: 600px;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.course-hero-meta {
    font-size: 0.9rem;
}

/* Instructor in hero: avatar + name */
.course-hero-instructor {
    font-size: 0.95rem;
}

.course-hero-instructor-avatar {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

.course-hero-instructor-avatar-placeholder {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 1.25rem;
}

.course-rating-stars {
    letter-spacing: 0.05em;
}

.course-page .course-hero-actions .btn-enroll {
    background: linear-gradient(135deg, var(--course-enroll-start) 0%, var(--course-enroll-end) 100%) !important;
    color: #fff !important;
    border: none !important;
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    border-radius: var(--course-radius);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
    transition: transform var(--course-transition), box-shadow var(--course-transition);
}

.course-page .course-hero-actions .btn-enroll:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45) !important;
    color: #fff !important;
    filter: brightness(1.05);
}

.course-hero-actions .btn-wishlist {
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

.course-hero-actions .btn-wishlist:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-color: #fff;
}

/* ========== Preview card (right side + sticky) ========== */
.course-preview-card {
    transition: box-shadow var(--course-transition), transform var(--course-transition);
}

.course-preview-card:hover {
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.2) !important;
}

.course-preview-thumb {
    position: relative;
    height: 220px;
    background: linear-gradient(135deg, var(--course-primary) 0%, var(--course-accent) 100%);
    overflow: hidden;
}

.course-preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-preview-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 4rem;
    transition: background var(--course-transition);
}

.course-preview-play:hover {
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
}

.course-discount-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #ef4444;
    color: #fff;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

.course-includes li {
    margin-bottom: 0.5rem;
    color: #475569;
}

.course-includes li i {
    width: 1.25rem;
    color: var(--course-primary);
}

/* Sticky enroll card: stays in view when scrolling past hero */
.sticky-enroll-card {
    position: relative;
    transition: box-shadow var(--course-transition), transform var(--course-transition);
}

.sticky-enroll-card.sticky-visible {
    position: sticky;
    top: 90px;
    z-index: 10;
}

/* Content fade-in when page is ready */
.course-hero .container,
.course-tabs-section,
.related-courses {
    animation: courseFadeIn 0.4s ease-out;
}

@keyframes courseFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 991.98px) {
    .course-preview-card {
        margin-top: 1rem;
    }
    .course-preview-thumb {
        height: 200px;
    }
}

/* ========== Tabs ========== */
.course-page .course-tabs {
    border-bottom: 1px solid #e2e8f0 !important;
    gap: 0.25rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem !important;
}

.course-page .course-tabs .nav-link {
    color: #64748b !important;
    font-weight: 600 !important;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    padding: 0.85rem 1.15rem !important;
    border: none !important;
    background: transparent !important;
    border-radius: 0 !important;
    position: relative;
    transition: color var(--course-transition);
}

.course-page .course-tabs .nav-link::after {
    content: '';
    position: absolute;
    left: 0.75rem;
    right: 0.75rem;
    bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background: transparent;
    transition: background var(--course-transition);
}

.course-page .course-tabs .nav-link:hover {
    color: var(--course-primary-dark) !important;
    background: transparent !important;
}

.course-page .course-tabs .nav-link.active {
    background: transparent !important;
    color: var(--course-primary-dark) !important;
    box-shadow: none !important;
}

.course-page .course-tabs .nav-link.active::after {
    background: var(--course-primary);
}

.course-page .course-tab-card {
    background: #fff;
    border-radius: var(--course-radius-lg);
}

/* ========== About / Description panel ========== */
.course-page .course-about-card {
    padding: 1.75rem 1.5rem 2rem !important;
    overflow: hidden;
    border: 1px solid #e8eef5 !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05) !important;
}

@media (min-width: 768px) {
    .course-page .course-about-card {
        padding: 2.35rem 2.6rem 2.6rem !important;
    }
}

.course-page .course-about-header {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eef2f7;
}

.course-page .course-about-kicker {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--course-primary-dark) !important;
    margin-bottom: 0.45rem;
}

.course-page .course-about-title {
    margin: 0 !important;
    font-size: clamp(1.4rem, 2.2vw, 1.75rem) !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.course-page .course-description {
    color: #475569 !important;
    font-size: 1.02rem;
    line-height: 1.8 !important;
    max-width: 72ch;
}

.course-page .course-learn-block,
.course-page .course-req-block {
    display: block !important;
    margin-top: 1.75rem !important;
    padding: 1.4rem 1.3rem !important;
    border-radius: 16px !important;
    border: 1px solid #e2e8f0 !important;
}

.course-page .course-learn-block {
    background: #f3fbf7 !important;
    border-color: rgba(40, 199, 111, 0.22) !important;
}

.course-page .course-req-block {
    background: #f8fafc !important;
}

.course-page .course-block-head {
    display: flex !important;
    align-items: flex-start !important;
    gap: 0.9rem !important;
    margin-bottom: 1.2rem !important;
}

.course-page .course-block-icon {
    flex-shrink: 0 !important;
    width: 2.55rem !important;
    height: 2.55rem !important;
    border-radius: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #28c76f !important;
    color: #fff !important;
    font-size: 1.2rem !important;
}

.course-page .course-block-icon--muted {
    background: #64748b !important;
    color: #fff !important;
}

.course-page .course-block-title {
    margin: 0 !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    letter-spacing: -0.01em;
}

.course-page .course-block-sub {
    margin: 0.25rem 0 0 !important;
    font-size: 0.86rem !important;
    color: #64748b !important;
    line-height: 1.4;
}

.course-page .course-learn-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0.8rem 1.25rem !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

@media (min-width: 768px) {
    .course-page .course-learn-grid {
        grid-template-columns: 1fr 1fr !important;
    }
}

.course-page .course-learn-item {
    display: flex !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
    padding: 0.85rem 0.9rem !important;
    border-radius: 12px !important;
    background: #fff !important;
    border: 1px solid #dbe7df !important;
    color: #1e293b !important;
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    line-height: 1.45;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.course-page .course-learn-item:hover {
    border-color: #28c76f !important;
    box-shadow: 0 6px 16px rgba(40, 199, 111, 0.12);
}

.course-page .course-learn-check {
    flex-shrink: 0 !important;
    width: 1.55rem !important;
    height: 1.55rem !important;
    margin-top: 0.05rem;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #28c76f !important;
    color: #fff !important;
    font-size: 0.85rem !important;
}

.course-page .course-req-list {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0.65rem !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

@media (min-width: 768px) {
    .course-page .course-req-list {
        grid-template-columns: 1fr 1fr !important;
    }
}

.course-page .course-req-item {
    display: flex !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
    padding: 0.7rem 0.85rem !important;
    border-radius: 10px !important;
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    color: #334155 !important;
    font-size: 0.95rem !important;
    line-height: 1.45;
}

.course-page .course-req-dot {
    flex-shrink: 0 !important;
    width: 0.55rem !important;
    height: 0.55rem !important;
    margin-top: 0.45rem;
    border-radius: 50% !important;
    background: #28c76f !important;
    box-shadow: 0 0 0 4px rgba(40, 199, 111, 0.16);
}

/* ========== Accordion curriculum ========== */
.course-page .course-curriculum-card {
    padding: 0 !important;
    overflow: hidden;
    border: 1px solid #e8eef5 !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05) !important;
}

.course-page .course-curriculum-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.6rem 1.5rem 1.35rem;
    border-bottom: 1px solid #eef2f7;
    background: linear-gradient(180deg, #f8fffb 0%, #fff 100%);
}

@media (min-width: 768px) {
    .course-page .course-curriculum-header {
        padding: 1.85rem 2rem 1.5rem;
    }
}

.course-page .course-curriculum-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.course-page .course-curriculum-stat {
    min-width: 4.75rem;
    padding: 0.55rem 0.85rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.course-page .course-curriculum-stat strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.course-page .course-curriculum-stat span {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
}

.course-page .course-accordion .accordion-item.course-curriculum-module {
    border: none !important;
    border-bottom: 1px solid #eef2f7 !important;
    background: transparent;
}

.course-page .course-accordion .accordion-item.course-curriculum-module:last-child {
    border-bottom: none !important;
}

.course-page .course-curriculum-toggle.accordion-button {
    display: flex !important;
    align-items: center !important;
    gap: 0.9rem !important;
    padding: 1.05rem 1.35rem !important;
    font-size: 1rem !important;
    background: #fff !important;
    color: #0f172a !important;
    box-shadow: none !important;
    border: none !important;
}

.course-page .course-curriculum-toggle.accordion-button:not(.collapsed) {
    background: #f3fbf7 !important;
    color: #14532d !important;
}

.course-page .course-curriculum-toggle.accordion-button:focus {
    box-shadow: none !important;
    border-color: transparent !important;
}

.course-page .course-curriculum-toggle.accordion-button::after {
    margin-left: auto;
    background-size: 1rem;
    opacity: 0.55;
}

.course-page .course-module-index {
    flex-shrink: 0;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #28c76f;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.course-page .course-curriculum-toggle.collapsed .course-module-index {
    background: #e2e8f0;
    color: #475569;
}

.course-page .course-module-meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    text-align: left;
}

.course-page .course-module-title {
    font-weight: 700;
    font-size: 0.98rem;
    line-height: 1.35;
    color: inherit;
}

.course-page .course-module-count {
    font-size: 0.82rem;
    font-weight: 500;
    color: #64748b;
}

.course-page .course-lesson-list {
    background: #fff;
}

.course-page .course-lesson-row {
    border-top: 1px solid #f1f5f9;
}

.course-page .course-lesson-row.is-preview {
    background: #f8fffb;
}

.course-page .course-lesson-link {
    display: flex !important;
    align-items: center !important;
    gap: 0.85rem !important;
    padding: 0.95rem 1.35rem 0.95rem 1.55rem !important;
    text-decoration: none !important;
    color: #1e293b !important;
    transition: background 0.2s ease;
}

.course-page .course-lesson-link:hover {
    background: #f8fafc;
}

.course-page .course-lesson-link.is-locked {
    cursor: default;
    color: #64748b !important;
}

.course-page .course-lesson-icon {
    flex-shrink: 0;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.course-page .course-lesson-icon--play,
.course-page .course-lesson-icon--preview {
    background: #28c76f;
    color: #fff;
}

.course-page .course-lesson-icon--lock {
    background: #e2e8f0;
    color: #64748b;
}

.course-page .course-lesson-body {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
    flex-wrap: wrap;
}

.course-page .course-lesson-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    color: inherit;
}

.course-page .course-lesson-badges,
.course-page .course-lesson-duration {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.course-page .course-lesson-duration {
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

.course-page .course-preview-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    background: #28c76f;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.course-page .course-curriculum-empty {
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: #64748b;
}

.course-page .course-curriculum-empty i {
    font-size: 2rem;
    color: #94a3b8;
    display: block;
    margin-bottom: 0.65rem;
}

.course-page .course-accordion .accordion-collapse {
    transition: height 0.35s ease;
}

.course-page .course-accordion .accordion-body {
    background: #fff;
}

/* ========== Instructor tab ========== */
.course-page .course-instructor-card {
    padding: 0 !important;
    overflow: hidden;
    border: 1px solid #e8eef5 !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05) !important;
}

.course-page .course-instructor-hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.6rem 1.4rem 1.5rem;
    background: linear-gradient(165deg, #f3fbf7 0%, #fff 55%);
    border-bottom: 1px solid #eef2f7;
}

@media (min-width: 768px) {
    .course-page .course-instructor-hero {
        grid-template-columns: 168px 1fr;
        gap: 1.75rem;
        padding: 2rem 2rem 1.75rem;
        align-items: start;
    }
}

.course-page .course-instructor-avatar-wrap {
    display: flex;
    justify-content: center;
}

@media (min-width: 768px) {
    .course-page .course-instructor-avatar-wrap {
        justify-content: flex-start;
    }
}

.course-page .course-instructor-avatar {
    width: 148px;
    height: 148px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 10px 28px rgba(40, 199, 111, 0.22);
}

.course-page .course-instructor-avatar--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e8f8ef;
    color: #28c76f;
    font-size: 3.5rem;
}

.course-page .course-instructor-intro {
    min-width: 0;
}

.course-page .course-instructor-role {
    margin: 0.2rem 0 0.85rem;
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 500;
}

.course-page .course-instructor-bio {
    margin: 0 0 1.25rem;
    color: #475569;
    font-size: 1rem;
    line-height: 1.7;
    max-width: 68ch;
}

.course-page .course-instructor-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.1rem;
}

.course-page .course-instructor-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 9.5rem;
    padding: 0.7rem 0.9rem;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
}

.course-page .course-instructor-stat-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #28c76f;
    color: #fff;
    font-size: 1rem;
}

.course-page .course-instructor-stat strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.15;
}

.course-page .course-instructor-stat span {
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    text-transform: capitalize;
}

.course-page .course-instructor-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.course-page .course-instructor-profile-btn {
    border-radius: 999px !important;
    font-weight: 600;
    padding: 0.4rem 0.95rem !important;
}

.course-page .course-instructor-social {
    display: inline-flex;
    gap: 0.45rem;
}

.course-page .course-instructor-social a {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    color: #475569;
    background: #fff;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.course-page .course-instructor-social a:hover {
    background: #28c76f;
    border-color: #28c76f;
    color: #fff;
}

.course-page .course-instructor-courses {
    padding: 1.4rem 1.4rem 1.7rem;
}

@media (min-width: 768px) {
    .course-page .course-instructor-courses {
        padding: 1.5rem 2rem 2rem;
    }
}

.course-page .course-instructor-courses-head {
    margin-bottom: 1rem;
}

.course-page .course-instructor-link-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.course-page .course-instructor-text-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0;
    color: #1fa75d !important;
    font-size: 0.98rem;
    font-weight: 600;
    text-decoration: none !important;
    line-height: 1.4;
    transition: color 0.2s ease, transform 0.2s ease;
}

.course-page .course-instructor-text-link i {
    font-size: 1.25rem;
    line-height: 1;
    opacity: 0.85;
}

.course-page .course-instructor-text-link:hover {
    color: #14532d !important;
    text-decoration: underline !important;
}

.course-page .course-instructor-text-link:hover i {
    transform: translateX(2px);
}

.course-page .course-instructor-empty {
    color: #64748b;
    font-size: 0.95rem;
}

/* Legacy instructor photo helpers (hero / other) */
.instructor-photo {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border: 3px solid rgba(40, 199, 111, 0.15);
}

.instructor-photo-placeholder {
    width: 140px;
    height: 140px;
}

/* ========== Reviews tab ========== */
.course-page .course-reviews-card {
    padding: 0 !important;
    overflow: hidden;
    border: 1px solid #e8eef5 !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05) !important;
}

.course-page .course-reviews-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.6rem 1.4rem 1.35rem;
    border-bottom: 1px solid #eef2f7;
    background: linear-gradient(180deg, #fffaf0 0%, #fff 100%);
}

@media (min-width: 768px) {
    .course-page .course-reviews-header {
        padding: 1.85rem 2rem 1.5rem;
    }
}

.course-page .course-review-write-btn {
    border-radius: 999px !important;
    font-weight: 600;
    padding: 0.45rem 1rem !important;
}

.course-page .course-reviews-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

@media (min-width: 992px) {
    .course-page .course-reviews-body {
        grid-template-columns: 280px 1fr;
    }
}

.course-page .course-reviews-summary {
    padding: 1.4rem 1.4rem 1.6rem;
    background: #fafbfc;
    border-bottom: 1px solid #eef2f7;
}

@media (min-width: 992px) {
    .course-page .course-reviews-summary {
        border-bottom: none;
        border-right: 1px solid #eef2f7;
        padding: 1.6rem 1.5rem 1.8rem;
    }
}

.course-page .course-reviews-score {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1.25rem;
}

.course-page .course-reviews-score-num {
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
    color: #0f172a;
    min-width: 3.2rem;
}

.course-page .course-reviews-score-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.course-page .course-rating-stars {
    display: inline-flex;
    gap: 0.12rem;
    color: #f59e0b;
    font-size: 1rem;
    line-height: 1;
}

.course-page .course-rating-stars .bi-star {
    color: #cbd5e1;
}

.course-page .course-rating-stars--sm {
    font-size: 0.82rem;
    margin-top: 0.15rem;
}

.course-page .course-reviews-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
}

.course-page .course-rating-bars {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.course-page .course-rating-bar-row {
    display: grid;
    grid-template-columns: 3.4rem 1fr 1.4rem;
    align-items: center;
    gap: 0.55rem;
}

.course-page .course-rating-bar-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
}

.course-page .course-rating-bar-track {
    height: 8px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.course-page .course-rating-bar-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    min-width: 0;
}

.course-page .course-rating-bar-count {
    font-size: 0.78rem;
    font-weight: 600;
    color: #94a3b8;
    text-align: right;
}

.course-page .course-reviews-list-wrap {
    padding: 1.25rem 1.4rem 1.6rem;
    min-height: 220px;
}

@media (min-width: 768px) {
    .course-page .course-reviews-list-wrap {
        padding: 1.4rem 2rem 1.8rem;
    }
}

.course-page .course-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.course-page .course-review-item {
    padding: 1rem 1.05rem;
    border-radius: 14px;
    border: 1px solid #e8eef5;
    background: #fff;
}

.course-page .course-review-item-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.course-page .course-review-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.course-page .course-review-avatar--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e8f8ef;
    color: #28c76f;
    font-size: 1.2rem;
}

.course-page .course-review-identity {
    min-width: 0;
    flex: 1;
}

.course-page .course-review-identity strong {
    display: block;
    font-size: 0.95rem;
    color: #0f172a;
    line-height: 1.3;
}

.course-page .course-review-date {
    font-size: 0.78rem;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
}

.course-page .course-review-text {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.6;
    color: #475569;
}

.course-page .course-review-text--muted {
    color: #94a3b8;
    font-style: italic;
}

.course-page .course-reviews-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 220px;
    padding: 1.5rem 1rem;
    border-radius: 16px;
    border: 1px dashed #dbe4ee;
    background: #f8fafc;
}

.course-page .course-reviews-empty-icon {
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff7ed;
    color: #f59e0b;
    font-size: 1.45rem;
    margin-bottom: 0.85rem;
}

.course-page .course-reviews-empty h4 {
    margin: 0 0 0.35rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
}

.course-page .course-reviews-empty p {
    margin: 0 0 1rem;
    color: #64748b;
    font-size: 0.92rem;
    max-width: 28ch;
}

.course-page .course-reviews-empty-link {
    color: #1fa75d !important;
    font-weight: 700;
    text-decoration: none !important;
}

.course-page .course-reviews-empty-link:hover {
    text-decoration: underline !important;
    color: #14532d !important;
}

.rating-bars .progress {
    border-radius: 999px;
}

.review-card:last-child {
    border-bottom: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Write review modal - star buttons */
.star-btn {
    transition: color var(--course-transition), transform var(--course-transition);
}

.star-btn:hover,
.star-btn.active {
    color: #f59e0b !important;
    border-color: #f59e0b !important;
}

.star-btn.active i {
    color: #f59e0b;
}

/* ========== Related courses ========== */
.related-courses .section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1c1917;
}

.related-courses .course-card {
    transition: transform var(--course-transition), box-shadow var(--course-transition);
}

.related-courses .course-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--course-shadow-lg) !important;
}

.related-courses .course-card-image {
    overflow: hidden;
}

.related-courses .course-card-image img {
    transition: transform 0.4s ease;
}

.related-courses .course-card:hover .course-card-image img {
    transform: scale(1.05);
}

.related-courses .course-card-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 1rem;
    font-weight: 600;
}

/* ========== Loading state (optional) ========== */
.course-hero.loading .course-hero-title,
.course-hero.loading .course-hero-desc {
    opacity: 0.7;
}

/* ========== Dark theme support ========== */
[data-bs-theme="dark"] .course-breadcrumb {
    background: #14532d;
    border-color: #334155;
}

[data-bs-theme="dark"] .course-breadcrumb .breadcrumb-item.active {
    color: #94a3b8;
}

[data-bs-theme="dark"] .course-tab-card,
[data-bs-theme="dark"] .course-accordion .accordion-body {
    background: #14532d;
    color: #e2e8f0;
}

[data-bs-theme="dark"] .course-page .course-tabs {
    border-bottom-color: #334155 !important;
}

[data-bs-theme="dark"] .course-page .course-tabs .nav-link {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .course-page .course-tabs .nav-link.active {
    background: transparent !important;
    color: #6ee7b7 !important;
}

[data-bs-theme="dark"] .course-page .course-tabs .nav-link.active::after {
    background: #34d399;
}

[data-bs-theme="dark"] .course-page .course-about-title,
[data-bs-theme="dark"] .course-page .course-block-title {
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .course-page .course-description,
[data-bs-theme="dark"] .course-page .course-block-sub,
[data-bs-theme="dark"] .course-page .course-req-item {
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .course-page .course-about-card,
[data-bs-theme="dark"] .course-page .course-learn-item,
[data-bs-theme="dark"] .course-page .course-req-item {
    background: #0f172a !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .course-page .course-learn-block {
    background: rgba(52, 211, 153, 0.08) !important;
    border-color: rgba(52, 211, 153, 0.25) !important;
}

[data-bs-theme="dark"] .course-page .course-req-block {
    background: #0f172a !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .course-page .course-about-header {
    border-bottom-color: #334155;
}

[data-bs-theme="dark"] .course-page .course-block-icon {
    background: #28c76f !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .course-page .course-block-icon--muted {
    background: #475569 !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .course-page .course-curriculum-header {
    background: #0f172a;
    border-bottom-color: #334155;
}

[data-bs-theme="dark"] .course-page .course-curriculum-stat {
    background: #14532d;
    border-color: #334155;
}

[data-bs-theme="dark"] .course-page .course-curriculum-stat strong {
    color: #f1f5f9;
}

[data-bs-theme="dark"] .course-page .course-curriculum-toggle.accordion-button {
    background: #0f172a !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .course-page .course-curriculum-toggle.accordion-button:not(.collapsed) {
    background: rgba(52, 211, 153, 0.1) !important;
    color: #6ee7b7 !important;
}

[data-bs-theme="dark"] .course-page .course-curriculum-toggle.collapsed .course-module-index {
    background: #334155;
    color: #cbd5e1;
}

[data-bs-theme="dark"] .course-page .course-module-count,
[data-bs-theme="dark"] .course-page .course-lesson-duration {
    color: #94a3b8;
}

[data-bs-theme="dark"] .course-page .course-lesson-list,
[data-bs-theme="dark"] .course-page .course-lesson-link:hover {
    background: #0f172a;
}

[data-bs-theme="dark"] .course-page .course-lesson-row {
    border-top-color: #1e293b;
}

[data-bs-theme="dark"] .course-page .course-lesson-row.is-preview {
    background: rgba(52, 211, 153, 0.06);
}

[data-bs-theme="dark"] .course-page .course-lesson-link {
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .course-page .course-lesson-icon--lock {
    background: #334155;
    color: #94a3b8;
}

[data-bs-theme="dark"] .course-page .course-accordion .accordion-item.course-curriculum-module {
    border-bottom-color: #1e293b !important;
}

[data-bs-theme="dark"] .course-page .course-instructor-hero {
    background: #0f172a;
    border-bottom-color: #334155;
}

[data-bs-theme="dark"] .course-page .course-instructor-role,
[data-bs-theme="dark"] .course-page .course-instructor-bio,
[data-bs-theme="dark"] .course-page .course-instructor-empty {
    color: #cbd5e1;
}

[data-bs-theme="dark"] .course-page .course-instructor-stat,
[data-bs-theme="dark"] .course-page .course-instructor-social a {
    background: #14532d;
    border-color: #334155;
}

[data-bs-theme="dark"] .course-page .course-instructor-stat strong {
    color: #f1f5f9;
}

[data-bs-theme="dark"] .course-page .course-instructor-text-link {
    color: #6ee7b7 !important;
}

[data-bs-theme="dark"] .course-page .course-instructor-text-link:hover {
    color: #a7f3d0 !important;
}

[data-bs-theme="dark"] .course-page .course-reviews-header {
    background: #0f172a;
    border-bottom-color: #334155;
}

[data-bs-theme="dark"] .course-page .course-reviews-summary {
    background: #0f172a;
    border-color: #334155;
}

[data-bs-theme="dark"] .course-page .course-reviews-score-num,
[data-bs-theme="dark"] .course-page .course-review-identity strong,
[data-bs-theme="dark"] .course-page .course-reviews-empty h4 {
    color: #f1f5f9;
}

[data-bs-theme="dark"] .course-page .course-review-item {
    background: #14532d;
    border-color: #334155;
}

[data-bs-theme="dark"] .course-page .course-reviews-empty {
    background: #0f172a;
    border-color: #334155;
}

[data-bs-theme="dark"] .course-page .course-review-text,
[data-bs-theme="dark"] .course-page .course-reviews-empty p {
    color: #cbd5e1;
}

[data-bs-theme="dark"] .course-page .course-rating-bar-track {
    background: #334155;
}

[data-bs-theme="dark"] .course-page .course-rating-stars .bi-star {
    color: #475569;
}

[data-bs-theme="dark"] .course-page .course-reviews-empty-link {
    color: #6ee7b7 !important;
}

[data-bs-theme="dark"] .course-page .course-instructor-social a {
    color: #cbd5e1;
}

[data-bs-theme="dark"] .course-page .course-instructor-social a:hover {
    background: #28c76f;
    border-color: #28c76f;
    color: #fff;
}

[data-bs-theme="dark"] .related-courses {
    background: #052e16 !important;
}

[data-bs-theme="dark"] .related-courses .section-title {
    color: #f1f5f9;
}

[data-bs-theme="dark"] .related-courses .card {
    background: #14532d;
}

[data-bs-theme="dark"] .related-courses .course-card-title {
    color: #e2e8f0;
}

/* ========== Responsive ========== */
@media (max-width: 767.98px) {
    .course-hero {
        padding: 1.5rem 0 2rem;
    }
    .course-hero-title {
        font-size: 1.5rem;
    }
    .course-hero-desc {
        font-size: 0.95rem;
    }
    .course-hero-meta {
        flex-direction: column;
        align-items: flex-start;
    }
    .course-hero-instructor-avatar,
    .course-hero-instructor-avatar-placeholder {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    .course-page .course-tabs .nav-link {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.9rem;
    }
    .instructor-photo,
    .instructor-photo-placeholder {
        width: 100px;
        height: 100px;
    }
}
