body{
  margin: 0;
  padding: 0;
}

.contact-sections {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
  color: white;
  position: relative;
  overflow: hidden;
} 

.tfoot{
  background-color: #ffd700;
  height: 150px;
  margin: 10px 10px 0 10px;
  border-radius: 15px;
}

.header {
  text-align: center;
  width: 80%;      /* หรือกำหนดเป็น 1200px, 80% ฯลฯ */
  height: 300px;   
  padding: 0rem;    
}

.header h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-top: 50px;
  background: linear-gradient(to right, #FFD90D, #998208);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header p {
  font-size: clamp(0.5rem, 4vw, 1.5rem);
  color: #998208;
}

.contactas {
  width: 90%;
  max-width: 1200px;
  height: auto;
  min-height: 200px;
  background: #1D1D1D;
  margin-bottom: 1rem;
  font-family: 'Inter', sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  box-sizing: border-box;
  flex-wrap: wrap;
}

.button-container {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.social-group {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.social-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to right, #001f4d, #0052cc);
  border-radius: 15px;
  padding: 10px 20px;
  color: white;
  text-decoration: none;
  min-width: 280px;
  min-height: 60px;
  transition: background 0.3s ease;
  box-sizing: border-box;
}

.social-button span {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
}

.social-button .icon-circle {
  background-color: white;
  color: black;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  font-weight: 700;
  transition: transform 0.5s ease;
  cursor: pointer;
}

.extra-info {
  margin-top: 8px;
  background-color: #001c40;
  color: white;
  border: 2px solid orange;
  border-radius: 12px;
  padding: 10px 20px;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.4s ease;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 300px;
  justify-content: flex-start;
  box-sizing: border-box;
}

.extra-info.show {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.rotate {
  transform: rotate(360deg);
}





/* -------------------- Responsive -------------------- */
@media screen and (max-width: 768px) {
  .header {
    width: 100%;
    padding: 0 10px;
    height: auto;
    text-align: center; /* ✅ จัดข้อความใน header ให้อยู่กลาง */
  }

  .header h1 {
    font-size: 1.8rem;
    margin-top: 20px;
  }

  .header p {
    font-size: 1rem;
  }

  .social-button {
    flex: 1 1 45%; /* 🔹 2 ปุ่มต่อแถว */
    max-width: 45%;
    min-width: 160px;
    justify-content: center;
    padding: 10px;
    font-size: 0.9rem;
  }

  .button-container {
    gap: 10px;
    justify-content: center; /* ✅ จัดกลุ่มปุ่มให้อยู่กลาง */
  }

  .extra-info {
    font-size: 14px;
    max-width: 250px;
  }
}

@media screen and (max-width: 480px) {
  .social-button {
    flex: 1 1 100%; /* 🔹 1 ปุ่มต่อแถว */
    max-width: 100%;
    min-width: auto;
  }

  .header h1 {
    font-size: 1.5rem;
  }

  .header p {
    font-size: 0.85rem;
  }

  .extra-info {
    font-size: 12px;
    padding: 8px 12px;
  }
}




.contact-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  max-width: 1200px;
  width: 100%;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 4rem;
}

.contact-form {
  flex: 1;
  min-width: 300px;
  background: rgba(255, 255, 255, 0.1);
  padding: 2rem;
  border-radius: 15px;
  backdrop-filter: blur(10px);
}

.contact-form h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  color: #00aaff;
  margin-bottom: 1rem;
  text-shadow: 0 0 10px #00aaff;
}

.form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

.form-group label {
  display: block;
  font-size: 1.2rem;
  color: #998208;
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
  width: 85%;
  padding: 0.8rem;
  padding-right: 2.5rem;
  border: 2px solid transparent;
  border-radius: 15px;
  background: linear-gradient(#ffffff, #ffffff) padding-box,
              linear-gradient(to right, #FFD90D, #FFD90D) border-box;
  color: black;
  font-family: 'Kanit', sans-serif;
  transition: all 0.3s ease;
  background-clip: padding-box, border-box;
  background-origin: padding-box, border-box;
  box-shadow: inset 0 5px 10px rgba(0, 0, 0, 0.3);
  box-sizing: border-box; /* เพิ่ม box-sizing เพื่อการคำนวณขนาดที่แม่นยำ */
}

.form-group input:focus,
.form-group textarea:focus {
  box-shadow: 0 0 10px #FFD90D;
  outline: none;
}

.form-group input.disabled,
.form-group textarea.disabled {
  background: rgba(255, 255, 255, 0.1);
  color: #888;
  cursor: not-allowed;
}

.lock-icon {
  position: absolute;
  right: 10px;
  top: 70%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: #888;
  display: none;
}

.form-group textarea + .lock-icon {
  top: 40px;
}

.contact-form button {
  width: 50%;
  padding: 1rem;
  background: linear-gradient(to bottom, #FFD90D, #FFA200);
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  display: block;
  margin: 2rem auto 0;
  border: 2px solid #FFA200;
  border-radius: 8px;
}

.contact-form button:hover {
  background: #FFD90D;
  box-shadow: 0 0 20px #FFD90D, 0 0 40px #FFD90D;
  transform: scale(1.05);
}

.contact-form button.shake {
  animation: shake 0.3s ease;
}

.contact-form button.disabled {
  background: #FFD90D;
  cursor: not-allowed;
  opacity: 0.7;
}

.contact-form button.disabled.shake {
  animation: hardShake 0.15s ease;
}


/* ==========================================================
   ✅ START: โค้ดสำหรับปรับให้รองรับมือถือ (Responsive)
   ========================================================== */
@media (max-width: 768px) {
    .contact-container {
        justify-content: center; /* 🔹 Key: จัดฟอร์มและส่วนอื่นๆ ให้อยู่กลาง */
        padding: 0 1rem; /* เพิ่มระยะห่างจากขอบจอ */
        box-sizing: border-box;
    }

    .contact-form {
        padding: 1.5rem; /* ลด padding ในฟอร์มลงเล็กน้อย */
    }

    .contact-form h1 {
        text-align: center; /* จัดหัวข้อให้อยู่กลาง */
    }

    .form-group input,
    .form-group textarea {
        width: 100%; /* 🔹 Key: ทำให้ช่องกรอกเต็มความกว้าง */
    }

    .lock-icon {
        /* ปรับตำแหน่งไอคอน lock ให้สัมพันธ์กับความกว้างใหม่ */
        right: 15px; 
    }

    .contact-form button {
        width: 80%; /* 🔹 Key: ขยายปุ่มให้ใหญ่ขึ้น กดง่าย */
    }
}



/* ====================================== */
.contact-info {
  flex: 1;
  min-width: 300px;
  padding-top: 7rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 2rem;
  border: 2px solid #FFD90D;
  border-radius: 15px;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  min-height: 525px;
}
.contact-info h1{
  color: #000;
  text-align: center;
  margin-bottom: 50px;
}

.boxcontact {
  height: 60px;
  width: 200px;
  background-color: rgb(255, 255, 255);
  border-radius: 15px;
  box-shadow: inset 0 5px 10px rgba(0, 0, 0, 0.3); 
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 3rem;
  /* เพิ่ม margin auto เพื่อให้ box อยู่กลางในกรณีที่ parent ไม่ใช่ flex */
  margin-left: auto;
  margin-right: auto;
}

.boxcontact h2{
  color: #998208;
  font-size: 1.2rem;
  margin: 0;
}

.contact-in {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.boxcontact2 {
    flex-shrink: 0;
    width: 100px;
    height: 60px;
    background-color: rgb(255, 255, 255);
    border-radius: 15px;
    box-shadow: inset 0 5px 10px rgba(0, 0, 0, 0.3); 
    display: flex;
    justify-content: center;
    align-items: center;
}

.boxcontact2 i {
    font-size: 2.5rem;
    color: #FFD700;
}

.contact-text {
    font-size: 1.2rem;
    color: #000000;
    font-family: 'Kanit', sans-serif;
}

/* แต่ละรายการข้อมูล */
.info-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.info-item i {
  font-size: 1.5rem;
  color: #FFD700; /* สีไอคอนเขียวอ่อน */
  flex-shrink: 0;
}

.info-item p {
  font-size: 1rem;
  color: #222;
  line-height: 1.4;
  margin: 0;
}

.info-item strong {
  color: #FFD700;
}


/* ==========================================================
   ✅ START: โค้ดสำหรับปรับให้รองรับมือถือ (Responsive)
   ========================================================== */
@media (max-width: 768px) {
    .contact-info {
        padding: 2rem 1.5rem; /* ลด padding ด้านบนออก และปรับด้านข้าง */
        min-height: auto; /* 🔹 Key: ยกเลิกความสูงขั้นต่ำ */
        
        /* 🔹 Key: ใช้ Flex จัดทุกอย่างในกล่องนี้ให้อยู่กลาง */
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .contact-info h1 {
        margin-bottom: 2rem; /* ลดระยะห่าง */
        font-size: 1.8rem; /* ลดขนาดฟอนต์ */
    }

    .boxcontact {
        margin-bottom: 2rem;
        /* ไม่ต้องใช้ margin auto แล้ว เพราะ parent เป็น flex */
    }

    .contact-in {
        gap: 1.5rem;
        width: 100%; /* ทำให้เต็มความกว้างของ container */
        align-items: center; /* จัด item ให้อยู่กลาง */
    }

    .contact-item {
        flex-direction: column; /* 🔹 Key: ทำให้ไอคอนและข้อความเรียงแนวตั้ง */
        text-align: center;
        gap: 0.5rem;
    }

    .boxcontact2 {
        width: 80px; /* ลดขนาดกล่องไอคอน */
        height: 50px;
    }
    
    .boxcontact2 i {
        font-size: 2rem; /* ลดขนาดไอคอน */
    }

    .contact-text {
        font-size: 1rem; /* ลดขนาดฟอนต์ */
    }
}

/* ================================================ */

.services{
  height: 200px;
  width: 550px;
}

.services h6{
  font-size: 1.2rem;
  text-align: center;
  color: #998208;
}

.services p {
  font-size: 1rem;
  color: #998208;
  text-align: center;
}

.map-container {
    width: 50%;
    height: 300px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    transition: all 0.3s ease;
    /* margin: 1rem 10rem 1rem 10rem; */
}

.map-container:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 170, 255, 0.3);
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* ================= Responsive ================= */
@media screen and (max-width: 768px) {
  .contact-info {
    padding: 1.5rem;
    min-height: auto;
  }

  .boxcontact {
    width: 150px;
    height: 50px;
    margin-bottom: 2rem;
  }

  .contact-item {
    flex-direction: column; /* 🔹 ซ้อนในมือถือ */
    align-items: center;
    text-align: center;
  }

  .boxcontact2 {
    width: 80px;
    height: 50px;
  }

  .contact-text {
    font-size: 1rem;
  }

  .services {
    width: 100%;
    margin: 1.5rem auto;
  }

  .map-container {
        width: 90%;     /* เกือบเต็มจอ */
        height: 400px;  /* สูงขึ้นเพื่อดูชัด */
        margin: 1rem auto; /* จัดให้อยู่กึ่งกลาง */
    }
    .map-overlay {
        width: 100%;
        height: 100%;
    }
}

@media screen and (max-width: 480px) {
  .boxcontact {
    width: 120px;
    height: 45px;
  }

  .boxcontact h2 {
    font-size: 1rem;
  }

  .boxcontact2 {
    width: 70px;
    height: 45px;
  }

  .boxcontact2 i {
    font-size: 2rem;
  }

  .contact-text {
    font-size: 0.95rem;
  }

  .services h6 {
    font-size: 1rem;
  }

  .services p {
    font-size: 0.9rem;
  }

  .map-container {
    height: 200px;
  }
}


/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-card {
    background: #fff;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-card h2 {
    color: #00aaff;
    margin-bottom: 1rem;
}

.modal-card p {
    color: #333;
    margin-bottom: 1.5rem;
}

.modal-button-row {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

/* Main Modal Button (กลับไปที่หน้าหลัก) */
#modalButton {
    padding: 0.8rem 1.5rem;
    background: #0056B3;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 86, 179, 0.4);
}

#modalButton:hover {
    background: #0077cc;
    box-shadow: 0 0 20px #00ccff;
    transform: translateY(-2px);
}

/* Resend Button Styles (พิมพ์ข้อความใหม่) */
.resend-btn {
    padding: 0.8rem 1.5rem;
    background: transparent;
    color: #0056B3;
    border: 2px solid #0056B3;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.resend-btn:hover:not(.disabled) {
    background: #0056B3;
    color: white;
    box-shadow: 0 0 20px #00ccff;
    transform: translateY(-2px);
}

.resend-btn.disabled {
    color: #888;
    border-color: #888;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Shake Animation */
@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

/* Hard Shake Animation (สั่นแรงมาก) */
@keyframes hardShake {
    0% { transform: translateX(0); }
    10% { transform: translateX(-12px); }
    20% { transform: translateX(12px); }
    30% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    50% { transform: translateX(-8px); }
    60% { transform: translateX(8px); }
    70% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
    90% { transform: translateX(-4px); }
    100% { transform: translateX(0); }
}

/* Countdown Popup (ไม่ใช้แล้ว แต่เก็บไว้เผื่ออนาคต) */
.countdown-popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    z-index: 1100;
    display: none;
}


.call-button {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background: #00aaff;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 170, 255, 0.4);
    margin-top: 0.5rem;
}

.call-button:hover {
    background: #0077cc;
    box-shadow: 0 0 20px #00ccff;
    transform: translateY(-2px);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: none; /* ซ่อนก่อน */
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.modal-card {
  background: #fff;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  text-align: center;
  min-width: 250px;
}

/* Spinner โหลด */
.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #FFD238;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  margin: 0 auto 1rem;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

/* ไอคอนถูก */
.checkmark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-block;
  background: #4CAF50;
  position: relative;
  margin: 0 auto 1rem;
}
.checkmark::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 8px;
  width: 10px;
  height: 20px;
  border: solid #fff;
  border-width: 0 4px 4px 0;
  transform: rotate(45deg);
}
