main>.container {
    padding: 70px 15px 20px;
}

.footer {
    background-color: #f5f5f5;
    font-size: .9em;
    height: 60px;
}

.footer>.container {
    padding-right: 15px;
    padding-left: 15px;
}

.not-set {
    color: #c55;
    font-style: italic;
}

.default-color {
    background-color: #00519A;

}

/* add sorting icons to gridview sort links */
a.asc:after,
a.desc:after {
    content: '';
    left: 3px;
    display: inline-block;
    width: 0;
    height: 0;
    border: solid 5px transparent;
    margin: 4px 4px 2px 4px;
    background: transparent;
}

a.asc:after {
    border-bottom: solid 7px #212529;
    border-top-width: 0;
}

a.desc:after {
    border-top: solid 7px #212529;
    border-bottom-width: 0;
}

.grid-view th {
    white-space: nowrap;
}

.hint-block {
    display: block;
    margin-top: 5px;
    color: #999;
}

.error-summary {
    color: #a94442;
    background: #fdf7f7;
    border-left: 3px solid #eed3d7;
    padding: 10px 20px;
    margin: 0 0 15px 0;
}

/* align the logout "link" (button in form) of the navbar */
.nav li>form>button.logout {
    padding-top: 7px;
    color: rgba(255, 255, 255, 0.5);
}

@media(max-width:767px) {

    .nav li>form>button.logout {
        display: block;
        text-align: left;
        width: 100%;
        padding: 10px 0;
    }

}

.nav>li>form>button.logout:focus,
.nav>li>form>button.logout:hover {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.75);
}

.nav>li>form>button.logout:focus {
    outline: none;
}

.form-group {
    margin-bottom: 1rem;
}


/*Yii2TimerCountDown*/
/* กรอบการ์ด */
.countdown-card {
    /*display:inline-block;*/
    /*padding:16px 18px;*/
    /*border-radius:16px;*/
    /*border:1px solid rgba(0,0,0,.08);*/
    /*background:#fff;*/
    /*box-shadow:0 10px 24px rgba(0,0,0,.08);*/
}

.countdown-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 10px;
    opacity: .85;
}

/* ตัว timer */
.countdown-ui {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ตัวคั่น ":" ที่เราส่งผ่าน countDownResSperator */
.countdown-ui .cd-sep {
    display: inline-block;
    font-weight: 800;
    font-size: 22px;
    opacity: .4;
    transform: translateY(-1px);
}

/*
  widget จะใส่ span เป็นกลุ่ม ๆ เมื่อ addSpanForResult/addSpanForEachNum = true
  คลาสมาตรฐานตาม README:
  - item-counter-down
  - inner-item-counter-down
  :contentReference[oaicite:8]{index=8}
*/
.countdown-ui .item-counter-down {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* กล่องตัวเลข */
.countdown-ui .inner-item-counter-down {
    min-width: 46px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, .10);
    background: linear-gradient(180deg, #ffffff, #f6f7fb);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);

    font-weight: 800;
    font-size: 22px;
    letter-spacing: .5px;
}

/* (ออปชัน) โฮเวอร์ให้ดูมีชีวิต */
.countdown-card:hover .inner-item-counter-down {
    transform: translateY(-1px);
    transition: .15s ease;
}


/*radioList*/
.box_response {
    height: calc(100vh - 240px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
    /* กันตัวอักษรชน scrollbar */
}

.response-list {
    margin: 5px;
}

.label-response {
    display: inline-block;
    min-width: 60px;
    padding: 10px 15px;
    text-align: center;
    font-weight: bold;
}

.choice-box {
    display: inline-block;
    margin-right: 10px;
}

/* ซ่อน radio จริง */
.choice-radio {
    display: none;
}

/* กล่องตัวเลือก */
.choice-label {
    display: inline-block;
    min-width: 45px;
    padding: 10px 14px;
    border: 2px solid #ccc;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    background: #fff;
    transition: 0.2s;
    font-weight: 500;
    color: #000000;
}

/* ตอน hover */
.choice-label:hover {
    border-color: #4e73df;
}

/* ตอนเลือกแล้ว */
.choice-radio:checked+.choice-label {
    background: #4e73df;
    color: #fff;
    border-color: #4e73df;
    box-shadow: 0 0 0 2px rgba(78, 115, 223, 0.2);
}

.action-choose {
    background: rgba(78, 115, 223, 0.12);
    outline: 2px solid rgba(78, 115, 223, 0.25);
}

.locked-input {
    pointer-events: none;
    background-color: #f5f5f5;
}


.container-side {
    border: 1px solid gray;
    border-radius: 8px;
    padding: 1rem;
    background-color: #fff;
    min-height: 100vh;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.col-divider {
    border-right: 1px solid gray;
    min-height: auto;

}

.lesson-sidebar {
    width: 100%;
    /* background-color: #f8f9fa; */
    /* border-right: 1px solid #dee2e6; */
    padding: 0.5rem;
}

.lesson-header .nav-link {
    cursor: pointer;
    font-weight: 600;
    color: #212529;
    border-radius: 0.5rem;
}

.lesson-header .nav-link:hover {
    background-color: #e9ecef;
}

.lesson-child>.nav-link {
    font-size: 0.9rem;
    padding-left: 1.5rem;
}

.video-list .video-link {
    font-size: 0.88rem;
    color: #495057;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    align-items: center !important;
}

.video-list .video-link:hover {
    /* background-color: #dee2e6; */
    color: #000;
    text-decoration: none;
}

.video-list .video-link.active {
    background-color: #0d6efd;
    color: #fff;
}

.toggle-icon {
    transition: transform 0.2s ease;
}

/* ค่าเริ่มต้น = ปิด */
.lesson-header .toggle-icon {
    transition: transform 0.2s ease;
}

/* ถ้า collapse เปิดอยู่ */
.lesson-header a[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
}

/* ทำให้ nav-link ทุกตัวใน sidebar เป็น flex */
.lesson-item .nav-link {
    display: flex !important;
    /* align-items: flex-start !important; */
    gap: 8px;
}

/* ไอคอลไม่ให้โดนบีบ */
.lesson-item .nav-link i {
    flex-shrink: 0;
    margin-top: 4px;
}

/* ตัวข้อความ */
.lesson-item .nav-link {
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
}

.exam-card {
    display: flex;
    flex-direction: column;
}

.exam-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    /* ทำให้ body ขยายเต็มความสูง */
}

.exam-card-actions {
    margin-top: auto;
    /* ดันปุ่มลงล่างสุด */
}

#toggleSidebarBtn {
    display: none;
}

.code-check {
    /* background-color: #f8f9fa; */
    /* เทาอ่อนสะอาดตา */
    border: 2px solid rgb(255, 255, 255);
    /* เส้นกรอบสีหลัก */
    border-radius: 12px;
    /* มุมโค้ง */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    /* เงานุ่มขึ้น */
    padding: 10px;
}

.content-course {
    padding: 15px;
    background-color: #f8f9fa;
    /* เทาอ่อนสะอาดตา */
    border: 2px solid rgb(255, 255, 255);
    /* เส้นกรอบสีหลัก */
    border-radius: 12px;
    /* มุมโค้ง */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    /* เงานุ่มขึ้น */
}

.carousel-item,
.carousel-item img {
    height: 50vh;
    object-fit: cover;
}

.img-height {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    width: 100%;
    height: auto;
    max-height: 85vh;
}

.px-n2 {
    padding: 70px 15px 20px;
}

.fix-col {
    height: 85vh;
    display: flex;
}

.swal-top-title {
    margin-bottom: 15px;
    font-weight: bold;
    font-size: 24px;
    text-align: center;
}

.swal-custom-img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.responsive-swal {
    max-width: 90vw !important;
}

/* Layout หลัก */
.edu-layout {
    display: flex;
    /* min-height: 100vh; */
    background: #f4f6f9;
    border-radius: 12px;
}

/* Sidebar */
.edu-panel {
    width: 300px;
    background: #ffffff;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.edu-panel-header {
    padding: 20px;
    font-weight: 600;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}

.edu-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.edu-group {
    border-bottom: 1px solid #f0f0f0;
}

.edu-group-title {
    padding: 15px 20px;
    font-weight: 600;
    cursor: pointer;
    word-break: break-all;
}

.edu-submenu {
    list-style: none;
    padding: 0 0 10px 0;
}

.edu-link {
    display: block;
    padding: 10px 30px;
    text-decoration: none;
    color: #444;
    font-size: 14px;
    transition: 0.2s;
    word-break: break-all;
}

.edu-link:hover {
    background: #eef3ff;
    color: #2b6cff;
}

.edu-link.active {
    background: #e0ebff;
    color: #2b6cff;
    border-left: 3px solid #2b6cff;
}

/* Content */
.edu-content {
    flex: 1;
    padding: 40px;
    min-height: auto;
}

/* Mobile top bar */
.edu-mobile-bar {
    display: none;
}

.edu-group-title,
.edu-link {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* ===== Sidebar Container ===== */
.course-nav {
    width: 300px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
    padding: 15px 0;
    overflow: hidden;
}

/* ===== Section Header ===== */
.course-nav-section>.nav-link {
    font-weight: 600;
    padding: 14px 20px;
    color: #222;
    border-radius: 12px;
    margin: 4px 10px;
    transition: 0.25s ease;
}

/* .course-nav-section>.nav-link:hover {
    background: #f3f6ff;
    color: #2b6cff;
} */
.course-nav-section>.nav-link:hover,
.course-nav-section>.nav-link:not(.collapsed) {
    background: #f3f6ff;
    color: #2b6cff;
}

/* ===== Arrow animation ===== */
.toggle-icon {
    transition: transform 0.3s ease;
}

.nav-link[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
}

/* ===== Collapse content ===== */
.course-nav-body {
    padding-bottom: 10px;
}

/* ===== Nested group title ===== */
.course-nav-group>.nav-link {
    font-size: 14px;
    color: #6c757d;
    padding: 8px 20px;
}

/* ===== Video links ===== */
.video-link {
    font-size: 14px;
    padding: 10px 25px;
    border-radius: 10px;
    margin: 2px 10px;
    transition: 0.2s ease;
    color: #444;
    display: flex;
    align-items: center;
    /* gap: 8px; */

}

.video-link:hover {
    background: #eef3ff;
    color: #2b6cff;
}

.video-link.active {
    background: #e0ebff;
    color: #2b6cff;
    font-weight: 600;
    border-left: 3px solid #2b6cff;
}

/* ===== Prevent overflow ===== */
.course-nav .nav-link,
.video-link {
    word-break: break-word;
    overflow-wrap: break-word;
}

.full-width-card {
    width: 100%;
    padding: 20px 24px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.card-button {
    width: 220px;
    height: 220px;
    background-color: #e6e6e6;
    border-radius: 28px;
    box-shadow:
        8px 8px 16px rgba(0, 0, 0, 0.15),
        -4px -4px 10px rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    transition: all 0.25s ease;
    cursor: pointer;
}

.card-button img {
    width: 80px;
    margin-bottom: 12px;
}

.card-button span {
    font-size: 20px;
    font-weight: bold;
    color: #000;
}

.card-button:hover {
    transform: translateY(-6px);
    box-shadow:
        12px 12px 22px rgba(0, 0, 0, 0.2),
        -6px -6px 14px rgba(255, 255, 255, 0.9);
}

.content-course-2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #f8f9fa;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    padding: 15px;
    transition: 0.25s ease;
    cursor: pointer;
}

/* hover effect */
.content-course-2:hover {
    background: #e6e6e6;
    transform: translateY(-2px);
}

/* ซ้าย */
.course-icon {
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, #3b5bff, #364fc7);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 18px;
    flex-shrink: 0;
}

.course-icon-2 {
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, #00B649, #00A844);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 18px;
    flex-shrink: 0;
}

.course-icon,
.course-icon-2 i {
    font-size: 32px;
    color: #fff;
}

/* กลาง */
.course-text {
    flex: 1;
}

.course-title {
    font-size: 20px;
    font-weight: 600;
    color: #111;
}

.course-subtitle {
    font-size: 16px;
    color: #666;
    margin-top: 4px;
}

/* ขวา */
.course-download {
    font-size: 24px;
    color: #777;
    margin-left: 15px;
    transition: 0.2s;
}

.course-next {
    font-size: 24px;
    color: #777;
    margin-left: 15px;
    transition: 0.2s;
}

.content-course-2:hover .course-download {
    color: #3b5bff;
}

.content-course-2:hover .course-next {
    color: #00B649;
}

.score-wrapper {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

.score-card {
    width: 900px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.score-header {
    background: #f3f3f3;
    padding: 20px 25px;
    border-bottom: 1px solid #ddd;
}

.score-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.score-header p {
    margin: 5px 0 0;
    font-size: 14px;
    color: #666;
}

.score-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.score-table th,
.score-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #e5e5e5;
    text-align: center;
}

.score-table th {
    background: #e9e9e9;
    font-weight: 600;
}

.text-left {
    text-align: left !important;
}

.indent {
    padding-left: 35px !important;
}

.row-main {
    background: #1f78c8;
    color: #fff;
    font-weight: 600;
}

.row-section {
    background: #9ec3e6;
    font-weight: 600;
}


/* ============================= */
/* Tablet & Mobile */
@media (max-width: 1200px) {

    .responsive-swal {
        width: 95vw !important;
        margin: 0 !important;
    }

    .col-mg-12 {
        flex: 0 0 auto;
        width: 100%;
        max-width: 100%;
    }

    .col-divider {
        border-right: none;
        min-height: auto;
    }

    .container-side {
        min-height: auto;
        padding: 0.75rem;
    }

    .lesson-sidebar {
        max-height: 300px;
        /* จำกัดความสูง */
        overflow-y: auto;
        border-bottom: 1px solid #dee2e6;
        margin-bottom: 1rem;
    }

    .lesson-header .nav-link {
        font-size: 0.95rem;
    }

    .video-list .video-link {
        font-size: 0.85rem;
    }

    #lessonSidebar {
        display: none;
        transition: all 0.3s ease;
    }

    #lessonSidebar.show {
        display: block;
    }

    #toggleSidebarBtn {
        display: inline-block;
    }

    .fix-col {
        height: 100vh;
    }

    .img-height {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        border-radius: 12px;
        width: 100%;
        max-height: 100vh;
        height: auto;
    }

    .edu-layout {
        flex-direction: column;
        border-radius: 12px;
        min-height: auto;
    }

    .edu-mobile-bar {
        display: block;
        padding: 15px;
        background: #2b6cff;
    }

    .edu-menu-toggle {
        background: white;
        border: none;
        padding: 10px 16px;
        border-radius: 8px;
        font-weight: 600;
        cursor: pointer;
    }

    .edu-panel {
        max-height: 0;
        overflow: hidden;
        transition: 0.3s;
    }

    .edu-panel.open {
        max-height: 800px;
        overflow-y: auto;
    }

    .edu-content {
        padding: 20px;
        min-height: auto;
    }

    .course-nav {
        width: 100%;
        border-radius: 14px;
        max-height: 0;
        transition: max-height 0.4s ease;
    }

    .course-nav.show {
        max-height: 800px;
        overflow-y: auto;
    }

    .card-button {
        width: 180px;
        height: 180px;
    }

    /*video-js*/
    .video-js {
        width: 1000px;
        height: 500px;
    }

    .video-js,
    .video-js * {
        touch-action: none;
    }

    .video-js .vjs-control-bar {
        touch-action: auto;
    }

    /* ให้ปุ่มกดได้ */
    .video-js .vjs-tech {
        transform-origin: center center;
    }

    /*video-js*/
}