/* =========================================
   SINGLE COURSE PAGE STYLES (LEARNDASH)
========================================= */

/* Hero Section */
.course-hero {
    background-color: var(--text-heading, #0F172A);
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
    color: var(--white, #ffffff);
    padding: 120px 0 80px;
    position: relative;
    overflow: hidden;
}

.course-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(15, 76, 129, 0.8) 100%);
    z-index: 1;
}

.course-hero::before {
    display: none; /* Removing previous radial gradient */
}

.relative-z {
    position: relative;
    z-index: 2;
}

.course-hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.breadcrumbs {
    font-size: 14px;
    color: #94A3B8;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumbs a {
    color: var(--accent-cta, #14B8A6);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumbs a:hover {
    color: #fff;
}

.breadcrumbs i {
    font-size: 10px;
}

.course-hero h1 {
    font-size: 42px;
    font-weight: 900;
    line-height: 1.3;
    margin-bottom: 20px;
    color: #fff;
}

.course-subtitle {
    font-size: 18px;
    line-height: 1.7;
    color: #CBD5E1;
    margin-bottom: 30px;
}

.course-hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 25px;
    font-size: 15px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.meta-item i {
    color: #CBD5E1;
}

.meta-item .text-warning {
    color: #F59E0B;
}

.inst-img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Layout Grid */
.course-layout-section {
    padding: 60px 0;
    background-color: #F8FAFC;
}

.course-layout-grid {
    display: grid;
    grid-template-columns: 2.2fr 1fr; /* Main Content 70%, Sidebar 30% */
    gap: 40px;
    align-items: start;
}

/* Tabs */
.course-tabs {
    display: flex;
    border-bottom: 1px solid #E2E8F0;
    margin-bottom: 40px;
    overflow-x: auto;
}

.tab-btn {
    background: none;
    border: none;
    padding: 15px 25px;
    font-size: 18px;
    font-weight: 700;
    color: #64748B;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.tab-btn:hover {
    color: var(--main-color, #0F4C81);
}

.tab-btn.active {
    color: var(--main-color, #0F4C81);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--main-color, #0F4C81);
    border-radius: 3px 3px 0 0;
}

.course-section {
    display: none;
    animation: fadeIn 0.5s ease;
}

.course-section.active {
    display: block;
}

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

/* What You'll Learn */
.what-you-learn {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 40px;
}

.what-you-learn h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

.learn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.learn-grid ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.learn-grid li {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 15px;
    line-height: 1.6;
    color: #334155;
}

.learn-grid li i {
    color: #10B981;
    margin-top: 5px;
}

/* Description */
.course-description h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

.course-description p {
    font-size: 16px;
    line-height: 1.8;
    color: #475569;
    margin-bottom: 15px;
}

/* Curriculum (LearnDash 3.0 Native Override) */
.curriculum-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    color: #64748B;
    font-size: 15px;
    font-weight: 600;
}

.curriculum-meta i {
    color: var(--main-color, #0F4C81);
}

/* Main Wrapper */
.course-section .learndash-wrapper .ld-item-list {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

/* Global Heading (Course Content & Expand) */
.course-section .learndash-wrapper .ld-section-heading {
    padding: 20px 25px;
    background: #fff;
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.course-section .learndash-wrapper .ld-section-heading h2 {
    font-size: 20px;
    font-weight: 800;
    margin: 0;
    color: var(--text-heading, #0F172A);
}

/* Sections (LearnDash Sections) */
.course-section .learndash-wrapper .ld-item-list-section-heading {
    background: #F8FAFC;
    padding: 15px 25px;
    border-bottom: 1px solid #E2E8F0;
    border-top: 1px solid #E2E8F0;
    margin-top: -1px;
}

.course-section .learndash-wrapper .ld-lesson-section-heading {
    font-size: 18px;
    font-weight: 800;
    color: var(--main-color, #0F4C81);
    margin: 0;
}

/* Lesson Items */
.course-section .learndash-wrapper .ld-item-list-item {
    border-bottom: 1px solid #E2E8F0;
    margin: 0;
    background: #fff;
}

.course-section .learndash-wrapper .ld-item-list-item:last-child {
    border-bottom: none;
}

/* Lesson Preview (The Row) */
.course-section .learndash-wrapper .ld-item-list-item-preview {
    padding: 15px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.3s ease;
}

.course-section .learndash-wrapper .ld-item-list-item-preview:hover {
    background: #F1F5F9;
}

/* Lesson Title Link */
.course-section .learndash-wrapper .ld-item-name {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: var(--text-heading, #0F172A);
}

.course-section .learndash-wrapper .ld-item-title {
    font-size: 16px;
    font-weight: 700;
    color: #334155;
    transition: color 0.2s ease;
}

.course-section .learndash-wrapper .ld-item-name:hover .ld-item-title {
    color: var(--main-color, #0F4C81);
}

/* Status Icon (Checkbox / Circle) */
.course-section .learndash-wrapper .ld-status-icon {
    width: 22px;
    height: 22px;
    border: 2px solid #CBD5E1;
    border-radius: 50%;
    position: relative;
}

.course-section .learndash-wrapper .ld-status-complete {
    background-color: var(--accent-cta, #14B8A6);
    border-color: var(--accent-cta, #14B8A6);
}

.course-section .learndash-wrapper .ld-status-complete::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #fff;
    font-size: 10px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Expand Button */
.course-section .learndash-wrapper .ld-expand-button {
    background: rgba(15, 76, 129, 0.1) !important;
    color: var(--main-color, #0F4C81) !important;
    border: none;
    padding: 5px 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.course-section .learndash-wrapper .ld-expand-button:hover {
    background: var(--main-color, #0F4C81) !important;
    color: #fff !important;
}

.course-section .learndash-wrapper .ld-expand-button .ld-icon {
    transition: transform 0.3s ease;
}

.course-section .learndash-wrapper .ld-expand-button[aria-expanded="true"] .ld-icon {
    transform: rotate(180deg);
}

/* Sub-items (Topics List) */
.course-section .learndash-wrapper .ld-item-list-item-expanded {
    background: #F8FAFC;
    border-top: 1px dashed #E2E8F0;
    padding: 0;
}

.course-section .learndash-wrapper .ld-table-list-header {
    display: none; /* Hide the redundant inner table header */
}

.course-section .learndash-wrapper .ld-table-list-item {
    border-bottom: 1px solid #E2E8F0;
}

.course-section .learndash-wrapper .ld-table-list-item:last-child {
    border-bottom: none;
}

.course-section .learndash-wrapper .ld-table-list-item-preview {
    padding: 12px 25px 12px 50px; /* Indent for topics */
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: #475569;
    font-size: 15px;
    transition: all 0.2s ease;
}

.course-section .learndash-wrapper .ld-table-list-item-preview:hover {
    background: #fff;
    color: var(--main-color, #0F4C81);
    padding-right: 20px; /* Slight hover indent effect for RTL */
}

.course-section .learndash-wrapper .ld-topic-title {
    font-weight: 600;
}

/* Sidebar */
.course-sidebar-wrapper {
    position: relative;
    /* We pull the sidebar up so it overlaps the hero section beautifully */
    margin-top: -120px; 
    z-index: 10;
}

.sticky-sidebar {
    position: sticky;
    top: 100px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid #E2E8F0;
    overflow: hidden;
}

.sidebar-video-preview {
    position: relative;
    height: 200px;
    cursor: pointer;
}

.sidebar-video-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-video-preview::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    transition: background 0.3s ease;
}

.sidebar-video-preview:hover::after {
    background: rgba(15, 23, 42, 0.5);
}

.play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: #fff;
    border: none;
    border-radius: 50%;
    color: var(--main-color, #0F4C81);
    font-size: 20px;
    z-index: 2;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

.sidebar-video-preview:hover .play-btn {
    transform: translate(-50%, -50%) scale(1.1);
}

.preview-text {
    position: absolute;
    bottom: 15px;
    left: 0;
    width: 100%;
    text-align: center;
    color: #fff;
    font-weight: 700;
    z-index: 2;
}

.sidebar-purchase {
    padding: 30px;
    border-bottom: 1px solid #E2E8F0;
}

.price-box {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.price-box .current-price {
    font-size: 32px;
    font-weight: 900;
    color: var(--text-heading, #0F172A);
}

.price-box .old-price {
    font-size: 18px;
    color: #94A3B8;
    text-decoration: line-through;
}

.discount-badge {
    background: #FEE2E2;
    color: #E11D48;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 800;
}

.enroll-btn-large {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 15px;
    background: var(--main-color, #0F4C81);
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    font-weight: 800;
    border-radius: 12px;
    transition: background 0.3s ease;
    margin-bottom: 15px;
}

.enroll-btn-large:hover {
    background: #0c3e69;
}

.money-back {
    font-size: 13px;
    color: #64748B;
    text-align: center;
    margin: 0;
}

.sidebar-includes {
    padding: 30px;
}

.sidebar-includes h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--text-heading, #0F172A);
}

.sidebar-includes ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-includes li {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #475569;
}

.sidebar-includes li:last-child {
    margin-bottom: 0;
}

.sidebar-includes li i {
    width: 20px;
    text-align: center;
    color: var(--accent-cta, #14B8A6);
    font-size: 16px;
}

/* Instructor Section */
.instructor-card {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 40px;
}

.instructor-header {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #E2E8F0;
}

.inst-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-cta, #14B8A6);
}

.inst-details h3 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-heading, #0F172A);
    margin-bottom: 5px;
}

.inst-title {
    display: block;
    font-size: 16px;
    color: #64748B;
    margin-bottom: 15px;
}

.inst-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.inst-stats span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inst-stats i {
    color: #94A3B8;
}

.inst-stats .text-warning {
    color: #F59E0B;
}

.instructor-bio p {
    font-size: 16px;
    line-height: 1.8;
    color: #475569;
    margin-bottom: 15px;
}

/* Reviews Section */
.reviews-summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 30px;
    text-align: center;
}

.rating-huge {
    font-size: 64px;
    font-weight: 900;
    color: var(--text-heading, #0F172A);
    line-height: 1;
    margin-bottom: 10px;
}

.rating-stars {
    font-size: 24px;
    margin-bottom: 10px;
}

.rating-count {
    color: #64748B;
    font-size: 15px;
}

.review-item {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
}

.review-user {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    background: var(--light-color, #E2E8F0);
    color: var(--main-color, #0F4C81);
    font-size: 20px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.user-info h4 {
    margin: 0 0 5px 0;
    font-size: 18px;
    color: var(--text-heading, #0F172A);
}

.review-stars {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.review-time {
    color: #94A3B8;
    margin-right: 10px;
    font-size: 13px;
}

.review-text {
    font-size: 16px;
    line-height: 1.7;
    color: #475569;
    margin: 0;
}

/* Write Review Form */
.mt-15 {
    margin-top: 15px;
}

.write-review-form {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    animation: fadeIn 0.3s ease;
}

.write-review-form h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
    color: var(--text-heading, #0F172A);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
    color: #334155;
    font-size: 15px;
}

.star-rating-input {
    display: flex;
    gap: 5px;
    font-size: 24px;
    color: #CBD5E1;
    cursor: pointer;
}

.star-rating-input i.active,
.star-rating-input i:hover,
.star-rating-input i:hover ~ i {
    /* Notice: the ~ selector logic usually works right-to-left for hover, 
       but we will handle the precise hover coloring via JS for better RTL support */
}

.star-rating-input i.active {
    color: #F59E0B;
}
.star-rating-input i.fa-solid {
    color: #F59E0B;
}

.write-review-form textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.write-review-form textarea:focus {
    outline: none;
    border-color: var(--main-color, #0F4C81);
}

.form-actions {
    display: flex;
    gap: 15px;
}

.btn-outline {
    background: transparent;
    border: 1px solid #CBD5E1;
    color: #64748B;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background: #F1F5F9;
    color: #334155;
}

/* Responsive */
@media (max-width: 992px) {
    .course-layout-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .course-sidebar-wrapper {
        margin-top: -60px;
        order: -1; /* Move sidebar above content on mobile */
    }

    .sticky-sidebar {
        position: relative;
        top: 0;
    }

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

@media (max-width: 768px) {
    .course-hero {
        padding: 80px 0 60px;
    }

    .course-hero h1 {
        font-size: 28px;
    }

    .course-subtitle {
        font-size: 16px;
    }

    .course-hero-meta {
        gap: 15px;
        flex-direction: column;
        align-items: flex-start;
    }

    .course-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 5px;
        -webkit-overflow-scrolling: touch;
    }

    .tab-btn {
        padding: 12px 15px;
        font-size: 15px;
    }

    .ld-section-header {
        padding: 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .ld-lessons-list li {
        padding: 12px 15px 12px 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .lesson-time {
        margin-right: 0;
        padding-right: 30px;
    }

    .instructor-header {
        flex-direction: column;
        text-align: center;
    }

    .inst-stats {
        justify-content: center;
    }

    .review-user {
        flex-direction: column;
        text-align: center;
    }
}
