/* ======================================= */
/* --- Course Detail Page Styles (START) --- */
/* ======================================= */
.course-detail-header {
    background-color: var(--bg-white);
    color: var(--text-color);
    padding: 40px 0;
    border-bottom: 1px solid var(--border-color);
}
.course-detail-container {
    /* (*** V-GEMINI-FIX: 1. ขยาย Layout ให้กว้างขึ้น ***) */
    max-width: 1400px; 
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    /* (*** V-GEMINI-FIX: 2. ปรับสัดส่วน (วิดีโอ 60% / ราคา 40%) ***) */
    grid-template-columns: 1.5fr 1fr;
    /* (*** V-GEMINI-FIX: 3. เพิ่มระยะห่าง ***) */
    gap: 60px;
    align-items: start;
}
.course-video-preview {
    background-color: #eee;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    position: relative;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow); /* (เพิ่มเงาให้วิดีโอ) */
}
.course-video-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.play-button-overlay { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 3.75rem; color: rgba(255,255,255,0.8); cursor: pointer; transition: color 0.2s ease; }
.play-button-overlay:hover { color: #fff; }

/* (*** V-GEMINI-FIX: 4. อัปเกรดความสวยงาม (เปลี่ยนเป็น "การ์ด") ***) */
.course-header-info {
    display: flex;
    flex-direction: column;
    background: var(--bg-white);
    padding: 24px;
    border-radius: 12px;
}

.course-header-info h1 { font-size: 2.5rem; font-weight: 700; line-height: 1.2; /* (ปรับ Line Height) */ margin-bottom: 8px; color: var(--text-color); }
.course-header-info p.course-breadcrumb { font-size: 1.8rem; color: #1a1b1d; margin-bottom: 8px; }
.course-price { margin-bottom: 15px; }
.current-price { font-size: 3.5rem; font-weight: 700; color:#e63719 ; margin-right: 10px; }
.original-price { font-size: 1.5625rem; color: var(--text-muted); text-decoration: line-through; }
.btn-enroll { display: block; width: 100%; padding: 14px; font-size: 1.5625rem; font-weight: 600; letter-spacing: 1.0px; text-align: center; border-radius: 8px; background-color: var(--primary-color); color: #fff; transition: background-color 0.2s; margin-bottom: 15px; border: none; }
.btn-enroll:hover { background-color: #1d4ed8; }
.action-links { display: flex; justify-content: flex-start; gap: 15px; margin-top: 10px; }
.action-links button { color: var(--text-muted); font-size: 1.25rem; cursor: pointer; transition: color 0.2s; padding: 5px; }
.action-links button:hover { color: var(--primary-color); }
@media (max-width: 992px) {
    .course-detail-container { grid-template-columns: 1fr; gap: 30px; }
    .course-header-info h1 { font-size: 1.625rem; }
}
@media (max-width: 768px) {
    .course-detail-header { padding: 30px 0; } .course-detail-container { padding: 0 15px; }
    .course-header-info h1 { font-size: 2.8rem; } .current-price { font-size: 2.5rem; }
    .original-price { font-size: 1rem; } .btn-enroll { padding: 12px; font-size: 2rem; }
}

/* --- Course Content Section --- */
.course-content-section { background-color: var(--bg-white); border-bottom: 1px solid var(--border-color); position: sticky; top: 65px; z-index: 900; box-shadow: 0 2px 4px rgba(0,0,0,0.04); }
/* (*** V-GEMINI-FIX: 1. ขยาย Layout ส่วน Tab ***) */
.course-tabs { max-width: 1400px; margin: 0 auto; padding: 0 24px; display: flex; gap: 30px; border-bottom: 20px solid transparent; } /* Simplified border-bottom */
.tab-link { padding: 18px 0; font-size: 1.5625rem; font-weight: 600; color: var(--text-muted); border-bottom: 3px solid transparent; transition: color 0.2s, border-color 0.2s; cursor: pointer; white-space: nowrap; }
.tab-link.active, .tab-link:hover { color: var(--primary-color); border-bottom-color: var(--primary-color); }

/* --- Course Body --- */
/* (*** V-GEMINI-FIX: 1. ขยาย Layout ส่วนเนื้อหา ***) */
.course-body-container { max-width: 1400px; margin: 30px auto; padding: 0 24px; display: grid; grid-template-columns: 2fr 1fr; gap: 60px; /* (*** V-GEMINI-FIX: 3. เพิ่มระยะห่าง ***) */ align-items: start; }
.course-main-content { min-width: 0; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.content-section { margin-bottom: 40px; }
.content-section h3 { font-size: 1.75rem; font-weight: 700; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid #eee; }
.course-body-container .course-curriculum-preview.content-section { margin-top: 40px; padding-top: 30px; border-top: 1px solid #eee; }

/* Styles for "คำอธิบายคอร์ส" */
.course-full-description .description-wrapper p { font-size: 1.6rem; line-height: 1.8; margin-bottom: 5px; color: #1a1b1d; }
.course-full-description .description-wrapper h3 { font-size: 1.125rem; font-weight: 600; margin-top: 25px; margin-bottom: 15px; }
.course-full-description .description-wrapper ul { list-style: none; padding-left: 0; }
.course-full-description .description-wrapper li { display: flex; align-items: flex-start; gap: 12px; margin-bottom: -13px; font-size: 1rem; }
.course-full-description .description-wrapper li i { color: var(--secondary-color); margin-top: 5px; font-size: 0.875rem; }


/* --- Course Preview List (V2 - Final Version) --- */
.section-title-bar { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid #eee; margin-bottom: 20px; padding-bottom: 10px; }
.section-title-bar h3 { margin-bottom: 0; padding-bottom: 0; border-bottom: none; font-size: 1.5625rem; }
.course-preview-list-v2 { /* Container */ }
.preview-lesson-item-v2 {
    display: flex; justify-content: space-between; align-items: center; padding: 15px 20px;
    border: 1px solid #dee2e6; border-radius: 8px; margin-bottom: 15px;
    background: linear-gradient(to right, #f8f9fa, #fff);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05); cursor: pointer;
    transition: all 0.2s ease-in-out;
}
.preview-lesson-item-v2:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); transform: scale(1.02); border-color: var(--primary-color);
}
.lesson-item-main { display: flex; align-items: center; gap: 15px; }
.lesson-play-icon {
    font-size: 0.875rem; color: var(--primary-color); background-color: #e0f2fe;
    width: 36px; height: 36px; border-radius: 50%; display: inline-flex;
    align-items: center; justify-content: center; flex-shrink: 0;
    transition: background-color 0.2s, color 0.2s;
}
.preview-lesson-item-v2:hover .lesson-play-icon { background-color: var(--primary-color); color: #fff; }
.lesson-title-text { font-size: 1.3125rem; font-weight: 500; color: var(--text-color); line-height: 1.4; }
.lesson-item-meta { display: flex; align-items: center; gap: 15px; flex-shrink: 0; margin-left: 20px; }
.lesson-preview-tag-v6 {
    font-size: 1rem; font-weight: 600; color: var(--secondary-color);
    background-color: #ffffff; padding: 5px 12px; border-radius: 6px;
    white-space: nowrap; border: 1px solid #6e3bfa;
}
.preview-lesson-item-v2 .lesson-duration { font-size: 1.125rem; font-weight: 500; color: var(--text-muted); }
.btn-view-all-content { display: inline-block; padding: 10px 25px !important; font-size: 2.2rem !important; }
.no-preview-text { text-align: center; color: var(--text-muted); font-style: italic; }

/* --- Course Info Sidebar --- */
.course-info-sidebar {
    background: var(--bg-white); border-radius: 12px; padding: 20px;
    border: 1px solid #e0f2fe; background-color: #f0f9ff;
    position: sticky; top: 130px;
}

/* Request Quote (V3 - Final Version) */
.request-quote-box-v3 {
    display: flex; align-items: center; gap: 15px;
    background: linear-gradient(to right, #10b981, #059669);
    border: none; border-radius: 8px; padding: 18px 20px;
    margin-bottom: 30px; text-decoration: none; color: #fff;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.4);
    transition: all 0.3s ease;
}
.request-quote-box-v3:hover {
    background: linear-gradient(to right, #059669, #047857);
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.5); transform: translateY(-2px); color: #fff;
}
.quote-box-icon-img-v3 { width: 50px; height: 50px; object-fit: contain; flex-shrink: 0; filter: brightness(0) invert(1); }
.quote-box-text-v3 { flex-grow: 1; font-size: 1.5625rem; font-weight: 700; line-height: 1.4; }
.quote-box-text-v3 strong { display: block; }
.quote-box-text-v3 small { font-size: 1.125rem; font-weight: 400; color: #d1fae5; display: block; }
.quote-box-link-icon-v3 { font-size: 1.125rem; color: #a7f3d0; transition: transform 0.2s; }
.request-quote-box-v3:hover .quote-box-link-icon-v3 { transform: translateX(4px); }


/* Info Items */
.info-item-group { /* Group */ }
.info-item { display: flex; align-items: center; gap: 20px; font-size: 0.9375rem; margin-bottom: 18px; padding: 5px 0; }
.info-item:last-child { margin-bottom: 0; }
.info-icon-img { width: 28px; height: 28px; object-fit: contain; flex-shrink: 0; opacity: 0.8; }
.info-icon-img.large-icon { width: 50px; height: 50px; opacity: 1; }
.info-text strong { display: block; font-weight: 600; font-size: 2.0rem; color: var(--text-color); }
.info-text span { color: var(--text-muted); font-size: 1.125rem; }


/* ====================================== */
/* --- Instructor Bio (Sidebar - V3 Design) (START) --- */
/* ====================================== */
.instructor-bio-sidebar.content-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #dbeafe; /* เส้นคั่นสีฟ้าอ่อน */
    margin-bottom: 0;
}

/* --- ส่วนหัวข้อ + รูป --- */
.instructor-title-bar {
    display: flex; /* จัด H3 กับ รูป ให้อยู่บรรทัดเดียวกัน */
    align-items: center; /* จัดให้อยู่กึ่งกลางแนวตั้ง */
    gap: 15px; /* ระยะห่างระหว่าง H3 กับ รูป */
    border-bottom: none; /* เอาเส้นขอบล่างของ Title Bar ออก */
    margin-bottom: 15px; /* ระยะห่างใต้หัวข้อ */
    padding-bottom: 0;
}
.instructor-title-bar h3 {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    font-size: 1.5625rem; /* ขนาด Font "ผู้สอน" */
    flex-grow: 1; /* ให้ H3 ดันรูปไปทางขวา (ถ้าต้องการ) */
}
.instructor-profile-pic-header {
    width: 50px; /* ขนาดรูปโปรไฟล์ */
    height: 50px;
    border-radius: 50%; /* ทำให้เป็นวงกลม */
    object-fit: cover; /* ให้รูปเต็มวงกลม */
    border: 2px solid var(--border-color); /* เส้นขอบบางๆ */
    flex-shrink: 0; /* ไม่ให้รูปถูกบีบ */
}

/* --- ส่วนเนื้อหา (ชื่อ + Bio) --- */
.instructor-bio-content {
    /* ไม่มี style พิเศษที่นี่ ใช้ style จาก p โดยตรง */
}

.instructor-bio-content .instructor-name-title strong {
    font-size: 1.8rem; /* ขนาด Font ชื่อผู้สอน */
    display: block;
    margin-bottom: 8px; /* ระยะห่างใต้ชื่อ */
    color: var(--text-color);
}
.instructor-bio-content .instructor-bio-text {
    font-size: 1.125rem; /* ขนาด Font Bio */
    line-height: 1.7; /* ระยะห่างบรรทัด */
    color: var(--text-muted); /* สีตัวอักษร Bio */
}
/* ====================================== */
/* --- Instructor Bio (Sidebar - V3 Design) (END) --- */
/* ====================================== */

/* Responsive Course Detail Body */
@media (max-width: 992px) {
    .course-detail-container, .course-body-container { grid-template-columns: 1fr; gap: 30px; }
    .course-info-sidebar { position: static; margin-top: 10px; }
    .course-tabs { gap: 20px; overflow-x: auto; white-space: nowrap; padding: 0 15px; }
    .tab-link { padding: 15px 0; font-size: 1.9375rem; } .course-content-section { top: 60px; }
}
@media (max-width: 768px) {
    .course-detail-container, .course-body-container { padding: 0 15px; }
    .content-section h3 { font-size: 2.25rem; }
    .preview-lesson-item-v2 { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }
    .lesson-item-meta { margin-left: 0; margin-top: 5px; gap: 10px; }
    .lesson-title-text { font-size: 1.8rem; }
    .lesson-preview-tag-v6 { font-size: 1.5rem; padding: 4px 10px; }
    .preview-lesson-item-v2 .lesson-duration { font-size: 1.7rem; }
    .instructor-profile-pic { width: 40px; height: 40px; }
    .request-quote-box-v3 { padding: 15px; } .quote-box-icon-img-v3 { width: 50px; height: 50px; }
    .quote-box-text-v3 { font-size: 1.8rem; } .quote-box-text-v3 small { font-size: 1.8rem; }
}
/* ======================================= */
/* --- Course Detail Page Styles (END) --- */
/* ======================================= */


/* ====================================== */
/* --- Video Modal (Preview) Styles (START) --- */
/* ====================================== */
.video-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7); /* ความเข้ม Overlay เท่าเดิมหรือปรับตามชอบ */
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}
.video-modal-overlay.open {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}
.video-modal-content {
    position: relative;
    width: 100%;
    max-width: 900px;
    background: var(--bg-white); /* --- เปลี่ยน: พื้นหลังเป็นสีขาว --- */
    border-radius: 12px; /* --- เพิ่ม: ความโค้งมน --- */
    box-shadow: 0 10px 30px rgba(0,0,0,0.2); /* --- ปรับ: เงาให้ดูนุ่มนวลขึ้น --- */
    transform: scale(0.9);
    transition: transform 0.3s ease;
    padding: 30px; /* --- เพิ่ม: Padding รอบ content ทั้งหมด --- */
    padding-top: 60px; /* --- เพิ่ม: เว้นที่ด้านบนให้ Header และปุ่มปิด --- */
}
.video-modal-overlay.open .video-modal-content {
    transform: scale(1);
}

/* --- Modal Header --- */
.video-modal-header {
    position: absolute; /* --- เพิ่ม: ทำให้ลอยอยู่ด้านบนสุด --- */
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-white); /* --- เปลี่ยน: พื้นหลัง Header สีขาว --- */
    padding: 15px 20px;
    padding-right: 50px; /* เว้นที่ให้ปุ่มปิด */
    border-bottom: 1px solid var(--border-color); /* --- เปลี่ยน: เส้นขอบสีอ่อน --- */
    border-radius: 12px 12px 0 0; /* --- เพิ่ม: ทำให้มุมบนโค้งตาม Modal --- */
}
#video-modal-title {
    color: var(--text-color); /* --- เปลี่ยน: สีตัวอักษรเป็นสีเข้ม --- */
    font-size: 1.375rem; /* --- ปรับ: ขนาด Font ให้เข้ากับส่วนอื่น --- */
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-modal-close-btn {
    position: absolute;
    top: 10px; /* --- ปรับ: ตำแหน่งปุ่มปิด --- */
    right: 15px; /* --- ปรับ: ตำแหน่งปุ่มปิด --- */
    width: 36px;
    height: 36px;
    font-size: 1.5rem; /* --- ปรับ: ขนาดไอคอน --- */
    color: var(--text-muted); /* --- เปลี่ยน: สีไอคอน --- */
    background: transparent;
    border: none;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s, color 0.2s;
    z-index: 10;
}
.video-modal-close-btn:hover {
    opacity: 1;
    color: var(--text-color); /* --- เปลี่ยน: สีไอคอน Hover --- */
}
.video-modal-iframe-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    background: #eee; /* --- เปลี่ยน: พื้นหลังตอนโหลดเป็นสีเทาอ่อน --- */
    border-radius: 8px; /* --- เพิ่ม: ทำให้มุม iframe โค้งมนเล็กน้อย --- */
    /* ไม่ต้องมี Padding ที่นี่ เพราะ .video-modal-content มี Padding แล้ว */
}
.video-modal-iframe-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}
/* ====================================== */
/* --- Video Modal (Preview) Styles (END) --- */
/* ====================================== */

/* ====================================== */
/* --- Responsive for Modal (START) --- */
/* ====================================== */
@media (max-width: 768px) {
    .video-modal-content {
        padding: 15px; /* --- ปรับ: Padding น้อยลง --- */
        padding-top: 55px; /* --- ปรับ: Padding บนน้อยลง --- */
    }
    .video-modal-header {
        padding: 12px 15px;
        padding-right: 45px;
    }
    #video-modal-title {
        font-size: 1.125rem; /* --- ปรับ: ขนาด Font Title --- */
    }
    .video-modal-close-btn {
        top: 8px; /* --- ปรับ --- */
        right: 10px; /* --- ปรับ --- */
        width: 32px;
        height: 32px;
        font-size: 1.3rem;
    }
}
/* ====================================== */
/* --- Responsive for Modal (END) --- */
/* ====================================== */

/* ====================================== */
/* --- "Watched" Status for Lesson Item (START) --- */
/* ====================================== */
.preview-lesson-item-v2.watched {
    /* (สถานะ "ดูแล้ว") */
    opacity: 0.7; /* ทำให้จางลงเล็กน้อย */
}
.preview-lesson-item-v2.watched .lesson-play-icon {
    /* เปลี่ยนไอคอนจาก Play เป็น Check */
    background-color: #d1fae5; /* สีเขียวอ่อน */
    color: #065f46; /* สีเขียวเข้ม */
}
.preview-lesson-item-v2.watched .lesson-play-icon i::before {
    content: "\f00c"; /* FontAwesome "check" icon */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
}
.preview-lesson-item-v2.watched .lesson-title-text {
    /* (ตัวเลือก) เปลี่ยนสีข้อความ */
     color: var(--text-muted);
}
/* ====================================== */
/* --- "Watched" Status for Lesson Item (END) --- */
/* ====================================== */

p, li, td, label, span, div {
    font-size: 1.8rem;
    font-weight: 600;
    line-height: 1.0;
}