.confirm-button-class {
    font-size: large !important;
}
.swal2-title,.swal2-title.title-class {
    font-weight: 500!important;
    color: #000!important;
    font-size: 40px!important;
    line-height: 1!important;
 }
.icon-class {
    font-size: 15px !important;
}

.swal2-popup{
    width: 100%!important;
    max-width: 675px!important;
    padding: 40px!important;
}

.confirm-button-class,.swal2-confirm,.swal2-cancel{
    width: 100%;
    max-width: 200px;
    margin: 0 7.5px;
    padding: 7px 25px;
    background: #ff0000!important;
    color: #fff!important;
    display: flex;
    text-transform: uppercase!important;
    line-height: 1.3;
    position: relative;
    align-items: center;
    justify-content: center;
    font-size: 23px !important;
    height: 56px;
    border-radius: .2em;
    transition: all 0.3s;
    font-weight: 300!important;
}
.swal2-cancel{
    background: #000!important;
}
.swal2-icon.swal2-success{
    border-color: transparent!important;
}
.swal2-icon,.swal2-icon.swal2-success .swal2-success-ring,.swal2-icon.swal2-success{
    
    border-width: 3px!important;
}
.swal2-icon{
    width: 120px!important;
    height: 120px!important;
    
}
.swal2-icon:before{
    font-size: 100px!important;
    line-height: .8!important;
    height: 100%!important;
    font-weight: 300;
}
.swal2-icon.swal2-info {
  border-color: #2196f3!important;
  color: #2196f3!important;
}
.swal2-success{
    width: 120px!important;
    height: 120px!important;
}
.swal2-icon.swal2-success .swal2-success-ring{
    border-color: #35b74a!important;
}

.swal2-icon.swal2-success [class^="swal2-success-line"][class$="tip"] {
    top: 70px !important;
    left: 32px !important;
    width: 25px !important;
}

.swal2-icon.swal2-success [class^="swal2-success-line"] {
    height: 4px!important;
    background-color: #41af4c!important;
}

.swal2-icon.swal2-success [class^="swal2-success-line"][class$="long"] {
    top: 59px !important;
    right: 22px !important;
    width: 54px !important;
}
.swal2-icon.swal2-error{
    border-color: #d5121f !important;
}
.swal2-icon.swal2-warning{
    border-color: #d5121f !important;
    color: #d5121f !important;
}
.swal2-icon.swal2-error [class^="swal2-x-mark-line"]{
    top: 56px!important;
    width: 84%!important;
    background-color: #d5121f !important;
    border-color: #d5121f !important;
    color: #d5121f !important;
}
.swal2-icon.swal2-error [class^="swal2-x-mark-line"][class$="left"] {
    left: 15px !important;
    width: 75% !important;
    height: 4px;
}
.swal2-icon.swal2-error [class^="swal2-x-mark-line"][class$="right"] {
    right: 15px !important;
    height: 4px;
    width: 75% !important;
}

.swal2-content{
    font-size: 25px!important;
    line-height: 1;
    color: #000!important;
    font-weight: 400!important;
}
.ui-autocomplete {
    position: absolute;
    z-index: 9999 !important;
    background: #fff;
    border: 1px solid #ccc;
    list-style: none;
    padding: 10px;
    width: 200px;
}
.ui-menu-item {
    cursor: pointer;
    padding: 5px;
}
.ui-menu-item:hover {
    background: #f0f0f0;
}
.loading-state {
    background-image: url('/html/images/loading.gif'); /* คุณต้องมีไฟล์ gif เล็กๆ */
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}
/* สถานะกำลังตรวจสอบ (Loading) */
.serial-checking {
    border: 2px solid #ffc107 !important; /* สีเหลืองทองเด่นๆ */
    background-color: #fffdf0;
}

/* สถานะผิดพลาด (Error - เช่นรหัสซ้ำ) */
.serial-error {
    border: 2px solid #dc3545 !important; /* สีแดง */
    animation: shake 0.3s linear;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
    100% { transform: translateX(0); }
}

/* ปรับแต่งกล่องอัปโหลดหลักให้ยืดหยุ่นและรองรับเนื้อหาภายใน */
.article-upload-box {
    cursor: pointer;
    border: 2px dashed #9a9a9a;
    background-color: #f9f9f9;
    border-radius: 14px;
    padding: 30px;
    transition: all 0.3s ease;
    display: block;
    min-height: 250px;
}

/* เพิ่มเอฟเฟกต์เมื่อมีการลากไฟล์มาอยู่เหนือกล่องอัปโหลด */
.article-upload-box.drag-over {
    border: 2px dashed #e30613 !important;
    background-color: rgba(227, 6, 19, 0.05) !important;
}
.article-upload-box.drag-over .upload-placeholder strong,
.article-upload-box.drag-over .upload-placeholder i {
    color: #e30613 !important;
}

/* จัดการส่วนพรีวิวให้เป็น Grid ภายในกล่องอัปโหลด */
.upload-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    width: 100%;
}

.preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    height: 120px;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-single-preview {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(227, 6, 19, 0.9);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
}
.remove-single-preview:hover {
    background: #b2000b;
}

/* กำหนดสไตล์เมื่อแท็กแนะแนวถูกเลือก (Active ไฮไลต์สีแดง) */
.inner-tag-item.active {
    background-color: #e30613 !important;
    color: #ffffff !important;
    border-color: #e30613 !important;
}
.inner-tag-item.active .color-ci {
    color: #ffffff !important;
}

.swal2-styled.swal2-confirm{
    height: 50px!important;
    border-radius: 10px!important;
    background-color: #d5121f!important;
    font-size: 28px!important;
    font-weight: 500!important;
    padding: 0;
}

@media (max-width: 991.98px) {
    .swal2-popup {
        padding: 20px !important;
    }
}