/**
 * Course Detail Page Styles
 * 
 * Floating Card Design - High Fidelity Mockup Match
 */

/* General Wrapper */
.course-detail-wrapper {
    background-color: #f5f7f9;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Hero Banner Section */
.course-detail-hero {
    position: relative;
    height: 550px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    padding-bottom: 100px;
    /* Space for the floating card overlay */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    /* Match card width */
    width: 100%;
    padding: 0;
    /* Shift text higher as requested */
    margin-top: -60px;
}

.back-to-courses {
    display: block;
    text-align: left;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.3px;
    margin-bottom: 40px;
}

.hero-title {
    color: #fff !important;
    font-size: 64px;
    /* Increased for premium feel */
    font-weight: 400;
    margin: 0 0 15px;
    font-family: "Playfair Display", serif;
    letter-spacing: -0.5px;
    line-height: 1.0;
    /* Tighter line height for the "pipe" design */
}

.title-pipe {
    font-weight: 300;
    opacity: 0.6;
    margin: 0 5px;
}

.hero-categories {
    font-size: 14px;
    color: #fff;
    margin-bottom: 35px;
    text-transform: capitalize;
    letter-spacing: 0.5px;
    font-weight: 400;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.hero-categories span {
    text-decoration: none;
    opacity: 0.9;
}

.hero-author {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.hero-author-avatar {
    width: 60px;
    /* Larger for mobile impact as seen in mockup */
    height: 60px;
    background: #1a1a1a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.hero-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-author-name {
    font-size: 15px;
    font-weight: 500;
    color: #fff;
    letter-spacing: 0.5px;
    opacity: 0.85;
}

/* Main Content Area */
.course-main-content-area {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 0 80px;
    position: relative;
    z-index: 10;
}

/* Floating Content Card */
.course-content-card {
    background: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin-top: -140px;
    /* Pull it up over the hero */
    padding: 0;
}

.card-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    /* Slightly narrower label col */
    padding: 40px 60px;
    /* More breathable padding */
    align-items: start;
}

.row-label {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    letter-spacing: 0.2px;
    line-height: 1.2;
    padding-top: 5px;
    /* Base alignment push */
}

.row-content {
    color: #444;
    /* Slightly softer than pure black */
    font-size: 15px;
    line-height: 1.8;
}

.course-overview-content {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 3.6em;
    min-height: 3.6em;
    /* Ensure divider stays aligned even if empty */
    /* line-height 1.8 * 2 */
}

.course-overview-content p {
    margin-bottom: 0px;
}

.course-overview-content ul {
    padding-left: 20px;
    margin-bottom: 25px;
}

.course-overview-content li {
    margin-bottom: 12px;
}

.overview-row .row-label {
    padding-top: 6px;
    /* Align with 1.8 line-height text */
}

.overview-row {
    padding-top: 45px;
    padding-bottom: 40px;
    /* Fine-tuned to align divider with hero bottom */
}

.card-divider {
    border: 0;
    border-top: 1px solid #f4f4f4;
    margin: 0;
}

/* Curriculum Table */
.curriculum-table,
.curriculum-table thead,
.curriculum-table tbody,
.curriculum-table tr,
.curriculum-table th,
.curriculum-table td {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

.curriculum-table {
    width: 100%;
    border-collapse: collapse !important;
}

.curriculum-table th {
    text-align: left;
    padding: 0 0 15px;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #f0f0f0 !important;
    line-height: 1.2;
}

.curriculum-row .row-label {
    padding-top: 10px;
    /* Table headers start earlier than text blocks */
}

.curriculum-table td {
    padding: 20px 0;
    border-bottom: 1px solid #f0f0f0 !important;
    font-size: 14px;
}

.lesson-title-inner {
    display: flex;
    align-items: center;
    gap: 15px;
}

.lesson-status-icon i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    font-size: 10px;
    color: #aeaeae;
    border: 1.5px solid #d0d0d0;
    transition: all 0.2s;
}

.lesson-status-icon i.fa-square-o::before {
    content: "";
    /* Make box empty */
}

.lesson-completed .lesson-status-icon i {
    background: #d8d8d8;
    border-color: #d8d8d8;
    color: #fff;
}

.lesson-link,
.lesson-text {
    color: #333;
    text-decoration: none !important;
    font-weight: 400;
}

.lesson-completed .lesson-link {
    text-decoration: underline !important;
    color: #888;
}

.lesson-completed .lesson-link,
.lesson-completed .col-duration {
    text-decoration: none;
    /* Ensure no strike-through inherited */
}

.col-duration {
    text-align: right;
    color: #999;
    font-size: 13px;
    white-space: nowrap;
}

/* Progress and Action Button */
.progress-action-container {
    display: grid;
    grid-template-columns: 1fr 220px;
    align-items: center;
    gap: 40px;
}

.progress-row .row-label {
    padding-top: 15px;
    /* Center with the action button and progress bar */
}

.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 20px;
}

.progress-bar-track {
    flex: 1;
    height: 10px;
    background: #f4f4f4;
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: #d8d8d8;
    transition: width 0.4s ease;
}

.progress-percentage {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    min-width: 40px;
}

.btn-course-action {
    display: block;
    background: #ff5e4d;
    color: #fff !important;
    text-align: center;
    padding: 14px;
    border-radius: 6px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 14px;
    transition: transform 0.2s;
}

/* Global Padding Removal for Course Detail Layout */
.content-pusher .ctm_course_details {
    padding: 0 !important;
}

/* Ensure the header meets the hero banner without gap */
.ctm_course_details>.ctm_section_wrapper:first-child {
    margin-bottom: 0 !important;
}

.related-courses-section {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Responsive Rules */
@media (max-width: 991px) {
    .back-to-courses {
        display: none !important;
        /* Hide to match mockup layout */
    }

    .course-detail-hero {
        height: auto;
        min-height: 500px;
        padding-top: 60px;
        padding-bottom: 100px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .hero-content {
        margin-top: 0;
        padding: 0 30px;
    }

    .hero-title {
        font-size: 44px;
        line-height: 1.1;
        margin-bottom: 25px;
    }

    .hero-categories {
        margin-bottom: 40px;
        gap: 20px;
        font-size: 14px;
        justify-content: center;
    }

    .hero-author {
        margin-top: 10px;
        gap: 15px;
    }

    .hero-author-avatar {
        width: 70px;
        height: 70px;
        background: rgba(26, 26, 26, 0.8);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .hero-author-name {
        font-size: 16px;
        opacity: 0.9;
        font-weight: 300;
        letter-spacing: 0.8px;
    }

    .course-main-content-area {
        padding: 0 15px 80px;
    }

    .course-content-card {
        margin-top: -120px;
        border-radius: 12px;
        padding: 10px 0;
    }

    .card-row {
        grid-template-columns: 1fr;
        padding: 40px 30px;
        gap: 15px;
    }

    .row-label {
        font-size: 22px;
        font-weight: 700;
        color: #222;
        margin-bottom: 5px;
    }

    .row-content {
        font-size: 16px;
        line-height: 1.7;
        color: #4a4a4a;
    }

    .curriculum-table th {
        font-size: 16px;
        color: #222;
        padding-bottom: 15px;
        font-weight: 700;
    }

    .curriculum-table td {
        padding: 18px 0;
    }

    .lesson-title-inner {
        gap: 12px;
    }

    .lesson-status-icon i {
        width: 20px;
        height: 20px;
    }

    .lesson-link,
    .lesson-text {
        font-size: 15px;
        color: #333;
    }

    .progress-action-container {
        display: flex;
        flex-direction: column;
        gap: 30px;
    }

    .progress-bar-container {
        display: flex !important;
        align-items: center !important;
        gap: 15px !important;
        width: 100% !important;
        margin-bottom: 10px;
    }

    .progress-bar-container::before {
        content: "Progress";
        font-size: 20px;
        font-weight: 500;
        color: #333;
        flex-shrink: 0;
    }

    /* Hide the duplicate row-label in the progress row on mobile */
    .progress-row .row-label {
        display: none !important;
    }

    .progress-row .row-content {
        grid-column: 1 / -1 !important;
    }

    .progress-bar-track {
        flex-grow: 1 !important;
        height: 14px !important;
        background: #f5f5f5 !important;
        border: 1px solid #e0e0e0 !important;
        border-radius: 4px !important;
        overflow: hidden !important;
        position: relative !important;
    }

    .progress-bar-fill {
        background: #d0d0d0 !important;
        height: 100% !important;
        display: block !important;
    }

    .progress-percentage {
        font-size: 18px;
        font-weight: 400;
        color: #333;
        min-width: 45px;
        text-align: right;
        flex-shrink: 0;
    }

    .course-action-wrap {
        width: 100% !important;
    }

    .btn-course-action {
        width: 100% !important;
        display: block !important;
        padding: 18px;
        font-size: 24px;
        font-weight: 400;
        border-radius: 8px;
        box-shadow: 0 4px 15px rgba(255, 94, 77, 0.2);
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 38px;
    }

    .hero-categories {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px 25px;
    }

    .hub-section-title {
        font-size: 13px;
        margin-bottom: 40px;
    }

    .course-card-image {
        height: 220px;
    }

    .course-card-content {
        padding: 25px;
    }

    .course-card-title {
        font-size: 18px;
        margin-bottom: 12px;
        font-weight: 700;
    }

    .course-card-intro {
        font-size: 14px;
        line-height: 1.6;
        margin-bottom: 25px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 32px;
    }

    .card-row {
        padding: 35px 20px;
    }

    .row-label {
        font-size: 20px;
    }

    .row-content {
        font-size: 15px;
    }

    .curriculum-table th,
    .curriculum-table td {
        font-size: 14px;
    }

    .col-duration {
        font-size: 14px;
    }
}

.single-lp_course .container-fluid,
.single-lp_course #main-content,
.single-lp_course .content-pusher,
.single-lp_course .course-detail-wrapper {
    background-color: #f5f7f9 !important;
}