/* SweetAlert 2.x (sweetalert@2) Dark & Gold Theme — ใช้ร่วมกันทุกหน้า (หน้าแรก + Admin)
   ต้องโหลดหลัง sweetalert.min.js; ใช้ !important เพื่อทับ CSS ที่ไลบรารี inject เข้ามา */

.swal-overlay {
  /* ต้องอยู่เหนือ Modal ของหน้าเว็บ (z-[10002]) ไม่งั้นแจ้งเตือนที่เปิดจากใน Modal จะถูกบัง */
  z-index: 10050 !important;
  background-color: rgba(0, 0, 0, 0.8) !important;
  backdrop-filter: blur(4px);
}

.swal-modal {
  background: linear-gradient(180deg, #232120 0%, #1c1b1b 55%, #121111 100%) !important;
  border: 1px solid rgba(242, 202, 80, 0.35) !important;
  border-radius: 1.25rem !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.85), 0 0 25px rgba(212, 175, 55, 0.2) !important;
  font-family: 'Inter', 'Kanit', sans-serif !important;
}

.swal-title {
  color: #f2ca50 !important;
  font-family: 'Montserrat', 'Kanit', sans-serif !important;
  font-weight: 700 !important;
}
.swal-title:not(:last-child) { margin-bottom: 10px !important; }

.swal-text {
  color: #e5e2e1 !important;
  text-align: center !important;
  line-height: 1.6 !important;
}

.swal-content__input,
.swal-content__textarea {
  background: #0d0d0d !important;
  color: #e5e2e1 !important;
  border: 1px solid #4d4635 !important;
  border-radius: 0.75rem !important;
}
.swal-content__input:focus,
.swal-content__textarea:focus {
  border-color: #f2ca50 !important;
  box-shadow: 0 0 0 3px rgba(242, 202, 80, 0.25) !important;
  outline: none !important;
}

/* โลโก้ RICHHENG ด้านบนสุดของกล่อง (ใส่โดย assets/swal-logo.js) */
/* Tailwind preflight ตั้ง img เป็น display:block ทำให้รูปชิดซ้าย จึงบังคับจัดกึ่งกลางด้วย flex */
.swal-icon--custom {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
  height: auto !important;
  border: none !important;
  border-radius: 0 !important;
  margin: 24px auto 4px !important;
}
.swal-icon--custom img {
  display: block;
  margin-left: auto !important;
  margin-right: auto !important;
  width: 90px;
  height: 90px;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(212, 175, 55, 0.45));
}

/* ไอคอน: ซ่อนมุมขาวของ success ให้กลืนกับพื้นเข้ม และเปลี่ยน info เป็นทอง */
.swal-icon--success:before,
.swal-icon--success:after,
.swal-icon--success__hide-corners { background: transparent !important; }
.swal-icon--info { border-color: #f2ca50 !important; }
.swal-icon--info:before,
.swal-icon--info:after { background-color: #f2ca50 !important; }
.swal-icon--warning { border-color: #f2ca50 !important; }
.swal-icon--warning__body,
.swal-icon--warning__dot { background-color: #f2ca50 !important; }

.swal-footer {
  text-align: center !important;
  background: transparent !important;
  border-top: 1px solid rgba(242, 202, 80, 0.15) !important;
  margin-top: 16px !important;
}

/* ปุ่มยืนยัน = ทอง (เหมือนปุ่มหลักบนหน้าเว็บ) */
.swal-button {
  background: linear-gradient(180deg, #fff5be 0%, #f2ca50 50%, #b38618 100%) !important;
  color: #1b1400 !important;
  border: 1px solid rgba(242, 202, 80, 0.6) !important;
  border-top-color: rgba(255, 255, 255, 0.7) !important;
  border-radius: 0.75rem !important;
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.4) !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
  padding: 10px 28px !important;
  text-shadow: none !important;
  transition: filter 0.15s, transform 0.1s;
}
.swal-button:not([disabled]):hover { filter: brightness(1.1); }
.swal-button:active { transform: scale(0.97); }
.swal-button:focus { box-shadow: 0 0 0 3px rgba(242, 202, 80, 0.35), 0 4px 14px rgba(212, 175, 55, 0.4) !important; outline: none !important; }

/* ปุ่มยกเลิก = พื้นเข้ม ขอบ/ตัวอักษรทอง */
.swal-button--cancel {
  background: #1c1b1b !important;
  color: #f2ca50 !important;
  border: 1px solid rgba(242, 202, 80, 0.5) !important;
  box-shadow: none !important;
}
.swal-button--cancel:not([disabled]):hover { background: #2a2826 !important; filter: none; }
.swal-button--cancel:focus { box-shadow: 0 0 0 3px rgba(242, 202, 80, 0.25) !important; }

/* ปุ่มอันตราย (dangerMode เช่น ลบข้อมูล) = แดงเข้ม */
.swal-button--danger {
  background: linear-gradient(180deg, #e52535 0%, #c51b29 50%, #7d0f19 100%) !important;
  color: #fff !important;
  border: 1px solid #ff7c87 !important;
  box-shadow: 0 4px 14px rgba(197, 27, 41, 0.5) !important;
}
.swal-button--danger:focus { box-shadow: 0 0 0 3px rgba(229, 37, 53, 0.35) !important; }

/* ---------- สถานะของแจ้งเตือน (ใส่ผ่าน option className ของ swal) ----------
   แถบสีด้านบน + ขอบ + แสงเรือง ให้ลูกค้ารู้ผลทันทีแม้ไอคอนจะเป็นโลโก้เว็บ */
.swal-modal.rh-swal--success,
.swal-modal.rh-swal--checkin,
.swal-modal.rh-swal--warning,
.swal-modal.rh-swal--error { position: relative; overflow: hidden; }
.swal-modal.rh-swal--success::before,
.swal-modal.rh-swal--checkin::before,
.swal-modal.rh-swal--warning::before,
.swal-modal.rh-swal--error::before {
  content: '';
  position: absolute;
  top: 0; left: 12%; right: 12%;
  height: 3px;
  border-radius: 0 0 4px 4px;
}

/* สำเร็จ: ทองเรืองแสง (ตารางเช็คอินใช้สไตล์เดียวกัน — swal รับ className ได้คลาสเดียว) */
.swal-modal.rh-swal--success,
.swal-modal.rh-swal--checkin {
  border-color: rgba(242, 202, 80, 0.7) !important;
  box-shadow: 0 20px 40px rgba(0,0,0,0.85), 0 0 40px rgba(242,202,80,0.35) !important;
}
.swal-modal.rh-swal--success::before,
.swal-modal.rh-swal--checkin::before { background: linear-gradient(90deg, transparent, #fff5be, #f2ca50, #fff5be, transparent); }
.rh-swal--success .swal-title,
.rh-swal--checkin .swal-title { text-shadow: 0 0 18px rgba(242, 202, 80, 0.55); }

/* รับไปแล้ว: อำพัน */
.swal-modal.rh-swal--warning { border-color: rgba(251, 191, 36, 0.55) !important; }
.swal-modal.rh-swal--warning::before { background: linear-gradient(90deg, transparent, #fbbf24, transparent); }
.rh-swal--warning .swal-title { color: #fbbf24 !important; }

/* ไม่พบสมาชิก / ผิดพลาด: แดงเข้ม */
.swal-modal.rh-swal--error {
  border-color: rgba(229, 37, 53, 0.6) !important;
  box-shadow: 0 20px 40px rgba(0,0,0,0.85), 0 0 30px rgba(197,27,41,0.3) !important;
}
.swal-modal.rh-swal--error::before { background: linear-gradient(90deg, transparent, #e52535, transparent); }
.rh-swal--error .swal-title { color: #ff6b75 !important; }

.swal-button--loading { color: transparent !important; }
.swal-button__loader div { background-color: #1b1400 !important; }

/* ตารางเช็คอิน 7 วัน (หน้าโปรโมชั่น): กว้างขึ้นเล็กน้อยให้กล่อง 7 วันไม่อึดอัด และเนื้อหาชิดขอบน้อยลงบนมือถือ */
.swal-modal.rh-swal--checkin { width: min(520px, calc(100% - 20px)) !important; }
.rh-swal--checkin .swal-content { padding: 0 16px !important; margin-top: 4px !important; }

/* ปุ่ม "ติดต่อแอดมิน" คู่กับปุ่ม "ตกลง" (RHSiteContact.addSwalContactButton): กึ่งกลางคู่กัน · มือถือจอเล็กเรียงซ้อนแนวตั้ง */
.swal-footer.rh-swal-footer--pair {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.rh-swal-footer--pair .swal-button-container { margin: 0 !important; }
.rh-swal-footer--pair .swal-button,
.rh-swal-contact { min-width: 150px; }
/* สีเขียวแบบ LINE ให้ต่างจากปุ่มทอง "ตกลง" */
.rh-swal-contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 0.75rem;
  background: linear-gradient(180deg, #2fe07a 0%, #06c755 55%, #04913e 100%);
  border: 1px solid rgba(6, 199, 85, 0.7);
  border-top-color: rgba(255, 255, 255, 0.55);
  color: #fff !important;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-decoration: none !important;
  box-shadow: 0 4px 14px rgba(6, 199, 85, 0.35);
  transition: filter 0.15s, transform 0.1s;
}
.rh-swal-contact .material-symbols-outlined { font-size: 18px; line-height: 1; }
.rh-swal-contact:hover { filter: brightness(1.1); }
.rh-swal-contact:active { transform: scale(0.97); }
.rh-swal-contact:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(6, 199, 85, 0.4), 0 4px 14px rgba(6, 199, 85, 0.35); }
@media (max-width: 480px) {
  .swal-footer.rh-swal-footer--pair { flex-direction: column; align-items: stretch; }
  .rh-swal-footer--pair .swal-button-container,
  .rh-swal-footer--pair .swal-button,
  .rh-swal-contact { width: 100%; }
}

/* ป๊อปอัปกว้าง (ตารางตรวจก่อนนำเข้า RTP จาก CSV ในหน้า Admin) */
.swal-modal.rh-swal--wide { width: min(760px, calc(100vw - 32px)); }
.swal-modal.rh-swal--wide .swal-content { padding: 0 20px; margin-top: 12px; }
