/* Styling for the checkbox and label to hide them */
#spinner-form {
    display: none;
}

.spinner-spin {
    position: relative;
    cursor: pointer;
    display: inline-block;
    width: 20px;
    height: 18px;
}

/* Base styles for all spinner lines */
.spinner {
    position: absolute;
    height: 3px;
    background-color: #333; /* Change color as needed */
    transition: all 0.3s ease-in-out;
}

.spinner.horizontal {
    width: 20px;
    top: 7px;
}

/* Specific styling for the top and bottom lines */
.spinner.diagonal.part-1 {
    width: 20px;
    top: 0;
}

.spinner.diagonal.part-2 {
    width: 20px;
    top: 14px;
}

/* Animation when the checkbox is checked */
#spinner-form:checked ~ .spinner-spin .spinner.part-1 {
    transform: rotate(135deg);
    top: 7px;
}

#spinner-form:checked ~ .spinner-spin .spinner.horizontal {
    opacity: 0;
    transform: scale(0);
}

#spinner-form:checked ~ .spinner-spin .spinner.part-2 {
    transform: rotate(-135deg);
    top: 7px;
}



/* Styling for the sidebar menu */
#slidemenu {
    position: fixed;
    top: 0;
    /* เปลี่ยน left เป็น right */
    right: 0;
    width: 250px;
    height: 100%;
    background-color: #333;
    color: #fff;
    padding-top: 60px;
    overflow-y: auto;
    /* เปลี่ยน translateX เป็น 100% เพื่อซ่อนไปทางขวา */
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    z-index: 999;
}

/* Class to show the menu */
#slidemenu.active {
    /* เปลี่ยนเป็น translateX(0) เพื่อเลื่อนกลับเข้ามา */
        transform: translateX(0);

}

/* Styling for the list items */
#slidemenu .nav__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#slidemenu .nav__list li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#slidemenu .nav__list li label,
#slidemenu .nav__list li a {
    display: block;
    padding: 15px 20px;
    color: #fff;
    text-decoration: none;
}

#slidemenu .nav__list li label:hover,
#slidemenu .nav__list li a:hover {
    background-color: #555;
}

/* Styling for the dropdown sub-menus */
.group-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: none; /* Hide sub-menus by default */
    background-color: #444; /* A slightly different color for contrast */
}

.group-list li a {
    padding-left: 40px !important;
}

/* CSS for dropdown animation (based on the JS you provided) */
#slidemenu .nav__list li.expanded .group-list {
    display: block; /* Show sub-menu when parent has 'expanded' class */
}

/* ซ่อนเมนูย่อยตามค่าเริ่มต้น */
.group-list {
    display: none;
}

/* ซ่อนเมนู sidebar ทางขวาของจอ (ถ้าเมนูมาทางขวา) */
#slidemenu {
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

/* แสดงเมนูเมื่อมี class active */
#slidemenu.active {
    transform: translateX(0);
}

/* Style for the hamburger button container */
.spinner-spin {
    position: relative;
    cursor: pointer;
    display: inline-block;
    /* เพิ่มขนาดโดยการขยาย width และ height */
    width: 30px; /* เพิ่มจาก 20px */
    height: 27px; /* เพิ่มจาก 18px */
}

/* Base styles for the hamburger lines */
.spinner {
    position: absolute;
    /* เพิ่มความหนาของเส้น */
    height: 4px; /* เพิ่มจาก 3px */
    background-color: #333; /* Color of your lines */
    transition: all 0.3s ease-in-out;
}

.spinner.horizontal {
    /* ปรับความกว้างให้สอดคล้องกับ width ของ container */
    width: 30px;
    top: 11.5px; /* ปรับตำแหน่งเส้นกลาง */
}

/* Styles for the top and bottom lines */
.spinner.diagonal.part-1 {
    width: 30px;
    top: 0;
}

.spinner.diagonal.part-2 {
    width: 30px;
    top: 23px; /* ปรับตำแหน่งเส้นล่าง */
}

/* Animation when the checkbox is checked */
#spinner-form:checked ~ .spinner-spin .spinner.part-1 {
    transform: rotate(135deg);
    top: 11.5px; /* ปรับตำแหน่งเส้นบน */
}

#spinner-form:checked ~ .spinner-spin .spinner.horizontal {
    opacity: 0;
    transform: scale(0);
}

#spinner-form:checked ~ .spinner-spin .spinner.part-2 {
    transform: rotate(-135deg);
    top: 11.5px; /* ปรับตำแหน่งเส้นล่าง */
}

@media (min-width: 1025px) {
    /* Hide the hamburger button on screens larger than 1024px */
    .navbar-toggle {
        display: none;
    }
}