/* Single Course Template */

/* Background cho trang chi tiết khóa học - set bằng inline style từ PHP */

.lms-single-course-wrapper {
    max-width: 1120px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    border-radius: 20px;
    background: white;
}

:root {
    --primary-red: #f36f1c;
    --badge-video: #c62828;
    --header-bg: #fdf6e7;
    --header-border: #f5e0b6;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-light: #ebebeb;
}

.main-wrapper {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
    /* Khoảng cách giữa các Group */
    margin-top: 10px;
    ;
}

/* Khung bao ngoài mỗi Group */
.accordion-group {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: 1px solid #eee;
}

ul,
li,
h2 {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* --- 3. HEADER (CLICKABLE) --- */
.group-header {
    background-color: var(--header-bg);
    padding: 15px 16px;
    border-bottom: 1px solid transparent;
    /* Ẩn border khi đóng */
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    transition: background-color 0.2s;
    user-select: none;
}

.group-header:hover {
    background-color: #faeccf;
    /* Màu đậm hơn chút khi hover */
}

/* Khi header đang mở (Active) */
.group-header.active {
    border-bottom: 1px solid var(--header-border);
}

/* Icon mũi tên */
.header-arrow-icon {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    color: var(--primary-red);
    flex-shrink: 0;
    transition: transform 0.3s ease;
    /* Hiệu ứng xoay */
    transform: rotate(0deg);
    /* Mặc định mũi tên trỏ xuống như SVG gốc */
}

/* Khi active thì xoay mũi tên */
.group-header.active .header-arrow-icon {
    transform: rotate(180deg);
}

.header-content {
    flex: 1;
}

.header-title {
    color: var(--primary-red);
    font-weight: 600;
    font-size: 15px;
    text-transform: uppercase;
    display: block;
    margin-bottom: 4px;
    line-height: 1.4;
}

.header-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

.header-icon-right {
    color: #888;
    margin-left: 10px;
}

/* --- 4. PHẦN DANH SÁCH (DROPDOWN BODY) --- */
.list-container {
    position: relative;
    background: #fff;

    /* CSS cho Animation Dropdown */
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease-out, opacity 0.3s ease-in;
}

/* Khi class 'open' được thêm vào bằng JS */
.list-container.open {
    opacity: 1;
    /* max-height sẽ được set inline bằng JS để animation chuẩn */
}

/* Đường kẻ dọc đỏ */
.list-container::before {
    content: '';
    position: absolute;
    top: 0;
    /* Bắt đầu sát mép trên */
    bottom: 30px;
    left: 36px;
    width: 2px;
    background-color: var(--primary-red);
    z-index: 0;
    display: block;
}

/* --- CÁC ITEM BÊN TRONG --- */
.list-item {
    display: flex;
    align-items: flex-start;
    position: relative;
    z-index: 1;
    text-decoration: none;
    color: inherit;
}

a.list-item {
    cursor: pointer;
    transition: background-color 0.2s;
}


.item-left {
    width: 72px;
    min-width: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 18px;
}

.box-number {
    width: 28px;
    height: 28px;
    background-color: var(--primary-red);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px var(--primary-red);
    z-index: 2;
}

.box-status {
    font-size: 9px;
    font-weight: 700;
    margin-top: 6px;
    padding: 2px 4px;
    border-radius: 3px;
    background: #fff;
    line-height: 1;
    text-align: center;
    z-index: 2;
    border: 1px solid currentColor;
}

.status-video {
    color: var(--badge-video);
    border-color: var(--badge-video);
}

.item-right {
    flex: 1;
    display: flex;
    padding: 18px 15px 18px 0;
    border-bottom: 1px solid var(--border-light);
    margin-right: 15px;
}

.list-item:last-child .item-right {
    border-bottom: none;
}

.item-icon {
    margin-right: 12px;
    margin-top: 2px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.item-icon svg {
    width: 100%;
    height: 100%;
    fill: #666;
}

.item-content-box {
    flex: 1;
}

.item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin: 0 0 4px 0;
}

.item-meta {
    font-size: 12px;
    color: #888;
}

.item-action {
    padding-left: 10px;
    color: #bbb;
}

.list-item:hover .item-right {
    background-color: #fafafa;
}

/* Icon SVG Helper */
.icon-svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.lms-breadcrumb {
    padding: 10px 0px;
    background-color: #feecd6;
}

/* Ảnh trang trí 2 bên */
.lms-decoration-left,
.lms-decoration-right {
    position: absolute;
    z-index: 100;
    pointer-events: none;
    top: 40px;
}

.lms-decoration-left {
    left: 0;
}

.lms-decoration-right {
    right: 0;
}

.lms-decoration-left img,
.lms-decoration-right img {
    max-width: 150px;
    height: auto;
    display: block;
}

@media (max-width: 991px) {

    .lms-decoration-left,
    .lms-decoration-right {
        display: none;
    }
}

/* Breadcrumb */
.lms-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #666;
}

.lms-breadcrumb a {
    color: #0073aa;
    text-decoration: none;
}

.lms-breadcrumb a:hover {
    text-decoration: underline;
}

.lms-breadcrumb .separator {
    color: #999;
}

.lms-breadcrumb .current {
    color: #0073aa;
}

/* Course Title */
.lms-course-title {
    color: #f36f1c;
    margin: 0 0 12px;
    line-height: 1.3;
    font-weight: 600;
    font-size: 24px;
}

/* Course Description */
.lms-course-description {
    color: #333;
    font-size: 15px;
    line-height: 2;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

/* Tabs */
.lms-course-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #eee;
    margin-bottom: 24px;
}

.lms-course-tabs .tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
    border-radius: 20px;
}

.lms-course-tabs .tab-btn:hover {
    color: #f36f1c;
}

.lms-course-tabs .tab-btn.active {
    color: #f36f1c;
    box-shadow: 0px 2px 4px 0px #8271861f;
}


/* Section Title */
.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #f36f1c;
    margin: 0 0 16px;
}

.lms-search-box {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 100%;
    background-color: #fff;
    border: 1px solid #dce0e4;
    border-radius: 99px;
    padding: 0px 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: border-color 0.2s;
}

.lms-search-box:focus-within {
    border-color: #2980b9;
}

.lms-search-box input#lesson-search {
    flex-grow: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    color: #333;
    padding: 0 10px 0 5px;
    margin: 0;
    box-shadow: none;
}

.lms-search-box input#lesson-search::placeholder {
    color: #6c757d;
}

.search-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.search-icon {
    width: 22px;
    height: 22px;
    fill: #000;
    transition: transform 0.2s;
}

.search-btn:hover .search-icon {
    transform: scale(1.1);
}


/* No lessons */
.no-lessons {
    text-align: center;
    color: #888;
    padding: 40px;
}

/* Responsive */
@media (max-width: 768px) {
    .lms-single-course-wrapper {
        padding: 16px;
    }

    .lms-course-title {
        font-size: 22px;
    }

    .lms-course-tabs .tab-btn {
        padding: 10px 16px;
        font-size: 14px;
    }
}