.lp-archive-courses {
    padding-top: 30px;
}

.lpe-video-wrapper {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.lpe-video-wrapper video {
    width: 100%;
    display: block;
}

.lpe-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 50px;
    /* Leave space for controls */
    z-index: 10;
    /* Transparent overlay to prevent right clicks on the video itself */
}

/* ========================================================
   PREMIUM COURSE CARD DESIGN (Standardized Layout)
   ======================================================== */
/* Reset Native LearnPress styling on the wrapper li */
ul.learn-press-courses>li.course {
    background: transparent;
    border: none;
    box-shadow: none;
}

.lpe-course-card,
ul.learn-press-courses>li.course-item {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #f3f4f6;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    /* For Grid alignment */
}

.lpe-course-card:hover,
ul.learn-press-courses>li.course-item:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12) !important;
}

/* Thumbnail */
.lpe-course-thumb,
.lpe-course-card .lpe-course-thumbnail,
ul.learn-press-courses .course-thumbnail {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    position: relative !important;
}

.lpe-course-thumb img,
.lpe-course-card .lpe-course-thumbnail img,
ul.learn-press-courses .course-thumbnail img {
    width: 100% !important;
    aspect-ratio: 16/9 !important;
    object-fit: cover !important;
    border-radius: 12px 12px 0 0 !important;
    display: block !important;
}

/* Inner Content Wrapper */
.lpe-course-content,
ul.learn-press-courses .course-content,
ul.learn-press-courses .course-item-inner {
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
    padding: 0 !important;
    background: transparent !important;
}

/* Title */
.lpe-course-title,
ul.learn-press-courses .course-title {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #1f2937 !important;
    margin: 10px 20px 15px 20px !important;
    line-height: 1.4 !important;
}

.lpe-course-title a,
ul.learn-press-courses .course-title a {
    color: inherit !important;
    text-decoration: none !important;
}

/* Meta Data (Lessons, Students) */
.lpe-course-meta,
ul.learn-press-courses .course-meta {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 15px !important;
    color: #6b7280 !important;
    font-size: 13px !important;
    margin: 0 20px 20px 20px !important;
}

.lpe-course-meta>div,
.lpe-course-meta>span,
.lpe-meta-item,
ul.learn-press-courses .course-meta>div {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

/* Rating (if any) */
.lpe-course-rating,
ul.learn-press-courses .course-rating {
    font-size: 13px !important;
    color: #2d50e6 !important;
    margin: 20px 20px 5px 20px !important;
}

/* Separate Author & Price with a dashed line */
.lpe-course-footer,
.lpe-course-card .course-item-bottom,
ul.learn-press-courses .course-item-bottom {
    margin-top: auto !important;
    border-top: 1px dashed #e5e7eb !important;
    padding: 15px 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.lpe-course-author,
ul.learn-press-courses .course-author {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    font-size: 14px !important;
    color: #374151 !important;
    font-weight: 500 !important;
}

.lpe-course-author img,
ul.learn-press-courses .course-author img {
    width: 30px !important;
    height: 30px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
}

.lpe-course-price,
ul.learn-press-courses .course-price,
ul.learn-press-courses .price {
    color: #ef4444 !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    margin: 0 !important;
    text-align: right !important;
}

.lpe-course-card .free,
ul.learn-press-courses .free {
    color: #10b981 !important;
}

/* Featured Badge */
.lpe-course-badge.featured,
ul.learn-press-courses .course-badge.featured {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    background: #ef4444 !important;
    color: #ffffff !important;
    font-weight: bold !important;
    font-size: 12px !important;
    border-radius: 4px !important;
    text-transform: uppercase !important;
    padding: 4px 10px !important;
    z-index: 10 !important;
}

/* ========================================================
   COURSES BAR / HEADER (Archive Top)
   ======================================================== */
.lp-courses-bar {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 30px !important;
    gap: 15px !important;
    width: 100% !important;
}

.lp-courses-bar form.search-courses {
    display: flex !important;
    margin: 0 !important;
    flex-grow: 1 !important;
    max-width: 350px !important;
}

.lp-courses-bar form.search-courses input[type="search"] {
    border-radius: 6px 0 0 6px !important;
    margin-bottom: 0 !important;
    height: 42px !important;
    border: 1px solid #ddd !important;
    border-right: none !important;
    box-shadow: none !important;
}

.lp-courses-bar form.search-courses button {
    border-radius: 0 6px 6px 0 !important;
    margin-bottom: 0 !important;
    height: 42px !important;
    border: 1px solid #ddd !important;
    background: #f9fafb !important;
    color: #4b5563 !important;
}

.lp-courses-bar .courses-order-by-wrapper {
    margin-left: auto !important;
    display: flex !important;
}

.lp-courses-bar select.courses-order-by {
    margin-bottom: 0 !important;
    height: 42px !important;
    min-width: 180px !important;
    border-radius: 6px !important;
    border: 1px solid #ddd !important;
    box-shadow: none !important;
}

.lp-courses-bar .switch-layout {
    display: flex !important;
    margin: 0 !important;
}

.lp-courses-bar .switch-layout label.switch-btn {
    height: 42px !important;
    width: 42px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid #ddd !important;
    margin-left: -1px !important;
}

.lp-courses-bar .switch-layout input:checked+label.switch-btn {
    background: #f3f4f6 !important;
}

@media (max-width: 768px) {
    .lp-courses-bar {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .lp-courses-bar form.search-courses {
        max-width: 100% !important;
    }

    .lp-courses-bar .courses-order-by-wrapper {
        margin-left: 0 !important;
    }

    .lp-courses-bar .courses-order-by-wrapper select {
        width: 100% !important;
    }

    .lp-courses-bar>* {
        width: 100% !important;
        display: flex;
        justify-content: space-between;
    }
}

/* ========================================================
   SINGLE COURSE (Unica Layout)
   ======================================================== */
.lpe-single-course-page {
    background-color: #f9fafb;
    padding-bottom: 60px;
}

/* Single Course Wrapper */
.lpe-single-course-wrapper {
    overflow-x: clip;
    overflow-y: visible;
    /* To contain the full-width pseudo/absolute background without breaking sticky */
}

.lpe-single-course-wrapper>.row {
    display: flex;
    flex-wrap: wrap;
}

/* Hero Content */
.lpe-hero-content {
    position: relative;
    padding: 40px 0;
    margin-bottom: 40px;
    color: #ffffff;
    z-index: 1;
}

.lpe-hero-bg {
    position: absolute;
    top: 0;
    bottom: 0;
    left: -50vw;
    right: -50vw;
    /* Background color is injected dynamically */
    background-color: #1f2937;
    z-index: -1;
}

.lpe-breadcrumbs {
    font-size: 14px;
    margin-bottom: 15px;
    color: #9ca3af;
}

.lpe-breadcrumbs a {
    color: #9ca3af;
    text-decoration: none;
}

.lpe-breadcrumbs a:hover {
    color: #ffffff;
}

.lpe-single-title {
    font-size: 32px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    margin-top: 0 !important;
    margin-bottom: 15px !important;
    line-height: 1.3 !important;
}

.lpe-single-excerpt {
    font-size: 16px;
    color: #d1d5db;
    margin-bottom: 25px;
    line-height: 1.6;
}

.lpe-single-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    font-size: 14px;
}

.lpe-single-meta .lpe-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lpe-single-meta .lpe-meta-item img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

/* Main Content Area */
/* Course Sections (Replaced Tabs) */
.lpe-single-sections {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 40px;
}

.lpe-course-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #f3f4f6;
}

.lpe-section-title {
    font-size: 24px !important;
    font-weight: 700 !important;
    color: #1f2937 !important;
    margin-top: 0 !important;
}

.lpe-section-content {
    color: #4b5563;
    line-height: 1.7;
    font-size: 15px;
}

/* Ensure LearnPress content inside sections looks good */
.lpe-section-content ul {
    list-style-type: disc;
    padding-left: 20px;
    margin-bottom: 15px;
}

.lpe-section-content ol {
    list-style-type: decimal;
    padding-left: 20px;
    margin-bottom: 15px;
}

/* Ẩn các tiêu đề mặc định của LearnPress bên trong tab để tránh trùng lặp với tiêu đề Section */
.lpe-section-content .lp-course-curriculum__title,
.lpe-section-content .course-nav-title,
.lpe-section-content h3.course-title,
.lpe-section-content .course-tab-title {
    display: none !important;
}

/* Sticky Sidebar */
.lpe-single-sidebar-col {
    position: relative;
    z-index: 10;
    align-self: stretch;
}

.lpe-sticky-sidebar {
    position: sticky;
    top: 120px;
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    margin-top: 10rem;
}

/* Video Preview inside Sidebar */
.lpe-video-preview {
    margin: -20px -20px 20px -20px;
    /* Pull it to the edges of the sidebar */
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.lpe-single-thumbnail {
    width: 100%;
    display: block;
}

.lpe-sidebar-price {
    font-size: 28px;
    font-weight: 700;
    color: #ef4444;
    margin-bottom: 20px;
    text-align: center;
}

.lpe-sidebar-price .price {
    color: #ef4444 !important;
}

.lpe-sidebar-price del {
    color: #9ca3af !important;
    font-size: 18px !important;
    margin-left: 10px;
}

.lpe-sidebar-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.lpe-sidebar-buttons form {
    margin-bottom: 0 !important;
}

.lpe-sidebar-buttons button {
    width: 100% !important;
    padding: 12px 20px !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    text-transform: none !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
}



.lpe-sidebar-includes h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #1f2937;
}

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

.lpe-sidebar-includes li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #4b5563;
}

.lpe-sidebar-includes li .dashicons {
    color: #10b981;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Xem thêm / Thu gọn */
.lpe-readmore-container {
    position: relative;
}

.lpe-readmore-inner {
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.lpe-readmore-overlay {
    position: absolute;
    bottom: 40px;
    /* Phía trên nút */
    left: 0;
    width: 100%;
    height: 120px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1) 90%);
    pointer-events: none;
    display: none;
}

.lpe-readmore-btn {
    display: none;
    width: 100%;
    text-align: center;
    background: none !important;
    border: none !important;
    color: #3b82f6 !important;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    padding: 15px 0 5px 0;
    outline: none;
    text-transform: none;
    margin-bottom: 0;
    margin-right: 0;
}

.lpe-readmore-btn .dashicons {
    vertical-align: middle;
}

.lpe-readmore-container.expanded .lpe-readmore-overlay {
    display: none !important;
}

/* Mobile Responsive */
@media (max-width: 849px) {
    .lpe-single-course-wrapper .row {
        display: flex;
        flex-direction: column;
    }

    .lpe-single-sidebar-col {
        order: -1;
        margin-bottom: 20px;
        position: static;
    }

    .lpe-single-content-col {
        order: 2;
    }

    .lpe-sticky-sidebar {
        margin-top: 0;
        top: 0;
        position: static;
    }

    .lpe-hero-bg {
        /* Đảm bảo background trên mobile không bị tràn lỗi */
        left: -50vw;
        right: -50vw;
    }
}

/* What You Learn Block */
.lpe-what-you-learn {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
}

.lpe-wyl-title {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin-top: 0;
    margin-bottom: 20px;
}

.lpe-wyl-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media(max-width: 768px) {
    .lpe-wyl-grid {
        grid-template-columns: 1fr;
    }
}

.lpe-wyl-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.lpe-wyl-icon {
    color: #22c55e;
    flex-shrink: 0;
    margin-top: 2px;
}

.lpe-wyl-text {
    color: #4b5563;
    font-size: 15px;
    line-height: 1.5;
}

.lpe-item-icon>span.dashicons-yes {
    display: none;
}

.lpe-item.locked .lpe-item-icon {
    border: 0 none;
}

/* ========================================================
   MOBILE LAYOUT FIX FOR SINGLE COURSE
   ======================================================== */
@media (max-width: 849px) {
    .lpe-single-course-wrapper>.row {
        display: flex !important;
        flex-direction: column !important;
    }

    .lpe-single-content-col {
        display: contents !important;
    }

    .lpe-hero-content {
        order: 1 !important;
        padding-bottom: 20px !important;
        margin-bottom: 0 !important;
    }

    .lpe-single-sidebar-col {
        order: 2;
        margin-top: 20px !important;
        /* Pull up over the hero bg */
        padding: 0 15px !important;
        z-index: 10 !important;
    }

    .lpe-main-content {
        order: 3 !important;
        margin-top: 30px !important;
    }

    .lpe-sticky-sidebar {
        position: static !important;
        margin-top: 0 !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    }

    .lpe-hero-bg {
        /* Make sure hero bg still covers the top */
        bottom: 0 !important;
    }
}

/* ========================================================
   LPE TESTIMONIAL CARD
   ======================================================== */
.lpe-testimonial-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    padding: 40px 30px 30px 30px;
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

svg.lpe-tst-blue-bg {
    position: absolute;
    top: -2px; /* Slight offset to hide exact corners */
    left: -2px;
    z-index: 0;
    width: 100px;
    height: auto;
}

.lpe-tst-top {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    position: relative;
    z-index: 1; /* Above the blue corner */
}

.lpe-tst-image-wrapper {
    position: relative;
    width: 70px;
    height: 70px;
    flex-shrink: 0;
}

.lpe-tst-image {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.lpe-tst-content {
    flex: 1;
}

.lpe-tst-content p {
    font-size: 15px;
    color: #4b5563;
    line-height: 1.6;
    margin: 0;
}

.lpe-tst-divider {
    height: 1px;
    background-color: #e5e7eb;
    margin: 25px 0;
    position: relative;
    z-index: 1;
}

.lpe-tst-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
    margin-top: auto;
}

.lpe-tst-info {
    display: flex;
    flex-direction: column;
}

.lpe-tst-name {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.lpe-tst-role {
    font-size: 13px;
    color: #0d6efd;
    font-weight: 500;
}

.lpe-tst-stars {
    display: flex;
    gap: 4px;
}

.lpe-star {
    font-size: 14px;
}

.lpe-star.filled {
    color: #0d6efd;
}

.lpe-star.empty {
    color: #d1d5db;
}

@media (max-width: 768px) {
    .lpe-tst-top {
        flex-direction: column;
        align-items: flex-start;
    }
    .lpe-tst-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}