body {
    font-family: 'Kanit', sans-serif;
    background-color: #1a202c; /* Dark background */
}

/* ================== เกี่ยวกับ (รายการเมนูต่างๆ) ================== */
/* Bottom Sheet Animation */
#more-menu-sheet.show {
    opacity: 1;
}
#more-menu-sheet.show > div {
    transform: translateY(0);
}
/* Bottom Sheet 2 คอลัมน์ */
#more-menu-sheet .grid {
    grid-template-columns: repeat(2, 1fr) !important; /* 2 คอลัมน์ */
    gap: 0.5rem !important;
}
.more-menu-card {
    backdrop-filter: blur(10px);
    background: rgba(55, 65, 81, 0.8);
}
.more-menu-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}
/* ปรับสำหรับ Desktop */
@media (min-width: 768px) {
    #more-menu-sheet > div {
        max-width: 500px;
        margin: 0 auto;
        border-radius: 20px 20px 0 0;
    }
}


/* ================== ส่วนของปุ่ม "แท็บเมนู" ================== */

.nav-link-mobile,
.more-menu-card {
    display: flex;
    align-items: center;
    transition: background-color 0.2s, color 0.2s;
    cursor: pointer;
}
/* ปุ่มเมนู */
.nav-link-mobile {
    position: relative;
    justify-content: center;
    
	flex: 1; /* ปรับให้แต่ละปุ่มเท่ากัน */
	min-width: auto; /* ปรับขนาดเล็กอัตโนมัติ */
	max-width: 140px; /* ปรับขนาดกว้างใหญ่ไม่เกินนี้ */
	
    flex-direction: column;
    text-align: center;
    font-size: 0.75rem; /* ใช้แบบเก่า */
    padding: 0.25rem 0.5rem; /* ใช้แบบเก่า py-1 px-2 */
    border-radius: 0.5rem; /* ใช้แบบเก่า rounded-lg */
    background-color: #1f2937; /* ใช้แบบใหม่ */
    color: #d1d5db; /* ใช้แบบใหม่ */
    border: none;
}
/* ไอคอนเมนู */
.nav-link-mobile i {
    font-size: 1.2rem; /* ใช้แบบเก่า text-lg */
    margin-bottom: 0.25rem; /* ใช้แบบเก่า mb-1 */
}
/* ข้อความเมนู */
.nav-link-mobile span {
    font-size: 0.95rem; /* ขนาดของ "เมนูหลัก" */
}
/* เมนูย่อยที่อยู่ใน "เมนูอื่นๆ" */
.more-menu-header {
    padding: 0.26rem;
    border-bottom: 1px solid rgb(55 65 81);
}
.more-menu-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.more-menu-content {
    padding: 0.77rem;
    overflow-y: auto;
    max-height: calc(85vh - 80px);
}
/* Mobile Sheet Menu Card */
.more-menu-card {
    flex-direction: row;
    padding: 0.6rem;
    width: 100%;
    text-align: left;
    border-radius: 0.6rem;
    border: 1px solid #374151;
    background-color: #1f2937;
    color: #d1d5db;
}
#sheet-menu-content {
    margin-top: 0;
	margin-bottom: 0;
}
/* Icon container inside sheet card */
.icon-container {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background-color: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
	margin-right: 0.7rem;
    flex-shrink: 0;
}
/* Icon inside sheet card */
.more-menu-card i {
    color: #ffffff;
    font-size: 0.82rem;
}
/* Text inside sheet card */
.more-menu-card span {
    color: #ffffff;
    font-size: 0.7rem; /* ขนาดของใน "เมนูอื่นๆ" */
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* =======================
   Hover / Active / Current Tab (ใช้แบบใหม่)
   ======================= */
.nav-link-mobile:hover,
.more-menu-card:hover {
    background-color: #374151;
    color: #ffffff;
}
.nav-link-mobile:active,
.more-menu-card:active {
    background-color: #111827;
    color: #ffffff;
}
.nav-link-mobile.active,
.more-menu-card.active {
    background-color: #2d3748; /* อ่อนกว่าสีดำจัด */
    color: #ffffff;
    font-weight: 500 !Important;
}
/* Desktop & Mobile Bottom Menu Container */
.desktop-menu,
.mobile-menu {
    display: flex;
	gap: 0.35rem; /* ช่องว่างระหว่างปุ่ม */
    justify-content: space-between; /* หรือ space-around */
}
/* ปรับให้ "เมนูอื่นๆ" แสดงอยู่หลัง "เมนูหลัก" */
#more-menu-sheet {
    z-index: 40; /* ⬅️ ลดจาก 1000 ให้ต่ำกว่า bottom-nav (z-50) */
}
#bottom-nav {
    z-index: 50; /* ⬅️ กำหนดชัดเจน */
}
/* ปรับตำแหน่งให้เลื่อนขึ้น */
#more-menu-sheet > div {
    transform: translateY(80%); /* ⬅️ เลื่อนขึ้นให้เห็นเมนูหลัก */
    margin-bottom: 60px; /* ⬅️ เว้นที่ให้เมนูหลัก */
}
@media (max-width: 768px) {
    .nav-link-mobile {
    	min-width: 0 !Important;
        max-width: 100% !Important;
    }
	.nav-link-mobile span {
        font-size: 0.73rem; /* ขนาดของ "เมนูหลัก" */
    }
	.more-menu-card.active {
        font-weight: 200 !Important;
    }
}

/* ส่วนของ "ป้ายเมนูใหม่" */
.badge-new-menu,
.badge-new-menu-mobile {
    background-color: #ef4444;
    color: white;
    font-weight: 600;
    animation: pulse-new 1.5s ease-in-out infinite;
}
.badge-new-menu {
    position: absolute;
    top: -8px;
    right: 0;
    font-size: 0.5rem;
    padding: 0.05rem 0.35rem;
    border-radius: 0.25rem;
}
.badge-new-menu-mobile {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.4rem;
    padding: 0.05rem 0.3rem;
    border-radius: 0.25rem;
    flex-shrink: 0;
}
@keyframes pulse-new {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ส่วนของ "ปุ่ม : เพิ่มเติม / ย้อนกลับ" ของเมนู Desktop / จอแนวนอน */
.desktop-nav-btn {
    display: flex;
	
	flex: 1; /* ปรับให้แต่ละปุ่มเท่ากัน */
	/* แต่จะไม่กว้างเกินนี้ */
	min-width: 140px;
    max-width: 140px;
	
	flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.85rem;
    border-radius: 0.5rem;
    background-color: #1f2937;
    color: #d1d5db;
    border: 1px solid #374151;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    height: auto !important;
}

.desktop-nav-btn:hover {
    background-color: #374151;
    color: #ffffff;
    border-color: #4a5568;
}

.desktop-nav-btn i {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.desktop-nav-btn span {
    font-size: 1rem;
}

.desktop-menu-items {
    margin-left: 4px !important;
	margin-right: 4px !important;
}

/* ส่วนของเมนู Desktop จอเล็ก และ จอแนวนอน มือถือ */
@media (min-width: 768px) and (max-width: 1024px) {
    #bottom-nav {
        min-height: auto !important;
        padding: 0.15rem 0 !important;
    }
    #bottom-nav .flex {
        min-height: auto !important;
        padding: 0 !important;
    }
    .desktop-menu {
        min-height: auto !important;
        padding: 0 !important;
        margin: 0 !important;
        gap: 0.2rem !important;
    }
    #desktop-menu-container {
        min-height: 60px !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .desktop-menu-items {
        min-height: auto !important;
        padding: 0 !important;
        margin: 0 !important;
        margin-left: 5px !important;
		margin-right: 5px !important;
		gap: 0.2rem !important;
    }
    .nav-link-mobile {
        padding: 0.05rem 0.25rem !important;
        font-size: 0.9rem !important;
        margin: 0 !important;
		margin-top: 3px !important;
		margin-bottom: 3px !important;
		min-height: 35px !important;
    }
    .nav-link-mobile i {
        font-size: 0.9rem !important;
        margin-bottom: 0.05rem !important;
    }
    .nav-link-mobile span {
        font-size: 0.77rem !important;
    }
    .desktop-nav-btn {
        padding: 0.07rem 0.5rem !important;
    }
    .desktop-nav-btn i {
        font-size: 0.85rem !important;
        margin-bottom: 0 !important;
    }
    .desktop-nav-btn span {
        font-size: 0.74rem !important;
    }
}

/* ===================== */


/* เกี่ยวกับ (การป้องกันการแสดงผลแว็บๆของ Header สำหรับ "หน้าแรก") */
/* ซ่อนเฉพาะ header และ content เท่านั้น */
#main-content-wrapper {
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}
/* แสดงเมื่อโหลดเสร็จ */
.content-loaded #main-content-wrapper {
    opacity: 1;
}

/* ========== เกี่ยวกับ (เนื้อหาแท็บ) ========== */
.main-content {
    padding: 1.5rem;
    background-color: #1F2937;
    border-radius: 0.5rem;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
}
@media (max-width: 768px) {
    .main-content {
        padding: 0.75rem;
    }
}
.sub-content {
    background-color: #1c3545;
    padding: 1rem;
    border-radius: 0.375rem;
}

/* ส่วนของข้อความ "หัวข้อหลัก, หัวข้อย่อย" */
.main-text {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-align: center;
}
.main-text-details {
    color: #9CA3AF;
    font-size: 1rem;
    text-align: center;
}
.sub-text {
    color: #F7F7F7;
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
}


/* ===== เกี่ยวกับ (ปุ่ม "ยืนยัน | อัปเดต | อื่นๆ") ===== */
/* ส่วนของพื้นหลังปุ่ม */
.update-container {
    width: 100%;
    max-width: 100%;
    justify-content: center;
	margin-top: 2.2rem !Important;
}

/* ส่วนของปุ่ม "ยืนยัน | อัปเดต | อื่นๆ" สำหรับ "ด้านนอก Modal" */
.btn-confirm-exc-diamonds {
    background-color: #16a34a;
    color: #ffffff;
    width: 100%;
	padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    transition: background-color 0.3s;
    cursor: pointer;
}
.btn-confirm-exc-diamonds:hover {
    background-color: #15803d;
}

/* ส่วนของปุ่ม "ยืนยัน | อัปเดต | อื่นๆ" สำหรับ "ใน Modal" */
/* ปุ่มการทำงานหลัก */
/* สีเขียว */
.btn-full,
.btn-full-2 {
    padding: 0.75rem 1.5rem;
    height: 2.7rem !important;
    min-height: 2.7rem !important;
    font-size: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
}
.btn-full-2 {
    padding: 0.75rem 1.5rem;
    height: 2.1rem !important;
    min-height: 2.1rem !important;
    border-radius: 5px;
    font-weight: 400;
}
.btn-normal {
    padding: 0.6rem 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
}
.btn-normal:active {
    transform: scale(0.94) !important;
}
@media (max-width: 768px) {
    .btn-full {
        height: 1.9rem !important;
        min-height: 1.9rem !important;
        padding: 0.4rem 1rem !important; 
        font-size: 0.75rem !important; 
        flex-shrink: 1 !important;
        flex-grow: 0 !important;
        flex-basis: auto !important;
		border-radius: 5px;
    }
	.btn-full-2	{
        height: 1.8rem !important;
        min-height: 1.8rem !important;
        padding: 0.35rem 0.9rem !important; 
        font-size: 0.73rem !important; 
        flex-shrink: 1 !important;
        flex-grow: 0 !important;
        flex-basis: auto !important;
		border-radius: 5px;
    }
	.btn-normal {
        height: 1.8rem !important;
        min-height: 1.8rem !important;
        padding: 0.3rem 0.8rem !important;
        font-size: 0.67rem !important;
        flex-shrink: 1 !important;
        flex-grow: 0 !important;
        margin: 0.2rem !important;
		border-radius: 6px;
		/* ทำให้อยู่ตรงกลาง */
		/* margin-left: auto !important; */
        /* margin-right: auto !important; */
    }
}

/* ปุ่มการทำงานแยก */
/* สีน้ำเงิน */
.btn-success,
.btn-confirm,
.btn-payment,
.btn-reward-confirm {
    background: linear-gradient(135deg, #4caf50 0%, #15803d 100%);
    color: white;
	/* ทำให้ปุ่มนูนๆเว๊า */
	box-shadow:
        inset 2px 2px 4px rgba(255, 255, 255, 0.1),
        inset -2px -2px 4px rgba(0, 0, 0, 0.3),
        0 3px 8px rgba(16, 185, 129, 0.4);
}
.btn-success:hover,
.btn-confirm:hover,
.btn-payment:hover,
.btn-reward-confirm:hover {
    background: linear-gradient(135deg, #22c55e 0%, #166534 100%);
    transform: translateY(-2px);
}
.btn-primary,
.btn-create-qr,
.btn-create-link-qr,
.btn-cart,
.btn-add-to-cart {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
	/* ทำให้ปุ่มนูนๆเว๊า */
	box-shadow:
        inset 2px 2px 4px rgba(255, 255, 255, 0.1),
        inset -2px -2px 4px rgba(0, 0, 0, 0.3),
        0 3px 8px rgba(37, 99, 235, 0.4);
}
.btn-primary:hover,
.btn-create-qr:hover,
.btn-create-link-qr:hover,
.btn-cart:hover,
.btn-add-to-cart:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
    transform: translateY(-2px);
}
/* สีน้ำเงิน (แบบมีขีดๆตรงกลาง) */
.btn-exchange-item {
    background: linear-gradient(to bottom, 
        #4f9cf5 12%,
        #1d4ed8 55%,
        #007bff 100%
    );
    
    flex: 1;
    color: #fff;
    width: 100%;
    height: 2.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: bold;
    border: 1px solid rgba(255, 255, 255, 0.15);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
	
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.2),
        0 4px 6px rgba(0, 0, 0, 0.2);
}
.btn-exchange-item:hover {
    background: linear-gradient(to bottom, 
        #4f9cf5 0%, 
        #2563eb 50%, 
        #4f9cf5 100%
    );
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.3),
        0 6px 10px rgba(0, 0, 0, 0.3);
}
@media (max-width: 768px) {
	.btn-exchange-item {
    	height: 1.45rem !important;
		min-height: 1.05rem !important;
        padding: 0.1rem 0.3rem !important;
		font-size: 0.7rem !important;
		border-radius: 4px;
    }
}

/* สีฟ้า */
.btn-use-coupons,
.btn-create-link {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;

    box-shadow:
        inset 2px 2px 4px rgba(255, 255, 255, 0.1),
        inset -2px -2px 4px rgba(0, 0, 0, 0.3),
        0 3px 8px rgba(2, 132, 199, 0.4);
}
.btn-use-coupons:hover,
.btn-create-link:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    transform: translateY(-2px);
}
/* สีเทา */
.btn-secondary,
.btn-recharge-rate,
.btn-back-to-cart,
.btn-cancel {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%); /* slate gray */
    color: white;
	/* ทำให้ปุ่มนูนๆเว๊า */
    box-shadow:
        inset 2px 2px 4px rgba(255, 255, 255, 0.1),
        inset -2px -2px 4px rgba(0, 0, 0, 0.3),
        0 3px 8px rgba(71, 85, 105, 0.4);
}
.btn-secondary:hover,
.btn-recharge-rate:hover,
.btn-back-to-cart:hover,
.btn-cancel:hover {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    transform: translateY(-2px);
}
.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;

    box-shadow:
        inset 2px 2px 4px rgba(255, 255, 255, 0.1),
        inset -2px -2px 4px rgba(0, 0, 0, 0.3),
        0 3px 8px rgba(220, 38, 38, 0.4);
}
.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-2px);
}
.btn-warning {
    background: linear-gradient(135deg, #facc15 0%, #eab308 100%);
    color: #000;

    box-shadow:
        inset 2px 2px 4px rgba(255, 255, 255, 0.1),
        inset -2px -2px 4px rgba(0, 0, 0, 0.3),
        0 3px 8px rgba(234, 179, 8, 0.4);
}
.btn-warning:hover {
    background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
    transform: translateY(-2px);
}
/* ปุ่มแบบ สีมืดๆ เหมือนช่องเลือก, ช่องกรอก */
.btn-toggle-filter {
    border: 1px solid #4B5566 !important;
	background-color: #19212E !important;
	color: #d0d0d0;
	border-radius: 20px;
	/* box-shadow: */
        /* inset 2px 2px 4px rgba(255, 255, 255, 0.08), /* ไฮไลต์ลดลง ดูเนียนขึ้น */ */
        /* inset -2px -2px 6px rgba(0, 0, 0, 0.45),     /* เงาด้านในลึกขึ้น */ */
        /* 0 4px 10px rgba(10, 14, 20, 0.55),          /* เงานอกเข้มขึ้น */ */
        /* 0 0 10px rgba(20, 30, 45, 0.35);    */
}
.btn-toggle-filter:hover {
    background-color: #141A25 !important;
    transform: translateY(-1px);
}
/* ปุ่มแบบ Disabled */
.btn-not-use-coupons {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%); /* เทาเข้มแบบ disabled */
    color: #d1d5db;
    cursor: not-allowed;
    opacity: 0.7;
	box-shadow:
        inset 2px 2px 4px rgba(255, 255, 255, 0.05),
        inset -2px -2px 4px rgba(0, 0, 0, 0.25),
        0 3px 6px rgba(75, 85, 99, 0.4);
}
.btn-not-use-coupons:hover {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    transform: none;
}
/* ปุ่ม X กากบาท */
.btn-close {
    filter: invert(1) brightness(2);
    opacity: 0.8;
    transition: opacity 0.2s ease;
}
.btn-close:hover {
    opacity: 1;
}


/* ========== เกี่ยวกับ (หน้าต่าง Modal) ========== */
#loginModal .modal-dialog,
#registerModal .modal-dialog,
#currencyDetailsModal .modal-dialog {
    max-width: 35%;
    width: auto;
}
#onlineRewardClaimModal .modal-dialog,
#weeklyBonusClaimModal .modal-dialog {
    max-width: 40%;
    width: auto;
}
#EmailModal .modal-dialog,
#notificationModal .modal-dialog,
#allCouponsModal .modal-dialog,
#cartModal .modal-dialog {
    max-width: 55%;
    width: auto;
}
#exchangeModal .modal-dialog,
#onlineExchangeModal .modal-dialog {
    max-width: 60%;
    width: auto;
}
.modal-dialog {
    max-width: 95%;
    width: auto;
}
@media (max-width: 768px) {
    .modal-dialog {
    	max-width: 100%;
    	width: auto;
    }
	#loginModal .modal-dialog,
	#registerModal .modal-dialog,
	#currencyDetailsModal .modal-dialog,
	#EmailModal .modal-dialog,
	#notificationModal .modal-dialog,
	#purchaseModal .modal-dialog,
	#cartModal .modal-dialog,
	#checkoutModal .modal-dialog,
	#allCouponsModal .modal-dialog,
	#editCartItemModal .modal-dialog, 
	#exchangeModal .modal-dialog, 
	#onlineRewardClaimModal .modal-dialog,
	#weeklyBonusClaimModal .modal-dialog,
	#onlineExchangeModal .modal-dialog {
	    max-width: 100% !important;
	    width: auto;
	}
	
}
.modal {
    z-index: 1050 !important;
    color: #e2e8f0;
}
.modal-content {
	background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid #4a5568;
    /* padding: 10px; */
    color: white;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
	animation: fadeIn 0.3s;
}
.modal-header {
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    border-bottom: 2px solid #4a5568;
    border-radius: 12px 12px 0 0;
	padding: 0.8rem 1.5rem;
	color: var(--white-color);
    position: relative;
	justify-content: center !important; /* ทำให้อยู่ตรงกลาง */
}
.modal-header .modal-title {
    font-family: var(--font-family-secondary);
    font-weight: 600;
    font-size: 1.6rem;
}
.modal-header .btn-close {
    filter: invert(1);
    opacity: 0.8;
    transition: opacity 0.3s ease;
}
.modal-header .btn-close:hover {
    opacity: 1;
}
.modal-title {
    color: #f7fafc;
    font-weight: 700;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
}
.modal-body {
    padding: 16px;
	background: #1a202c;
}
.modal-body .form-label {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 10px;
	text-align: center !important;
	/* บังคับให้ Label ใน Modal ชิดซ้ายเสมอ โดยไม่กระทบเนื้อหาอื่น */
	display: block !important;    /* ทำให้ Label ครองพื้นที่เต็มบรรทัด */
    text-align: left !important;  /* สั่งให้ข้อความชิดซ้าย */
    width: 100%;                  /* มั่นใจว่าแผ่เต็มพื้นที่ */
}
.modal-body .input-group-text {
    background-color: var(--light-bg);
    border-right: none;
    color: var(--secondary-color);
    border-radius: 8px 0 0 8px;
	border: 1px solid #00ccff;
    border-color: #00ccff;
}
.modal-body .input-group .form-control {
    border-left: none;
    border-radius: 0 8px 8px 0;
	border: 1px solid #00ccff;
    border-color: #00ccff;
}
.modal-body .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.25);
}
.modal-body .form-check-label {
    font-size: 0.95rem;
    color: var(--secondary-color);
}
.modal-body .text-decoration-none {
    color: var(--primary-color);
    font-weight: 500;
}
.modal-body .text-decoration-none:hover {
    text-decoration: underline !important;
}
.modal.fade.show {
    backdrop-filter: blur(5px); /* ทำให้พื้นหลังเบลอเมื่อเปิดหน้าต่าง */
}
/* การแบ่งส่วน "ซ้าย-ขวา" */
.modal-layout {
    display: flex;
    flex-wrap: nowrap;
    gap: 15px;
}
.modal-left-section,
.modal-right-section {
    flex: 1 1 50%;
    min-width: 0;
	background: #2b3443;
    border-radius: 0.5rem;
    padding: 1.25rem;
    border: 1px solid #374151;
}
.modal-footer {
    background: #2d3748;
    border-top: 1px solid #4a5568;
    border-radius: 0 0 12px 12px;
    padding: 0.8rem 1.5rem;
	display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}
.modal-footer > * {
    margin: 0.25rem;
}
/* ================================ */
/* การกำหนดให้ "ความสูง" เต็มจอ "ความกว้าง" อัตโนมัติ */
/* ================================ */
#allCouponsModal .modal-dialog {
    margin-top: 0.2rem !important;
    margin-bottom: 0.2rem !important;
    /* สำคัญ: ให้ Bootstrap จัดกลางด้วย */
    margin-left: auto !important;
    margin-right: auto !important;
    /* จำกัดความสูง ไม่ให้เกินจอ */
    max-height: calc(100vh - 0.4rem) !important;
    height: calc(100vh - 0.4rem) !important;
}
#allCouponsModal .modal-content {
    height: 100% !important;
    max-height: 100% !important;
    display: flex;
    flex-direction: column;
}
#allCouponsModal .modal-body {
    overflow-y: auto;
    flex: 1;
}
/* ------------------------------ */
@media (max-width: 768px) and (orientation: portrait) {
    .modal-header .modal-title {
        font-size: 1.1rem;
    }
	.modal-header {
        padding: 0 0.8rem;
    }
	#currencyDetailsModal .modal-header {
        padding: 0.6rem 0.8rem;
    }
	.modal-header .btn-close {
        font-size: 0.8rem;
    }
	.modal-content .modal-body {
        padding: 0 !important; /* บังคับลบ Padding ทั้งหมด */
        margin: 0 !important; /* บังคับลบ Margin/Border */
        border: none !important;
    }
    .modal-layout {
        flex-direction: column !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        padding: 0.5rem !important; /* เพิ่ม Padding ให้กับ Modal Layout แทน Modal Body */
        width: 100% !important;
        box-sizing: border-box !important;
    }
	.modal-left-section,
    .modal-right-section {
        flex: 0 0 100% !important;
        min-width: 100% !important; 
        padding: 0.8rem !important; /* ลด Padding ภายใน Section ลงหน่อยเพื่อให้ดูกระชับขึ้น */
    }
	.modal-footer {
        padding: 0.4rem 0.8rem;
    }
	/* สำหรับ Modal ที่ไม่ได้แบ่ง "ซ้าย-ขวา" */
	.modal-layout-single {
        flex-direction: column !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        padding: 0.5rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
	/* ================================ */
	/* การกำหนดให้ "ความกว้าง | ความสูง" เต็มจอ (แบบครอบคลุมทั้งหมด)*/
	/* ================================ */
	.modal-dialog {
	    margin: 0.2rem auto !important;
	    width: calc(100% - 0.4rem);
	    max-width: calc(100% - 0.4rem);
	}
	.modal-content {
	    display: flex;
	    flex-direction: column;
	    /* 🔥 เผื่อ URL bar ประมาณ 50px */
	    max-height: calc(100vh - 0.4rem - 50px);
	}
	.modal-body {
	    overflow-y: auto;
	    /* ให้ modal-body หดได้เมื่อสูงเกิน */
	    flex: 1 1 auto;
	}
	/* ================================ */
}




/* ======================================= */
/* เกี่ยวกับ (การเลือก "แท็บ (ย่อย)" ในเนื้อหาหลัก)
ระบบแท็บหลักที่ใช้อยู่..
1. เติมเงิน
2. ร้านช้อป
*/
/* 🔹 โทนมืดสำหรับ nav-tabs */
.nav-tabs {
    border-bottom: 1px solid #333;
    background-color: #1F2937;
    border-radius: 0.5rem;
    overflow: hidden;
}
/* 🔹 ปุ่มแท็บแต่ละอัน */
.nav-tabs .nav-link {
    background-color: #232E3D; /* สีตอนยังไม่ได้กดเลือก */
    color: #aaa;
    border: none;
	/* border-left: 1px solid #1a202c; */
	/* border-right: 1px solid #1a202c; */
	border-bottom: 3px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
	gap: 8px;
	width: 100%;
}
/* 🔹 เอฟเฟกต์เมื่อเอาเมาส์ไปวาง */
.nav-tabs .nav-link:hover {
    color: #f9f9f9;
    background-color: #2d3748; /* สีตอนชี้ */
    border-bottom: 3px solid #666;
}
/* 🔹 แท็บที่ถูกเลือก (active) */
.nav-tabs .nav-link.active {
    color: #f9f9f9;
    background-color: #364459; /* สีตอนที่เลือกอยู่ */
    border-bottom: 3px solid #00bcd4;
    font-weight: 500;
}
/* ส่วนของ "ไอคอนติ๊ก" เมื่อเลือกแท็บ */
/* 🔹 ปรับไอคอนให้เข้ากับโทน */
.nav-tabs .nav-link i {
    color: #00bcd4;
}
/* 🔹 เปลี่ยนสีไอคอนตอน hover / active */
.nav-tabs .nav-link:hover i,
.nav-tabs .nav-link.active i {
    color: #00e0ff;
}
/* ไอคอน "เครื่องหมายถูก" แสดงเมื่อเลือก */
/* คอนเทนเนอร์วงกลม (Checkbox) */
.nav-tabs .check-icon {
    display: inline-flex; /* แสดงตลอดเวลา */
    align-items: center;
    justify-content: center;
    
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0px; /* ซ่อนเครื่องหมายถูกไว้ก่อนโดยการลดขนาด */
    
    /* สไตล์ตอนยังไม่เลือก: วงกลมขอบเส้นขาวจางๆ พื้นหลังใส */
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    
    transition: all 0.2s ease-in-out;
    flex-shrink: 0;
    margin-left: 0 !important; 
}
/* เมื่อแท็บถูกเลือก (Active State) */
.nav-tabs .nav-link.active .check-icon {
    /* สไตล์ตอนเลือกแล้ว: เติมสีฟ้าเข้มและขอบสว่าง */
    background-color: #0891b2;
    border: 1px solid rgba(255, 255, 255, 0.4);
    font-size: 10px; /* ขยายขนาดเครื่องหมายถูกให้ปรากฏขึ้น */
    color: #ffffff !important;
    
    /* เอฟเฟกต์เงาให้ดูเหมือนปุ่มที่ถูกกดเลือก */
    box-shadow: 0 0 8px rgba(8, 145, 178, 0.5);
    
    /* ใส่ Animation เด้งเบาๆ */
    animation: checkbox-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
/* อนิเมชันตอนติ๊กถูก */
@keyframes checkbox-pop {
    0% { transform: scale(0.8); }
    100% { transform: scale(1); }
}

/* ✅ ส่วนเพิ่มสำหรับ Mobile เท่านั้น */
@media (max-width: 768px) {
    .nav-tabs {
        display: flex;
        flex-wrap: wrap; /* ให้ขึ้นบรรทัดใหม่อัตโนมัติ */
    }
	/* พื้นฐาน: ทุกลำดับให้เป็น 50% */
    .nav-tabs .nav-item {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
    /* ถ้าแท็บแรก เป็นส่วนหนึ่งของจำนวนเลขคี่ (ตรวจสอบด้วย nth-last-child) ให้ขยาย 100% */
    .nav-tabs .nav-item:first-child:nth-last-child(odd) {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
	/* กรณีมี 3 แท็บ (คอมเมนต์แท็บ "รวม" ไว้) */
    .nav-tabs .nav-item:first-child:nth-last-child(3),
    .nav-tabs .nav-item:first-child:nth-last-child(3) ~ .nav-item {
        flex: 0 0 50%; /* 2 คอลัมน์ */
        max-width: 50%;
    }
    .nav-tabs .nav-item:first-child:nth-last-child(3) {
        flex: 0 0 100%; /* แท็บแรกเต็ม宽度 */
        max-width: 100%;
    }
    /* กรณีปกติ 4 แท็บ */
    .nav-tabs .nav-item:first-child:nth-last-child(4),
    .nav-tabs .nav-item:first-child:nth-last-child(4) ~ .nav-item {
        flex: 0 0 50%;
        max-width: 50%;
    }
	.nav-tabs .nav-link {
        font-size: 0.7rem;
		height: 2.3rem !Important;
        min-height: 2.3rem !Important;
        border-radius: 0;
        border-bottom: 1px solid transparent;
		align-items: center !Important;
		justify-content: center !Important;
    }
    /* เพิ่มช่องว่างระหว่างแถว */
    .nav-tabs .nav-item:nth-child(odd) {
        border-right: 1px solid #333; /* เส้นแบ่งกลางแนวตั้ง */
    }
    /* ปรับ spacing ด้านล่างระหว่างบรรทัด */
    .nav-tabs .nav-item:nth-child(-n+2) {
        margin-bottom: 4px;
    }
	/* Checkbox */
	.nav-tabs .check-icon {
        width: 13px;
        height: 13px;
    }
    
}
/* ======================================= */


/* เกี่ยวกับ (จดหมาย | แจ้งเตือน) */
/* ส่วนของช่องตอบกลับ */
#EmailModal textarea.form-control:focus,
#notificationModal textarea.form-control:focus {
    background-color: #374151 !important; /* gray-700 */
    border-color: #6b7280 !important; /* gray-500 */
    color: #ffffff !important;
    box-shadow: 0 0 0 0.1rem rgba(59, 130, 246, 0.25) !important; /* focus ring สีฟ้า */
}
#EmailModal textarea.form-control::placeholder,
#notificationModal textarea.form-control::placeholder {
    color: #d1d5db !important; /* gray-300 - สีขาวอ่อน */
    opacity: 1; /* ทำให้ไม่จาง */
}
/* สไตล์พิเศษสำหรับปุ่มใน Modal */
#EmailModal .modal-footer .btn,
#notificationModal .modal-footer .btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 8px 20px;
    transition: all 0.3s ease;
    min-width: 120px;
}
/* ปุ่มย้อนกลับและถัดไป - สีฟ้า */
#EmailModal .btn-outline-primary,
#notificationModal .btn-outline-primary {
    border: 2px solid #3b82f6;
    color: #3b82f6;
    background: transparent;
}
#EmailModal .btn-outline-primary:hover:not(:disabled),
#notificationModal .btn-outline-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    border-color: #3b82f6;
}
#EmailModal .btn-outline-primary:disabled,
#notificationModal .btn-outline-primary:disabled {
    border-color: #6b7280;
    color: #6b7280;
    background: transparent;
    cursor: not-allowed;
    opacity: 0.6;
}
/* ปุ่มลบ - สีแดง */
#EmailModal .btn-outline-danger,
#notificationModal .btn-outline-danger {
    border: 2px solid #dc2626;
    color: #dc2626;
    background: transparent;
}
#EmailModal .btn-outline-danger:hover,
#notificationModal .btn-outline-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
    border-color: #dc2626;
}
/* ปุ่มปิดหน้าต่าง - สีเทาพิเศษ */
#EmailModal .btn-outline-secondary,
#notificationModal .btn-outline-secondary {
    border: 2px solid #6b7280;
    color: #d1d5db;
    background: transparent;
}
#EmailModal .btn-outline-secondary:hover,
#notificationModal .btn-outline-secondary:hover {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.4);
    border-color: #6b7280;
}
/* Animation เมื่อกดปุ่ม */
#EmailModal .btn:active:not(:disabled),
#notificationModal .btn:active:not(:disabled) {
    transform: translateY(0);
}
/* ทำให้ปุ่มกลางเด่นน้อยลงเล็กน้อย */
#EmailModal .modal-footer > div:nth-child(2) .btn,
#notificationModal .modal-footer > div:nth-child(2) .btn {
    opacity: 0.9;
}
#EmailModal .modal-footer > div:nth-child(2) .btn:hover,
#notificationModal .modal-footer > div:nth-child(2) .btn:hover {
    opacity: 1;
}


/* ส่วนของไอคอนปุ่ม "จดหมาย / แจ้งเตือน / ออกจากระบบ" สำหรับ Desktop */
#EmailButton i,
#notificationButton i,
#LogoutButton i {
    font-size: 1.3rem !important;
}


/* เกี่ยวกับ (ฟิลด์คอลัมน์รายการต่างๆ) */
.table-content th,
.table-content td {
    border: 1px solid #4B5563;
}
table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    font-family: inherit;
    font-size: 14px;
    color: #d1d5db;
}
thead th { /* ส่วนของ "หัวข้อ" */
    padding: 0.7rem;
    border-bottom: 1px solid #4b5563;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
	color: #d1d5db;
}
tbody td { /* ส่วนของ "เนื้อหา" */
    padding: 0.4rem;
    border-bottom: 1px solid #4b5563;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
	color: #d1d5db;
}
tbody tr:hover {
    background-color: #374151;
}
thead th {
    background-color: #374151;
    font-weight: 600;
}
tbody td button {
    font-weight: bold;
    cursor: pointer;
}
tbody td span {
    display: inline-block;
    min-width: 40px;
    text-align: center;
}
table input.form-input,
table select.form-select {
    font-size: 14px;
    padding: 0.25rem 0.5rem;
    text-align: center;
    border-radius: 0.25rem;
}
@media (max-width: 768px) {
    thead th {
        padding: 0.6rem;
        font-size: 13px;
    }
	tbody td {
        padding: 0.3rem;
        font-size: 13px;
    }
	
}

/* ส่วนของรูปอาชีพตัวละครในแท็บ "ตัวละคร" */
.occupation-img {
    border-radius: 12%;
    border: 0.1rem solid grey;
    object-fit: cover;
}

/* ========== เกี่ยวกับ (ฟอร์มต่างๆ) ========== */
select {
    cursor: pointer;
}
/* ทำให้ "หัวข้อ" อยู่ตรงกลาง (แต่ลองแล้ว มันไม่ค่อยสวย เลยชิดซ้ายแบบเดิม) */
.form-label {
	color: #ced0d5 !important;
	font-size: 17px !important;
    /* text-align: center !important; */
	/* width: 100%; */
}
/* ส่วนที่ทำให้อยู่ตรงกลาง ทดแทนที่ลูกศรทำให้ข้อความเยื้องไปซ้าย */
.form-select {
    text-align-last: center;
    padding-right: 3px !important; /* ตัดพื้นที่ลูกศรของ Bootstrap ออก */
    background-position: right 0.5rem center; /* ขยับไอคอนลูกศรไปขวาสุด */
    background-size: 12px auto;
}
.form-select,
.form-input,
.form-textarea {
    width: 100%;
	height: 52px;
	font-size: 16px !important;
    /* padding: 12px; */
    background-color: #19212E !important;
    color: #F6F6F6;
    border: 1px solid #4B5566 !important; /* เส้นขอบช่องเลือก */
    border-radius: 6px;
    transition: all 0.2s ease-in-out;
	text-align: center;
}
.form-input.text-center,
.form-select.text-center,
.form-textarea.text-center {
    text-align: center !important;
}
.form-select:focus,
.form-input:focus,
.form-textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px #34d399;
    border-color: #34d399;
}
.item-select {
    width: 100%;
    padding: 12px;
    background-color: #1F2937 !important;
    color: #fff;
    border: 1px solid #4a5568;
    border-radius: 6px;
    transition: all 0.2s ease-in-out;
}
.item-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px #34d399;
    border-color: #34d399;
}
.form-section-upgrade-hide {
    display: none;
}
@media (max-width: 768px) {
    .form-label {
    	font-size: 14px !important;
    }
	.form-select,
    .form-input,
    .form-textarea {
        height: 40px !important;
		font-size: 13px !important;
		margin-bottom: -0.42rem !important;
    }
}

/* ========== Custom Select Dropdown ========== */
/* การแทนที่ select ด้วย dropdown เพื่อให้ใช้งานใน WebView ของเกมได้ */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}
.custom-select-btn {
    width: 100%;
    height: 52px;
    background-color: #19212E !important;
    color: #F6F6F6;
    border: 1px solid #4B5566 !important;
    border-radius: 6px;
    font-size: 16px !important;
    text-align: center;
    line-height: 52px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-sizing: border-box;
    padding: 0 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.custom-select-btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.custom-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #19212E;
    border: 1px solid #4B5566;
    border-radius: 6px;
    margin-top: 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}
.custom-select-dropdown div {
    padding: 10px 14px;  /* ลดจาก 12px 16px เหลือ 6px 12px */
    color: #F6F6F6;
    cursor: pointer;
    font-size: 13px;  /* ลดจาก 14px เหลือ 13px */
    text-align: center;
    border-bottom: 1px solid #2d3748;
}
.custom-select-dropdown div:last-child {
    border-bottom: none;
}
.custom-select-dropdown div:hover {
    background-color: #2d3748;
}
@media (max-width: 768px) {
    .custom-select-btn {
        height: 42px !important;
        line-height: 42px !important;
        font-size: 13px !important;
    }
    .custom-select-dropdown div {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* ========== เกี่ยวกับ (ปุ่ม checkbox) ========== */
/* เจาะจง checkbox ที่ใช้ class form-checkbox */
.form-checkbox {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #aaa;
    border-radius: 50%;
    background-color: transparent;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}
/* Hover effect */
.form-checkbox:hover {
    border-color: #4ade80;
}
/* Checked state */
.form-checkbox:checked {
    background-color: #3bb145;
    border-color: #3bb145;
}
/* เครื่องหมายติ๊ก */
.form-checkbox:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 6px;
    border: solid white;
    border-width: 0 0 3px 3px;
    transform: translate(-50%, -60%) rotate(-45deg);
}
/* Focus state */
.form-checkbox:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.3);
}
/* Disabled state */
.form-checkbox:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}



/* ========== เกี่ยวกับ (ส่วนของการเลือกไอเทม select2) ========== */
.select2-container .select2-selection {
    border: 1px solid #4B5566 !important; /* เส้นขอบช่องเลือก */
    border-radius: 6px !important;
    height: 52px !important;
    padding: 0 12px !important;
    background-color: #19212E !important;
    display: flex !important;
    align-items: center !important;
	text-align: center !important;
	justify-content: center !important;
    box-sizing: border-box !important;
}
.select2-container .select2-selection:hover {
    border-color: #10B981 !important;
}
.select2-container .select2-selection:focus {
    border-color: #10B981 !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2) !important;
}
/* ปรับ placeholder ให้เหมือน input */
.select2-container .select2-selection__placeholder {
    color: #9CA3AF !important;
}
/* เลื่อนปุ่ม clear X กากบาท ไปซ้าย */
.select2-container .select2-selection--single {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}
/* ปรับขนาดกากบาทของ Select2 */
.select2-container .select2-selection__clear {
    font-size: 20px !important;             /* ลดขนาด X ให้พอดีกับ container */
    width: 24px !important;
    height: 24px !important;
    line-height: 24px !important;           /* สำคัญ! ทำให้ตัว X อยู่กลาง */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #9CA3AF !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    order: -1 !important;                   /* ให้ไปอยู่ด้านซ้าย */
    margin-right: 0 !important;
}
.select2-container .select2-selection__clear:hover {
    color: #EF4444 !important;
    background: #374151 !important;   /* 🔹 เพิ่มพื้นหลังตอน hover */
}
.select2-container .select2-selection__rendered {
    flex: 1 !important;
    color: white !important;
}
/* ปรับ dropdown arrow ให้กลางแนวตั้ง */
.select2-container .select2-selection__arrow {
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
}
.select2-container .select2-selection__arrow b {
    border-top-color: #9CA3AF !important;
}
.select2-container.select2-container--open .select2-selection__arrow b {
    border-bottom-color: #9CA3AF !important;
}

/* Dropdown container */
.select2-container--default .select2-dropdown {
    text-align: center;
	justify-content: center;
    border: 1px solid #4B5566 !important; /* เส้นขอบช่องเลือก */
    border-radius: 6px;
    background-color: #374151;
}
/* Dropdown options */
.select2-container--default .select2-results__option {
    color: #E5E7EB;
    padding: 8px 12px;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #10B981;
    color: white;
}
.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #1F2937;
    color: #10B981;
}
/* ช่องค้นหาภายใน dropdown ของ Select2 */
.select2-container--default .select2-search--dropdown .select2-search__field {
	width: 100%;
    height: 35px;
	font-size: 1rem;
    text-align: center;
	justify-content: center;
    border: 1px solid #4B5566 !important; /* เส้นขอบช่องเลือก */
    border-radius: 6px;
    background-color: #1F2937;
    color: white;
    margin-top: 3px;
	margin-bottom: 4px;
}
.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: #10B981;
    outline: none;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}
/* Placeholder ของช่องค้นหา */
.select2-container--default .select2-search--dropdown .select2-search__field::placeholder {
    color: #9CA3AF;
}
/* ปรับ container ของ dropdown ให้มี padding นิดหน่อย */
.select2-dropdown .select2-search.select2-search--dropdown {
    padding: 3px 6px;
}
/* รูปที่แสดงใน Modal + เพิ่ม เลือกค้นหาไอเทม */
.select2-result-row { /* Container หลักสำหรับแต่ละรายการ */
    display: flex;
    align-items: center;
    justify-content: space-between; /* ✅ ทำให้ส่วนซ้ายและขวาแยกออกจากกัน */
}
.select2-result-container { /* Container สำหรับรูปภาพและชื่อไอเทม (อยู่ทางซ้าย) */
    display: flex;
    align-items: center;
    flex-grow: 1;
}
.select2-result-title { /* สำหรับชื่อไอเทม */
    font-size: 1.1rem;
    flex-grow: 1; /* ✅ ทำให้ชื่อไอเทมขยายเพื่อดันส่วน ID ไปทางขวา */
}
.select2-result-icon { /* สำหรับปรับขนาดและระยะห่างของรูปภาพไอเทม */
    width: 40px;
    height: 40px;
	margin-right: 10px;
    background: url('../Images/Items_BG/1.png');
    background-size: cover;
    background-repeat: no-repeat;
	display: flex;
    align-items: center;
    justify-content: center;
}
.select2-result-id { /* สำหรับ ID ที่จะชิดขวา */
    font-size: 0.9rem;
    color: #888;
    white-space: nowrap; /* ป้องกันไม่ให้ข้อความขึ้นบรรทัดใหม่ */
}
/* ปรับให้ icon + title ใน result row ไม่ล้น */
.select2-result-row {
	height: 28px; /* ปรับความสูงของช่องที่แสดงรายการไอเทม */
    display: flex;
    align-items: center;
    gap: 4px; /* ช่องว่างระหว่าง icon กับ text */
}

@media (max-width: 768px) {
    .select2-result-title { /* สำหรับชื่อไอเทม */
        font-size: 0.85rem;
    }
    .select2-result-icon { /* สำหรับปรับขนาดและระยะห่างของรูปภาพไอเทม */
        width: 30px;
        height: 30px;
    }
    .select2-result-id { /* สำหรับ ID ที่จะชิดขวา */
        font-size: 0.7rem;
    }
    .select2-result-row {
    	height: 20px; /* ปรับความสูงของช่องที่แสดงรายการไอเทม */
    }
    
}

/* Parent ของ select dynamic */
.exchange-item-card > .exchange-item-info > div {
    width: 100%;
}


/* ================== */
/* เกี่ยวกับ (หน้าต่าง SweetAlert) */
/* ================== */

/* Popup หลัก */
.swal2-popup {
    background-color: #1f2937 !important; /* เทาเข้ม */
    color: #f9fafb !important;            /* ตัวอักษรสีอ่อน */
    border-radius: 0.75rem !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6) !important;
}
/* Title */
.swal2-title {
    color: #ffffff !important;
    font-weight: 600 !important;
}
/* เนื้อหาภายใน (ข้อความ html:) */
.swal2-html-container {
    color: #d1d5db !important; /* เทาอ่อน */
}
/* ปุ่มตกลง */
.swal2-confirm {
    background-color: #4caf50 !important; /* เขียว */
    color: #fff !important;
    border: none !important;
    border-radius: 0.5rem !important;
}
.swal2-confirm:hover {
    background-color: #43a047 !important; /* เข้มขึ้นเมื่อ hover */
}
/* ปุ่มยกเลิก */
.swal2-cancel {
    background-color: #6b7280 !important; /* เทา */
    color: #fff !important;
    border: none !important;
    border-radius: 0.5rem !important;
}
.swal2-cancel:hover {
    background-color: #4b5563 !important;
}
/* แถบ progress timer */
.swal2-timer-progress-bar {
    background-color: #22c55e !important; /* เขียวสด */
}
/* ไอคอน */
.swal2-icon {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
/* ปรับสี icon ตามประเภท */
.swal2-icon.swal2-success { color: #22c55e !important; } /* เขียว */
.swal2-icon.swal2-error   { color: #ef4444 !important; } /* แดง */
.swal2-icon.swal2-warning { color: #facc15 !important; } /* เหลือง */
.swal2-icon.swal2-info    { color: #3b82f6 !important; } /* น้ำเงิน */
.swal2-icon.swal2-question{ color: #60a5fa !important; } /* ฟ้าอ่อน */


/* เกี่ยวกับ (การแก้ไขผลกระทบจากการใช้ Bootstrap 5) */
/* ส่วนของ "การค้นหาประวัติต่างๆ" */
.flex.flex-col.md\:flex-row {
    align-items: end !important;
}
.w-full.md\:w-1\/2 {
    margin-bottom: 0 !important;
}




/* เกี่ยวกับ (การแสดง "ปุ่มแนะนำ ติดตั้งแอป") */
.install-app-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #4b5563;
}
.install-app-card {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    padding: 0.4rem;
    border-radius: 0.5rem;
    text-align: center;
	margin: 0 0.1rem;
	margin-bottom: 0.3rem;
}
.install-app-text {
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.1rem;
    margin-bottom: 0.1rem;
    line-height: 1.25rem;
}
.install-app-btn {
    background-color: #eab308;
    color: #1f2937;
    font-weight: bold;
	font-size: 0.75rem;
	border-radius: 8px;
    transition: background-color 0.2s;
	width: calc(100% - 1rem);
	margin: 0.35rem;
	min-height: 32px !important;
	max-height: 32px !important;
	line-height: 32px !important;
	padding: 0 !important;
}
.install-app-btn i {
    font-size: 0.75rem;
}
.install-app-btn:hover {
    background-color: #ca8a04;
}



/* ====================== */
/* เกี่ยวกับ (การแก้ไขปัญหา เมื่อเปิดหน้าต่าง Swal หรือ Modal ทางด้านขวามันจะหุบเข้ามา) */
/* ====================== */
/* ป้องกันการเปลี่ยนแปลง layout เมื่อเปิด Modal */
body.modal-open {
    margin-left: 0 !important;
    padding-right: 0 !important;
    overflow: hidden !important;
}
/* ป้องกันการเปลี่ยนแปลง layout เมื่อเปิด SweetAlert */
body.swal2-shown {
    margin-left: 0 !important;
    padding-right: 0 !important;
    overflow: hidden !important;
}
/* สำหรับ Bootstrap Modal */
.modal-backdrop {
    z-index: 1040 !important;
}
/* สำหรับ SweetAlert */
.swal2-container {
    z-index: 1060 !important;
}
/* ============================= */


/* ======== เกี่ยวกับ (การแจ้งเตือน "ShowToast") ======== */
.swal2-toast {
    font-size: 0.99rem !important;
	width: auto !important;
}
.swal2-toast .swal2-html-container {
    font-size: 0.92rem !important;
    line-height: 1.4 !important; /* ระยะห่าง บน-ล่าง */
}
/* progress bar: หลอดนับถอยหลังการปิด */
.swal2-timer-progress-bar-container {
    height: 4px;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 10px;
}
.swal2-timer-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #34d399, #007bff);
}
@media (max-width: 768px) {
    .swal2-toast {
        font-size: 0.72rem !important;
		width: auto !important;
    }
	.swal2-toast .swal2-html-container {
        font-size: 0.67rem !important;
    }
}
/* ============================= */


/* ======= เกี่ยวกับ (ส่วนของการ "เลือกจำนวนการดูประวัติ และเกี่ยวกับประวัติ") ======= */
.list-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    position: relative;
}
/* สร้าง "พื้นที่เท่ากับ limit-container" ทางซ้าย */
.list-section-header::before {
    content: "";
    /* flex: 0 0 180px; /* กำหนดความกว้างให้ใกล้เคียงกับ limit-container */ */
}
.list-section-title {
    color: #fff;
    font-size: 1.25rem;
    text-align: left;
    flex: 1;
}
.limit-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.limit-select {
    height: 1.7rem;
    background-color: #19212E;
    color: #d1d5db;
    border: 1px solid #4a5568;
    border-radius: 0.28rem;
    padding: 0 0.5rem;
    outline: none;
    transition: border-color 0.15s ease;
	text-align: center;
	font-size: 0.95rem;
}
.limit-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px #34d399;
    border-color: #34d399;
}
.limit-select option {
    background-color: #1f2937;
    color: #d1d5db;
}
@media (max-width: 768px) {
    .list-section-header::before {
        content: none; /* ❌ ปิดช่องว่างด้านซ้าย */
    }
    .list-section-title {
        font-size: 0.9rem;
		text-align: left;
		margin-left: 2px;
    }
	.limit-select {
        font-size: 0.78rem;
    }
}
/* ============================== */


/* ============================================================ */
/* ==================== (รวม) ส่วนที่แสดงในมือถือ Mobile ==================== */
/* ============================================================ */
@media (max-width: 768px) {
    /* Header container */
    header.bg-gray-800 {
        padding: 0.5rem 1rem !important;
    }
    /* ป้องกันการบังคับบรรทัดใหม่ */
    header.bg-gray-800 {
        flex-wrap: nowrap !important;
    }
    /* ชื่อระบบ - บังคับให้อยู่ในบรรทัดเดียวกัน */
    header h1 {
        font-size: 1rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        flex-shrink: 1 !important;
        min-width: auto !important;
    }
    header h1 .text-green-400 {
        font-size: 0.9rem !important;
        display: inline !important;
        margin-left: 0.25rem !important;
    }
    /* Container ปุ่มด้านขวา */
    header .flex.items-center.space-x-4 {
        flex-shrink: 0 !important;
        gap: 0.5rem !important;
    }
    /* ปรับขนาดไอคอน */
    #openSidebar i {
        font-size: 1.4rem !important;
    }
    header button[onclick="confirmLogout()"] i {
        font-size: 1rem !important;
    }
    /* ปุ่มเลือกเกม */
    #gameDropdownButton {
        padding: 0.35rem 0.6rem !important;
        font-size: 0.75rem !important;
    }
}

/* ====================== */
/* Mobile Dashboard Styles */
/* ====================== */

@media (max-width: 768px) {
    /* Container หลัก */
    #tab-dashboard .bg-gray-800 {
        padding: 1rem !important;
    }
    /* หัวข้อแดชบอร์ด */
    #tab-dashboard h2.text-2xl {
        font-size: 1.4rem !important;
        margin-bottom: 1.5rem !important;
        text-align: center;
    }
    /* Grid ของการ์ดสถิติ */
    #tab-dashboard .grid.grid-cols-1 {
        gap: 0.75rem !important;
    }
    /* การ์ดสถิติแต่ละใบ */
    #tab-dashboard .bg-gray-700 {
        padding: 1rem !important;
        border-radius: 0.5rem !important;
    }
    /* หัวข้อการ์ดสถิติ */
    #tab-dashboard .bg-gray-700 h3,
    #tab-dashboard .bg-gray-700 p	{
        font-size: 0.9rem !important;
        text-align: center;
        margin-bottom: 0.5rem !important;
        line-height: 1.3;
    }
    /* ตัวเลขในการ์ดสถิติ */
    #tab-dashboard .bg-gray-700 .text-3xl {
        font-size: 1.5rem !important;
        text-align: center;
        line-height: 1.2;
    }
    /* การ์ดรายการเติมเงิน (ที่มี 2 บรรทัด) */
    #tab-dashboard .bg-gray-700 .text-orange-400 {
        font-size: 1.3rem !important;
        line-height: 1.3;
    }
    /* Container กราฟ */
    #tab-dashboard .grid.grid-cols-1.lg\\:grid-cols-2 {
        gap: 1rem !important;
        margin-top: 1.5rem !important;
    }
    /* การ์ดกราฟ */
    .chart-container {
        padding: 1rem !important;
        margin-top: 0 !important;
    }
    /* หัวข้อกราฟ */
    .chart-title {
        font-size: 1.1rem !important;
        margin-bottom: 1rem !important;
        text-align: center;
    }
    /* Wrapper กราฟ */
    .chart-wrapper {
        height: 250px !important;
    }
}


/* ====================== การปรับลดขนาดแบบรวม สำหรับมือถือ หรือใน WebView ====================== */

@media screen and (orientation: landscape) and (min-width: 769px) and (max-width: 1024px) {
    body {
        zoom: 0.65;
    }
    
    .modal-dialog,
    .swal2-popup {
        zoom: 0.8;
    }
    
    body, .form-label, .btn, .form-select, .form-input {
        font-size: 12px;
    }
    
    .container, .main-content, .card, .modal-content {
        padding: 8px;
        margin: 4px;
    }
    
    .custom-select-dropdown div {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .custom-select-btn,
    .form-input,
    .form-textarea,
    input[type="text"],
    input[type="number"],
    textarea {
        height: 38px !important;
        font-size: 12px !important;
        padding: 4px 8px !important;
        line-height: 38px !important;
        display: flex;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
    }
    
    textarea {
        height: auto !important;
        min-height: 60px;
    }
}

/* น่าจะเกี่ยวกับ (AntiHacking) */
.blinking {
    animation: blink 1s infinite;
}
@@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}


/* ========= เกี่ยวกับ (การแสดงจำนวน "พอยท์ | คอยน์ | คะแนน") */
#main-header {
    background-color: #1f2937;
    padding: 0.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.5rem;
    /* display: flex; */
    align-items: center;
    position: sticky;
    top: 0.5rem;
    z-index: 40;
}
.currency-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.currency-item {
    display: flex;
    align-items: center;
    justify-content: center; /* ⭐ NEW: จัดให้อยู่กึ่งกลาง */
    gap: 0.25rem; /* ระยะห่างของ "ไอคอน - จำนวน - ข้อความ " */
    border-radius: 0.5rem;
    padding: 0.25rem 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    height: 30px;
}
.currency-item.points {
    background-color: #2563eb;
}
.currency-item.points:hover {
    background-color: #1d4ed8;
}
.currency-item.coins {
    background-color: #16a34a;
}
.currency-item.coins:hover {
    background-color: #15803d;
}
.currency-item.score {
    background-color: #0d9488;
}
.currency-item.score:hover {
    background-color: #0f766e;
}
.currency-icon {
    width: 1.25rem;
    height: 1.25rem;
}
.currency-amount {
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1;
    display: flex;
    align-items: center;
}
.currency-label {
    color: white;
    justify-content: center !Important;
    align-items: center !Important;
	text-align: center !Important;
    font-size: 0.9rem;
    font-weight: 500;
	height: fit-content;
}
.currency-modal-icon {
    width: 40px;
    height: 40px;
}
@media (min-width: 768px) {
    #main-header {
        height: 47px !Important;
    }
    .currency-item {
        height: 28px !important;
    }
	.currency-amount {
        font-size: 0.85rem;
    }
    .currency-label {
        font-size: 0.7rem;
    }
}
@media (max-width: 768px) {
    .currency-container {
        gap: 0.5rem;
    }
    .currency-item {
        padding: 0.1rem 0.4rem !important;
        height: 22px !important;
        min-height: auto !important;
		border-radius: 0.35rem;
    }
	.currency-icon {
        width: 1rem;
        height: 1rem;
    }
    .currency-amount {
        font-size: 0.75rem;
        line-height: 1;
    }
    .currency-label {
        font-size: 0.6rem;
        line-height: 1;
    }
}
/* ============================== */


/* ============================== */
/* เกี่ยวกับ (การแบ่งหน้า, แสดงบอกหน้า, ปุ่มนำทาง) */
/* ============================== */
.pagination-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
}
.pagination-info {
    font-size: 0.875rem;
    color: #d1d5db;
}
.pagination-page {
    font-size: 0.875rem;
    color: #d1d5db;
	margin-right: 4.5rem;
}
.pagination-buttons {
    display: flex;
    gap: 0.5rem;
}
.pagination-btn {
    padding: 0.375rem 0.75rem;
    border: 1px solid #54626f;
    background-color: #54626f;
    color: #d1d5db;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
	font-size: 1.2rem;
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
}
.pagination-btn:hover:not(.disabled) {
    background-color: #4b5563;
    border-color: #374151;
}
.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
/* ส่วนของ "การติ๊กเลือกเลื่อนขึ้นบนสุด" เมื่อกดปุ่มนำทางถัดไป */
.auto-scroll-container {
    display: flex;
    flex-direction: column; /* ให้เรียงลงล่าง */
    align-items: center;
    justify-content: center;
    gap: 0.22rem;
    margin-top: 0.9rem !Important;
}
.toggle-switch-auto-scroll {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}
.toggle-input-auto-scroll {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider-auto-scroll {
    position: relative;
    width: 50px;
    height: 24px;
    background-color: #374151;
    border-radius: 24px;
    transition: all 0.3s ease;
}
.toggle-slider-auto-scroll:before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: all 0.3s ease;
}
.toggle-input-auto-scroll:checked + .toggle-slider-auto-scroll {
    background-color: #3b82f6;
}
.toggle-input-auto-scroll:checked + .toggle-slider-auto-scroll:before {
    transform: translateX(26px);
}
.auto-scroll-text {
    font-size: 0.875rem;
    color: #d1d5db;
}
@media (max-width: 768px) {
    .pagination-navigation {
        flex-direction: column;
        gap: 0.1rem;
        margin-top: 0.1rem;
        margin-bottom: 0.1rem;
        padding: 0;
    }
    .pagination-page {
        order: 1; /* หน้า - อยู่บนสุด */
        font-size: 0.8rem;
        text-align: center;
		margin-right: 0;
        margin-top: 0.7rem !Important;
    }
    .pagination-info {
        order: 2; /* แสดง - อยู่กลาง */
        font-size: 0.8rem;
        text-align: center;
        margin-bottom: 0.8rem;
    }
    .pagination-buttons {
        order: 3; /* ปุ่ม - อยู่ล่าง */
        width: 100%;
        justify-content: center;
    }
    .pagination-btn {
        font-size: 0.95rem;
        width: 36px;
        min-width: 36px;
        height: 36px;
        min-height: 36px;
    }
	/* ส่วนของ "การติ๊กเลือกเลื่อนขึ้นบนสุด" เมื่อกดปุ่มนำทางถัดไป */
    .auto-scroll-container {
        margin-top: 0.7rem;
    }
}

/* ============================== */




/* ====================== สำหรับทดสอบ ====================== */
