/* --------------------------------------------------
   CT_style.css - กำหนดสไตล์ CSS สำหรับเว็บไซต์ทั้งหมด
   รวมถึงสไตล์สำหรับ header, main content, grid properties, modal, ปุ่มต่าง ๆ และ responsive styles
-------------------------------------------------- */

/* Global Styles */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #ffffff;
  color: #487564;
  font-size: 16px;
}

/* Header Styles */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #487564;
  color: white;
  padding: 10px 20px;
  flex-wrap: wrap;
  text-align: center;
}
.header .logo {
  display: flex;
  align-items: center;
}
.header .logo img {
  height: 50px;
}
.header .login {
  display: flex;
  align-items: center;
}

/* Navigation Menu */
.menu {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.menu a {
  background: linear-gradient(45deg, #487564, #4a5e51);
  color: white;
  text-decoration: none;
  padding: 4px 12px;
  border-radius: 5px;
  font-size: 14px;
  transition: background-color 0.2s ease;
}
.menu a:hover {
  background: linear-gradient(45deg, #4a5e51, #487564);
}

/* Hamburger สำหรับมือถือ */
.hamburger {
  display: none; /* จะแสดงใน media query สำหรับมือถือ */
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 25px;
  cursor: pointer;
}
.hamburger div {
  width: 100%;
  height: 3px;
  background-color: white;
}

/* Main Layout */
.main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 80px; /* เพิ่มพื้นที่ว่างด้านล่างสำหรับ footer */
}
.content {
  flex: 1;
  padding: 20px;
  box-sizing: border-box;
}
.content-top, .content-middle, .content-bottom {
  padding: 20px;
  text-align: center;
}
.content-top {
  background-color: #d9f2d9;
}
.content-middle {
  background-color: #b3e6b3;
}
.content-bottom {
  background-color: #8cd98c;
}

/* Footer */
.footer {
  background-color: #487564;
  color: white;
  text-align: center;
  padding: 10px;
  position: fixed;
  bottom: 0;
  width: 100%;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4);
  padding-top: 60px;
}
.modal-content {
  background-color: #fefefe;
  margin: 5% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}
.close:hover,
.close:focus {
  color: black;
  text-decoration: none;
}

/* Properties Grid */
/* แสดง 2 item ต่อบรรทัด สำหรับทุกขนาดหน้าจอ */
.properties-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: minmax(200px, auto);
    gap: 10px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}
.property-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease-in-out;
    background-color: #fff;
}
.property-card:hover {
    transform: scale(1.05);
}
.property-images img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}
.property-name {
  font-size: 16px;
  font-weight: bold;
  margin: 10px 0;
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-height: 3.2em;
  white-space: normal;
  line-height: 1.6;
}
.property-info {
    font-size: 14px;
    margin-bottom: 6px;
}
.price-overlay {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 5px 10px;
    font-size: 0.9em;
    border-radius: 4px;
}

/* Enhanced Button Styling */
/* Button Group */
.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.button-group button {
    /* สไตล์เริ่มต้นของปุ่ม: พื้นหลังขาว, ข้อความเขียว, มีขอบ */
    background-color: #fff; /* เปลี่ยนจาก linear-gradient เป็นสีขาว */
    color: #00796b; /* สีข้อความเป็นสีเขียวเข้ม */
    border: 2px solid #b2dfdb; /* ขอบปุ่มสีฟ้าอ่อน */
    padding: 8px 18px; /* ปรับขนาด padding ให้เล็กลงเล็กน้อย */
    /* ลบ margin: 0 5px; ออกไป เพื่อให้ใช้ gap ใน .button-group ได้ดีขึ้น */
    border-radius: 20px; /* ปรับเป็น 20px เพื่อให้มุมโค้งมนมากขึ้น */
    cursor: pointer;
    transition: all 0.2s ease; /* ใช้ all เพื่อครอบคลุมทุก property */
    font-size: 0.95rem; /* ปรับขนาด font ให้เล็กลงเล็กน้อย */
    font-weight: bold;
    box-shadow: none; /* ลบ shadow ที่ไม่ต้องการ */
    text-decoration: none; /* เผื่อใช้กับ tag A */
    text-align: center;
    display: inline-block; /* เพื่อให้ padding และ border ทำงานได้ดี */
}

.button-group button:hover {
    background-color: #e0f2f1; /* สีพื้นหลังเมื่อ hover (สีฟ้าอ่อน) */
    border-color: #00796b; /* สีขอบเมื่อ hover (สีเขียวเข้ม) */
    transform: none; /* ลบ transform ที่ทำให้ปุ่มขยายออก */
    box-shadow: none; /* ลบ shadow ที่ไม่ต้องการ */
}

/* หากคุณใช้ .selected สำหรับปุ่มที่ถูกเลือกอยู่ ให้เปลี่ยนเป็น .active ใน JavaScript และปรับ CSS ดังนี้ */
.button-group button.active { 
    background-color: #00796b; /* สีพื้นหลังเมื่อถูกเลือก (สีเขียวเข้ม) */
    color: #fff; /* สีข้อความเมื่อถูกเลือก (สีขาว) */
    border-color: #00796b; /* สีขอบเมื่อถูกเลือก (สีเขียวเข้ม) */
    font-weight: bold;
    box-shadow: none; /* ลบ shadow ที่ไม่ต้องการ */
}
.button-group button.selected {
    background: #f9d342;
    color: #000;
    box-shadow: 0 0 8px rgba(249,211,66,0.8);
    border: 2px solid #f9d342;
}

/* Submit Button */
input[type="submit"] {
    background: linear-gradient(45deg, #487564, #4a5e51);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: transform 0.2s ease, background-color 0.2s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-top: 10px;
}
input[type="submit"]:hover {
    transform: scale(1.05);
    background-color: #3e6b57;
}

/* Form Group Styles */
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    width: 100%;
    margin-bottom: 5px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .menu {
        display: none;
        flex-direction: column;
        width: 100%;
    }
    .menu a {
        font-size: 14px;
        padding: 10px;
        text-align: center;
    }
    .hamburger {
        display: flex;
    }
    /* สำหรับมือถือ ให้ properties grid แสดงเป็น 2 คอลัมน์ */
    .properties-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .property-card .property-images img {
        height: 180px;
    }
}

/* --------------------------------------------------
   CT_alert.css - กำหนดสไตล์สำหรับ popup alerts
-------------------------------------------------- */
.ct-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #f0f0f0;
    color: #333;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    z-index: 1000;
    min-width: 200px;
    font-family: Arial, sans-serif;
}
.ct-alert-success {
    border-left: 5px solid green;
}
.ct-alert-error {
    border-left: 5px solid red;
}
.ct-alert-warning {
    border-left: 5px solid orange;
}
.ct-alert-info {
    border-left: 5px solid blue;
}
.ct-alert-close {
    float: right;
    cursor: pointer;
    font-weight: bold;
    margin-left: 10px;
}

/* Add this to CT_style.css */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    margin-bottom: 20px; /* เพิ่มระยะห่างด้านล่าง */
}
.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/*
 * =================================
 * Component: Advertisement Banner
 * =================================
 */
.ad-container {
    width: 100%;
    margin: 20px auto;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    background-color: #fff; /* เพิ่มสีพื้นหลังเผื่อไว้ */
    text-align: center;
    border-radius: 8px; /* ทำให้ขอบมนสวยงาม */
}

.ad-container a {
    display: inline-block;
}

.ad-image {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

/* สไตล์ตามลักษณะของภาพ */
.ad-landscape {
    /* เหมาะสำหรับแบนเนอร์ยาวๆ เต็มความกว้าง */
    width: 100%; 
}

.ad-portrait {
    /* กำหนดความกว้างไม่ให้เต็ม 100% */
    max-width: 300px;
    margin: 0 auto;
}

.ad-square {
    /* กำหนดความกว้างคงที่ */
    max-width: 400px;
    margin: 0 auto;
}