/* =======================================================
    CSS ส่วนกลาง (คงเดิมตามลำดับโครงสร้างหลัก)
	./assets/css/hotspot.css
   ======================================================= */

/* [PART 1] BODY & GLOBAL STYLES */
	body{
		background: -webkit-linear-gradient(45deg, rgba(255,255,255,0.2) 25%, rgba(0,0,0,0) 25%, rgba(0,0,0,0) 50%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.2) 75%, rgba(0,0,0,0) 75%, rgba(0,0,0,0) 0), rgba(242,242,242,1);
		background: -moz-linear-gradient(45deg, rgba(255,255,255,0.2) 25%, rgba(0,0,0,0) 25%, rgba(0,0,0,0) 50%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.2) 75%, rgba(0,0,0,0) 75%, rgba(0,0,0,0) 0), rgba(242,242,242,1);
		background: linear-gradient(45deg, rgba(255,255,255,0.2) 25%, rgba(0,0,0,0) 25%, rgba(0,0,0,0) 50%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.2) 75%, rgba(0,0,0,0) 75%, rgba(0,0,0,0) 0), rgba(242,242,242,1);
		background-position: auto auto;
		-webkit-background-origin: padding-box;
		background-origin: padding-box;
		-webkit-background-clip: border-box;
		background-clip: border-box;
		-webkit-background-size: 50px 50px;
		background-size: 50px 50px;
		font-family: 'Roboto' !important;
		font-weight:100;
	}
	.alertswl{
	font-family: Roboto;
	}
      .demo { position: relative; }
      .demo i {
        position: absolute; bottom: 10px; right: 24px; top: auto; cursor: pointer;
      }
		
			.nmpd-grid {border: none; padding: 10px;}
			.nmpd-grid>tbody>tr>td {border: none;}

/* [PART 2] INPUTS & CHECKBOXES */			
			.qtyInput {display: block;
			  width: 100%;
			  padding: 12px 30px;
			  color: #555;
			  background-color: #6b687f;
			  border: 1px solid #ccc;
			  border-radius: 4px;
			  -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
			  box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
			  -webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;
			  -o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
			  transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
			}
		
	input.largerCheckbox {
        width: 18px;
        height: 18px;
	display: inline-block; 
    vertical-align: middle;
      }	
	  
.form-check-input {
    cursor: pointer;
}	 
.swal2-container {
    backface-visibility: hidden;
    will-change: opacity;
} 

/* [PART 3] TABLE HEADERS (DATATABLES) */
    #example thead th, #example1 thead th, #example2 thead th, #example3 thead th {
        font-size: 0.85rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        padding: 10px 5px;
        color: var(--bs-dark);
        border-top: none;
    }
	
/* [PART 4] GLASSMORPHISM EFFECT */
.glass-popup {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(8px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(8px) saturate(150%) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    border-radius: 25px 5px 25px 5px !important; 
    box-shadow: 0 10px 40px 0 rgba(0, 0, 0, 0.1) !important;
}

.glass-popup .swal2-title, 
.glass-popup .swal2-html-container {
    color: #1a1a1a !important;
    text-shadow: 0 0 1px rgba(255,255,255,0.5);
}

/* [PART 5] BUTTON CURVE STYLES */
.btn-curve-strong {
    border-radius: 15px 2px 15px 2px !important;
    font-weight: 600 !important;
    padding: 10px 30px !important;
    transition: all 0.2s ease-in-out;
    border: none !important;
}
.btn-curve-strong:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}
.btn-curve-alink {
    border-radius: 15px 2px 15px 2px !important;
    transition: all 0.2s ease-in-out;
}
.btn-curve-alink:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    cursor: pointer;
}

/* [PART 6] SWAL ACTIONS & COLORS */
:root {
    --sw-primary: #007bff;
    --sw-secondary: #6c757d;
    --sw-success: #28a745;
    --sw-danger: #dc3545;
    --sw-warning: #ffc107;
    --sw-info: #17a2b8;
}
.swal-btn-primary { background-color: var(--sw-primary) !important; }
.swal-btn-secondary { background-color: var(--sw-secondary) !important; }
.swal-btn-success { background-color: var(--sw-success) !important; }
.swal-btn-danger { background-color: var(--sw-danger) !important; }

.glass-popup .swal2-actions {
    width: 100% !important;
    border-top: 1px solid rgba(0, 0, 0, 0.08) !important; 
    margin: 1.25em 0 0 0 !important; 
    padding: 1.5rem 1rem 1.25rem 1rem !important; 
    gap: 10px; 
}
.glass-popup .swal2-html-container {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}
.glass-popup .swal2-icon {
    border-width: 3px !important;
    margin-top: 1.5rem !important;
}
.glass-popup .btn-curve-strong {
    margin-top: 0 !important; 
}
.label-required::after {
    content: " *";
    color: var(--sw-danger); 
    font-weight: bold;
    margin-left: 4px;
}

/* [PART 7] NAV TABS & PAGINATION */
    .nav-tabs .nav-link {
        background: transparent !important;
        transition: all 0.2s;
        border-radius: 0;
    }
    .nav-tabs .nav-link.active {
        background: transparent !important;
        border-bottom: 3px solid #0d6efd !important;
        color: #0d6efd !important;
    }
    .nav-tabs .nav-link:hover:not(.active) {
        background: rgba(0,0,0,0.03) !important;
    }
	
/* [PART 8] DSELECT CUSTOM STYLES */
.btn-curve-dselect {
    border-radius: 15px 2px 15px 2px !important;
    transition: all 0.2s ease-in-out;
}
.dselect-wrapper .form-select.btn-curve-dselect {
    border-radius: 15px 2px 15px 2px !important;
    border: 1px solid #dee2e6 !important;
    background-color: #fff !important;
    min-height: 40px !important; 
    font-size: 0.95rem !important; 
    font-weight: 500;
}
.dselect-wrapper .dropdown-menu {
    z-index: 100000 !important; 
    border-radius: 2px 15px 2px 15px !important;
    border: 1px solid rgba(0,0,0,0.15) !important;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3) !important;
    padding: 8px;
    background: #ffffff !important;
}
.dselect-wrapper .dropdown-item {
    white-space: normal !important; 
    word-break: break-word;          
    margin: 2px 0;
    border-radius: 8px 2px 8px 2px !important; 
    padding: 5px 12px !important; 
    font-size: 0.8rem !important; 
    line-height: 1.4;
    color: #444;
}
.dselect-wrapper .dropdown-item:hover {
    background-color: rgba(13, 110, 253, 0.1) !important;
    color: #0d6efd !important;
}
.dselect-wrapper .dropdown-menu input.form-control {
    border-radius: 10px 2px 10px 2px !important;
    margin-bottom: 6px;
    padding: 8px 10px !important;
    font-size: 0.85rem;
}
.card, .iq-card, .col-md-4, .row {
    overflow: visible !important; 
}
.dselect-items {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    max-height: 280px;
}

/* [PART 9] TABLE & SEARCH CUSTOM */
input[type="search"], 
.dataTables_filter input, 
.form-control-sm {
    border-radius: 15px 2px 15px 2px !important;
    border: 1px solid #dee2e6 !important;
    padding: 5px 15px !important;
    transition: all 0.2s;
}
.dataTables_length select, 
select.form-select-sm {
    border-radius: 10px 2px 10px 2px !important;
    border: 1px solid #dee2e6 !important;
    padding: 4px 25px 4px 10px !important;
    cursor: pointer !important; 
    transition: all 0.2s;
}
.dropdown-menu {
    border-radius: 2px 15px 2px 15px !important; 
    border: 1px solid rgba(0,0,0,0.15) !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1) !important;
    padding: 8px !important;
    overflow: hidden !important; 
}
.dropdown-item, 
.dselect-wrapper .dropdown-item {
    border-radius: 10px 2px 10px 2px !important; 
    margin: 3px 0 !important; 
    padding: 8px 15px !important; 
    cursor: pointer !important; 
    transition: all 0.2s ease-in-out !important;
    display: block;
    width: 100%;
}
.dropdown-item:hover, 
.dropdown-item:focus,
.dselect-wrapper .dropdown-item:hover {
    background-color: rgba(13, 110, 253, 0.1) !important; 
    color: #0d6efd !important;
    transform: translateX(5px) !important; 
    cursor: pointer !important; 
}
.dropdown-item.active, 
.dselect-wrapper .dropdown-item.active {
    background-color: #0d6efd !important;
    color: #fff !important;
}
.pagination .page-link {
    margin: 0 2px;
    border-radius: 8px 2px 8px 2px !important;
    cursor: pointer !important; 
    transition: all 0.2s;
    border: 1px solid #dee2e6 !important;
    color: #0d6efd;
}
.pagination .page-link:hover {
    background-color: #0d6efd !important;
    color: #fff !important;
    transform: translateY(-2px);
}

/* [PART 10] CLICKABLE STAT CARDS */
.btn-curve-clickable { 
    border-radius: 15px 2px 15px 2px !important;
    transition: all 0.2s ease-in-out;
    border: 1px solid #f0f0f0 !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background-color: #ffffff;
}
.shadow-card-custom {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.02) !important;
}
.shadow-active {
    box-shadow: 0 8px 15px rgba(13, 110, 253, 0.15) !important;
    background-color: #f1f7ff !important; 
    border: 1.5px solid #0d6efd !important;
}
.btn-curve-clickable:hover {
    transform: translateY(-2px) !important; 
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08) !important;
    border-color: #0d6efd !important;
    z-index: 5;
}
.lh-1 { line-height: 1.2 !important; }

@media (min-width: 992px) {
    .btn-curve-clickable {
        min-height: 68px !important; 
        margin-bottom: 0px !important;
    }
    .btn-curve-clickable .card-body {
        padding: 4px 8px !important; 
    }
    .btn-curve-clickable .h4 {
        font-size: 1.15rem !important; 
        margin-bottom: 0 !important;
    }
    .btn-curve-clickable .mt-1 {
        margin-top: 1px !important;
    }
}

@media (max-width: 576px) {
    .btn-curve-clickable {
        min-height: 82px !important; 
        margin-bottom: 8px;
    }
    .btn-curve-clickable .h4 { 
        font-size: 1.1rem !important; 
    }
    .btn-curve-clickable .fw-bold {
        font-size: 0.75rem !important;
    }
    .btn-curve-clickable span[style*="font-size: 0.95rem"] {
        font-size: 0.85rem !important;
    }
}
.row.g-1.mb-1, .row.g-0.mb-0, .row.g-2.mb-2 {
    margin-bottom: 0px !important; 
    padding-bottom: 0px !important;
}

/* [PART 11] NAVIGATION TABS & FILTERS */
.btn-curve-navtabs {
    border-radius: 15px 2px 15px 2px !important;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1); 
    background-color: #f8f9fa !important;
    color: #495057 !important;
    border: 1px solid #dee2e6 !important;
    margin-right: 0px !important;
    position: relative;
    z-index: 1;
}
.nav-tabs .nav-item .nav-link.btn-curve-navtabs.active {
    background-color: #0d6efd !important;
    color: #ffffff !important;
    border: 1px solid #0d6efd !important;
    border-bottom: 3px solid #dc3545 !important; 
    transform: translateY(-7px) !important;
    box-shadow: 0 10px 20px rgba(220, 53, 69, 0.4) !important;
    display: block !important;
    z-index: 5;
}
.btn-curve-navtabs:hover {
    background-color: #e2e6ea !important;
    color: #212529 !important; 
    transform: translateY(-1px) scale(1.02); 
    cursor: pointer;
    z-index: 10;
}
.nav-tabs .nav-item .nav-link.btn-curve-navtabs.active:hover {
    background-color: #0b5ed7 !important;
    border-bottom: 3px solid #dc3545 !important; 
    transform: translateY(-1px) scale(1.04) !important; 
    box-shadow: 0 15px 25px rgba(220, 53, 69, 0.6) !important;
    color: #ffffff !important;
}
.filter-open .filter-toggle-container {
    position: absolute;
    right: 0px;    
    top: -30px;    
    z-index: 10;
}
.filter-open .btn-filter-custom {
    padding: 1px 8px; 
    font-size: 11px;
    border-radius: 20px;
    opacity: 0.9; 
}
.filter-open .btn-filter-custom:hover { opacity: 1; }

@keyframes fadeInUpCustom {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.content-fade-in {
    animation: fadeInUpCustom 0.5s ease-out forwards;
}

/* [PART 12] TABLE DETAILS & SCROLL FIXES */
.progress-blue { background-color: #0d6efd !important; }
.progress-green { background-color: #198754 !important; }
.progress-warning { background-color: #ffc107 !important; }
.progress-red { background-color: #dc3545 !important; }

.user-detail-table {
    background: #f8fafc;
    border-radius: 12px;
    padding: 15px;
    border: 1px solid #f1f5f9;
}
.detail-row {
    border-bottom: 1px dashed #dee2e6;
    padding: 6px 0;
    display: flex;
    justify-content: space-between;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { font-size: 0.8rem; color: #6c757d; }
.detail-value { font-size: 0.85rem; font-weight: 600; color: #212529; }
.value-username { font-size: 1rem; color: #d63384; }

@media (max-width: 767.98px) {
    .detail-col-left {
        border-right: 1px solid #dee2e6 !important;
        border-bottom: 1px dashed #dee2e6 !important;
        margin-bottom: 10px;
        padding-bottom: 10px;
    }
}

.swal2-container { z-index: 999999 !important; }
.swal2-popup input { pointer-events: auto !important; position: relative; z-index: 1000000; }

#example_wrapper, #example1_wrapper, #example2_wrapper, #example3_wrapper {
    padding-bottom: 50px !important;
    position: relative;
}
.dataTables_scrollBody {
    margin-bottom: 25px !important;
    padding-bottom: 5px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    border-bottom: 1px solid #dee2e6 !important;
}
.table-responsive {
    padding-bottom: 20px !important; 
    margin-bottom: 10px !important;
    overflow-x: auto !important;
}

.dataTables_wrapper .dataTables_paginate {
    margin-top: 25px !important;
    padding-top: 10px !important;
    border-top: 1px solid #f1f1f1;
}

.back-to-top {
    position: fixed !important;
    bottom: 30px !important;
    right: 30px !important;
    z-index: 9999 !important;
    width: 50px !important;
    height: 50px !important;
    background-color: #0d6efd !important;
    color: #ffffff !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}




#mikrotik-task-wrapper {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 300px;
    z-index: 9999;
    display: flex;
    flex-direction: column; /* ให้มันต่อกันลงมา */
    gap: 10px; /* ระยะห่างระหว่างงาน */
}


/* แต่งกล่อง Fnon ให้เป็นกระจกฝ้าเหมือน Swal */
.fnon-hint-item {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 15px 2px 15px 2px !important; /* ทรงเดียวกับปุ่มพี่ */
    box-shadow: 0 8px 20px rgba(0,0,0,0.1) !important;
    padding: 15px !important;
}

/* แต่งปุ่มปิดของ Fnon */
.fnon-hint-close {
    color: #888 !important;
    font-size: 20px !important;
}




/* บังคับความกว้างกล่อง Fnon ให้กว้างขึ้น */
.fnon-hint-item {
    width: 350px !important; /* ปรับความกว้างตามใจชอบ */
    max-width: 90vw !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border-radius: 15px 2px 15px 2px !important;
    border-left: none !important; /* เอาเส้นขอบข้างของ Fnon ออก เพราะเราเขียนเองใน HTML แล้ว */
    box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
    padding: 18px 35px 18px 15px !important; /* เพิ่ม Padding ขวาเพื่อหลบกากบาท */
}

/* ปรับปุ่มกากบาทให้เด่น */
.fnon-hint-close {
    display: block !important; /* บังคับให้แสดง */
    color: #000 !important;
    opacity: 0.5;
    font-size: 22px !important;
    top: 10px !important;
    right: 10px !important;
    cursor: pointer !important;
}

.fnon-hint-close:hover {
    opacity: 1;
    color: #dc3545 !important;
}

/* ทำให้กล่องเด้งเรียงกัน (Stack) */
.fnon-hint-container {
    z-index: 1000000 !important;
    display: flex;
    flex-direction: column-reverse; /* ให้อันใหม่ดันอันเก่าขึ้นไป */
    gap: 10px;
}




/* ถาดเก็บการแจ้งเตือน */
#custom-toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000000;
    display: flex;
    flex-direction: column-reverse; /* ให้อันใหม่ดันอันเก่าขึ้นบน */
    gap: 15px;
    pointer-events: none; /* เพื่อให้คลิกทะลุช่องว่างได้ */
}

/* ตัวกล่องแจ้งเตือน */
.my-custom-toast {
    width: 360px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 15px 2px 15px 2px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    padding: 20px;
    position: relative;
    pointer-events: auto; /* ให้คลิกในตัวกล่องได้ */
    animation: toastFadeIn 0.5s ease;
}

@keyframes toastFadeIn {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ปุ่มปิดกากบาท */
.btn-toast-close {
    position: absolute;
    top: 10px;
    right: 12px;
    cursor: pointer;
    font-size: 20px;
    color: #888;
    line-height: 1;
}
.btn-toast-close:hover { color: #dc3545; }


        .pin-dot {
            width: 45px;
            height: 55px;
            line-height: 55px;
            text-align: center;
            font-size: 24px;
            font-weight: bold;
            background-color: #f8f9fa;
            color: #0d6efd;
            transition: all 0.2s;
        }
        .pin-dot.active {
            border-color: #0d6efd !important;
            background-color: #fff;
            box-shadow: 0 0 10px rgba(13, 110, 253, 0.2) !important;
        }
		
/* แถมสไตล์นิดหน่อยให้มันดูแพงขึ้นครับพี่ */
.transition-hover {
    transition: all 0.3s ease;
}
.transition-hover:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08) !important;
}
.btn-white {
    background-color: #fff;
    transition: all 0.2s;
}
.btn-white:hover {
    background-color: #fff5f5;
    border-color: #ffc1c1 !important;
}
.bg-primary-subtle {
    background-color: #ebf4ff !important;
}

.modal-slow-scroll {
    /* 2s คือ 2 วินาที (ยิ่งเลขเยอะ ยิ่งสโลว์) */
    scroll-behavior: auto !important; /* ปิด smooth ปกติ */
    transition: all 2.5s cubic-bezier(0.25, 1, 0.5, 1) !important; 
}

.hover-shadow:hover {
    transform: translateY(-5px);
    transition: 0.3s;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
	cursor: pointer !important;
}