:root {
  --primary-color: #3498db;
  --secondary-color: #2ecc71;
  --bg-light: #f4f6f7;
  --text-dark: #2c3e50;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
  height: 100vh; 
  
}

.profile-container {
  background: white;
  border-radius: 15px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 900px;
  padding: 30px;
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 25px;
  border-bottom: 2px solid var(--bg-light);
  padding-bottom: 15px;
}

.header h2 {
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.8rem;
}

.token-section {
  background: var(--bg-light);
  border-radius: 10px;
  padding: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.token-display {
  flex-grow: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 15px;
}

.search-container {
  position: relative;
  margin-bottom: 20px;
}

#searchInput {
  width: 100%;
  padding: 12px 15px 12px 40px;
  border: 1px solid #e0e0e0;
  border-radius: 25px;
  font-size: 16px;
  background-color: white;
  transition: all 0.3s ease;
}

#searchInput:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #a0a0a0;
}

#roomData {
  max-height: 610px;
  overflow-y: auto;
  border-radius: 10px;
  background: var(--bg-light);
  padding: 5px;
}

.room-item {
  background: white;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.3s ease;
}

.room-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.room-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.room-item-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.copy-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 20px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.copy-btn:hover {
  background-color: #2980b9;
}

.badge {
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: bold;
  margin-left: 8px;
  line-height: 1.2;
  vertical-align: middle;
}
.room-item-header h3 {
  display: flex;
  align-items: center;
  font-size: 1rem;
}
.badge.official {
  background-color: #f39c12;
  color: white;
}
.badge.chat {
  background-color: #2ecc71;
  color: white;
}
.badge.group {
  background-color: #3498db;
  color: white;
}

.input-group {
  font-family: "Prompt";
  display: flex;
  flex-direction: column;
  margin-bottom: 15px;
}

.input-group label {
  font-family: "Prompt";
  font-weight: bold;
  margin-bottom: 5px;
}

.input-group input {
  font-family: "Prompt" f;
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 16px;
}

.login-container {
  background: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); /* เพิ่มเงา */
  border: 2px solid #ddd; /* เพิ่มกรอบ */
  width: 100%;
  max-width: 400px;
  text-align: center;
}

/* หัวข้อ */
.login-container h2 {
  margin-bottom: 20px;
  font-size: 24px;
  color: #333;
}

/* ช่องป้อนข้อมูล */
.input-group {
  font-family: "Prompt";
  text-align: left;
  margin-bottom: 15px;
}

.input-group label {
  font-family: "Prompt";
  font-weight: bold;
  display: block;
  margin-bottom: 5px;
}

.input-group input {
  font-family: "Prompt";
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 16px;
}

/* ปุ่มยืนยัน */
button {
  background: linear-gradient(135deg, #4a90e2, #6a5acd); /* ฟ้า -> ม่วง */
  color: white;
  font-weight: bold;
  padding: 12px 20px;
  border: none;
  border-radius: 25px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

button:hover {
  background: linear-gradient(135deg, #6a5acd, #4a90e2); /* ม่วง -> ฟ้า */
  transform: scale(1.05);
}

/* ลิงก์ขอ OTP ใหม่ */
.note {
  margin-top: 10px;
  font-size: 14px;
}

.note a {
  color: #3498db;
  text-decoration: none;
}

.note a:hover {
  text-decoration: underline;
}

.input-group input[type="number"] {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 2px solid #ddd;
  border-radius: 10px;
  background-color: #f8f9fa;
  transition: all 0.3s ease;
}

.input-group input[type="number"]:focus {
  border-color: #ff758c;
  box-shadow: 0 0 5px rgba(255, 117, 140, 0.5);
  background-color: white;
}

/* สไตล์สำหรับช่องกรอกจำนวนรอบและ destructTime */
.input-group input[type="number"] {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 2px solid #ddd;
  border-radius: 10px;
  background-color: #f8f9fa;
  transition: all 0.3s ease;
  text-align: center;
}

/* เอฟเฟกต์เมื่อโฟกัส */
.input-group input[type="number"]:focus {
  border-color: #ff758c;
  box-shadow: 0 0 5px rgba(255, 117, 140, 0.5);
  background-color: white;
  outline: none;
}

.send-options {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 10px;
}

.send-options label {
  font-size: 14px;
  font-weight: bold;
  color: var(--text-dark);
}

.send-options input {
  flex: 1;
  max-width: 150px;
  padding: 12px;
  font-size: 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
  background-color: #f8f9fa;
  text-align: center;
  transition: all 0.3s ease;
}

/* เอฟเฟกต์เมื่อโฟกัส */
.send-options input:focus {
  border-color: #ff758c;
  box-shadow: 0 0 5px rgba(255, 117, 140, 0.5);
  background-color: white;
  outline: none;
}

.send-options button {
  flex: 0 0 auto;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  background: linear-gradient(135deg, #4a90e2, #6a5acd); /* ฟ้า -> ม่วง */
  color: white;
  border: none;
  transition: all 0.3s;
}

.send-options button:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, #6a5acd, #4a90e2); /* ม่วง -> ฟ้า */
}

/* ปรับปรุงปุ่มยืนยัน */
#actionBtn {
  width: 100%;
  padding: 12px 15px;
  font-size: 16px;
  font-weight: bold;
  border: none;
  border-radius: 8px; /* ทำให้โค้งเล็กน้อย */
  cursor: pointer;
  background: linear-gradient(
    135deg,
    #4a90e2,
    #6a5acd
  ); /* ฟ้า -> ม่วง (เข้ากับเว็บ) */
  color: white;
  transition: all 0.3s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#actionBtn:hover {
  background: linear-gradient(135deg, #6a5acd, #4a90e2); /* ม่วง -> ฟ้า */
  transform: scale(1.05);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.room-actions {
  display: flex;
  justify-content: flex-start; /* จัดปุ่มไปทางซ้าย */
  gap: 10px; /* ระยะห่างระหว่างปุ่ม */
  margin-top: 10px;
}

/* ปุ่มคัดลอก */
.copy-btn {
  background-color: #2ecc71; /* สีเขียว */
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  display: flex;
  align-items: center;
  gap: 8px;
}

.copy-btn:hover {
  background-color: #27ae60;
}

/* ปุ่มส่งข้อความ */
.send-btn {
  background-color: #f39c12; /* สีส้ม */
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  display: flex;
  align-items: center;
  gap: 8px;
}

.send-btn:hover {
  background-color: #e67e22;
}

/* ปรับขนาดไอคอน */
.copy-btn i,
.send-btn i {
  font-size: 16px;
}

.profile-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.profile-info img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid var(--primary-color);
}

.dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dialog-box {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.dialog-box button {
  display: block;
  width: 100%;
  margin: 10px 0;
  padding: 10px;
  border: none;
  border-radius: 5px;
  background: #ff4d4d;
  color: white;
  font-size: 16px;
}

.dialog-box button:last-child {
  background: #ddd;
  color: black;
}

.more-btn {
  background-color: #6c757d;
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  display: flex;
  align-items: center;
  gap: 8px;
}

.more-btn:hover {
  background-color: #5a6268;
}

/* Modal Box */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  width: 400px;
  text-align: center;
  position: relative;
}

.modal-content h2 {
  margin-bottom: 15px;
}

.close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
}

.delete-btn {
  background-color: #ff4d4d;
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 5px;
  cursor: pointer;
}

.delete-btn:hover {
  background-color: #cc0000;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  width: 400px;
  text-align: center;
  position: relative;
}

.modal-content h2 {
  margin-bottom: 15px;
}

.close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
}

#sendList {
  text-align: left;
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 15px;
  padding: 0;
}

#sendList li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px;
  background: #f8f9fa;
  margin-bottom: 5px;
  border-radius: 5px;
}

.delete-item-btn {
  background-color: #ff4d4d;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
}

.delete-item-btn:hover {
  background-color: #cc0000;
}

.cancel-item-btn {
  background-color: #6c757d;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
}

.cancel-item-btn:hover {
  background-color: #5a6268;
}
.action-select {
  padding: 5px;
  font-size: 14px;
  border-radius: 5px;
  border: 1px solid #ccc;
  background: white;
  cursor: pointer;
}

.action-select:hover {
  border-color: #3498db;
}

.modal-buttons {
  display: flex;
  justify-content: flex-end; /* ทำให้ปุ่มชิดขวา */
  gap: 10px;
  margin-top: 15px;
}

.cancel-send-btn {
  background-color: #f39c12; /* สีส้ม */
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  display: flex;
  align-items: center;
  gap: 10px;
}

#messageCount {
  width: 1จ0px; /* กำหนดความกว้างเพิ่มขึ้น */
  padding: 10px; /* เพิ่ม Padding ให้ดูสวยงาม */
  font-size: 16px; /* ขยายขนาดตัวอักษร */
  border: 2px solid #ddd;
  border-radius: 8px;
  text-align: center; /* จัดเลขให้อยู่ตรงกลาง */
}

.log-messages {
  max-height: 200px; /* ปรับขนาดให้พอดี */
  overflow-y: auto; /* ทำให้เลื่อนดูได้ */
  background: #f9f9f9;
  padding: 10px;
  border-radius: 5px;
  margin-top: 10px;
  border: 1px solid #ddd;
  text-align: left;
}

#logSection {
  margin-top: 15px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #ddd;
}

#logSection h4 {
  font-size: 16px;
  font-weight: bold;
  color: #2c3e50;
  margin-bottom: 10px;
}

.log-messages {
  max-height: 150px;
  overflow-y: auto;
  background: #fff;
  padding: 10px;
  border-radius: 5px;
  border: 1px solid #ddd;
  font-size: 14px;
}

progress {
  width: 100%;
  height: 10px;
  border-radius: 5px;
  background: #ddd;
  appearance: none;
}

progress::-webkit-progress-bar {
  background: #ddd;
  border-radius: 5px;
}

progress::-webkit-progress-value {
  background: linear-gradient(90deg, #4a90e2, #6a5acd);
  border-radius: 5px;
}

progress::-moz-progress-bar {
  background: linear-gradient(90deg, #4a90e2, #6a5acd);
  border-radius: 5px;
}

#rainCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: -1; /* ให้แน่ใจว่าหิมะอยู่ข้างหลัง UI */
}

.logo {
    width: 280px; /* ปรับขนาดโลโก้ */
    height: auto; /* ให้ความสูงปรับอัตโนมัติ */
    display: block;
    margin: 0 auto 20px; /* จัดให้อยู่ตรงกลางและเพิ่มระยะห่างด้านล่าง */
}
.bg-gif {
    position: fixed;
    right: -70px; /* ขวาสุด */
    bottom: -210px; /* ล่างสุด */
    width: auto; /* ปรับขนาดอัตโนมัติ */
    height: 700px; /* หรือกำหนดขนาดตามต้องการ */
    z-index:
     -1; /* อยู่ข้างหลังเนื้อหา */
     transform:  rotate(-20deg); 
}

/* ตั้งค่าวิดีโอเป็นพื้นหลัง */
/* ตั้งค่าวิดีโอเป็นพื้นหลัง */
.bg-video {
    position: fixed;
    top: 50%;
    left: 50%;
    width: auto;
    height: 50vh; /* ปรับสูงสุดได้ */
    max-width: 30vw; /* ป้องกันกว้างเกินไป */
    max-height: 45vh; /* ป้องกันสูงเกินไป */
    transform: translate(-50%, -50%);
    object-fit: cover;
    z-index: -1;
    border-radius: 20px; 
}

/* ตั้งค่า login-container ให้โปร่งใสบางส่วน */
.login-container {
    position: relative;
    z-index: 1; /* ให้อยู่ข้างหน้าวิดีโอ */
    background: rgba(255, 255, 255, 0.9); /* ปรับความโปร่งใส */
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 40px 30px rgba(0, 0, 0, 0.5);
}

.mobile-image {
    position: absolute; /* ให้อยู่ที่ตำแหน่งแน่นอน */
    left: -15%; /* ตำแหน่งจากขอบซ้าย */
    top: 15%; /* ให้อยู่กึ่งกลางแนวตั้ง */
    transform: translateY(-20%); /* จัดให้อยู่ตรงกลางของหน้าจอ */
    width: 920px; /* ปรับขนาดรูปภาพ */
    height: auto; /* ให้ความสูงอัตโนมัติ */
    z-index: -1; /* ให้อยู่เหนือวิดีโอ */
}

.nav-menu {
    position: fixed;
    top: 15px; /* ลดระยะห่างจากขอบบน */
    right: 20px; /* ลดระยะห่างจากขอบขวา */
    z-index: 10; /* ให้อยู่ข้างบนสุด */
}

.nav-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1px; /* ลดระยะห่างระหว่างเมนู */
}

.nav-menu ul li {
    display: inline;
}

.nav-menu ul li a {
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
    color: white; /* สีข้อความเมนู */
    padding: 10px 15px;
    border-radius: 5px;
    transition: background 0.3s ease-in-out;
}

.nav-menu ul li a:hover {
    background: rgba(255, 255, 255, 0.2); /* ทำให้เมนูไฮไลท์เมื่อชี้ */
    color: #ffcc00; /* เปลี่ยนสีข้อความเมื่อโฮเวอร์ */
}

.st-image {
    position: fixed; /* ให้รูปอยู่ตำแหน่งเดิมขณะเลื่อน */
    right: -140px; /* อยู่ชิดขอบขวา 20px */
    top: 39%; /* จัดให้อยู่ตรงกลางแนวตั้ง */
    transform: translateY(-50%) scaleX(-1) rotate(0deg); /* พลิกแนวตั้ง + เอียง */
    width: 500px; /* ปรับขนาดรูป */
    height: auto; /* ให้คงอัตราส่วนเดิม */
    z-index: -1; /* ให้อยู่ข้างหน้าพื้นหลัง */
}