/* ===== 1. ANIMATIONS AND TRANSITIONS ===== */
/* กำหนด keyframes สำหรับการเคลื่อนไหวต่างๆ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

@keyframes rotateIcon {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ===== 2. HOVER EFFECTS ===== */
/* ปรับปุ่มต่างๆ ให้มีลูกเล่นเมื่อ hover */
.register-btn {
  transition: all 0.3s ease;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.register-btn:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.4s ease;
  z-index: -1;
}

.register-btn:hover:before {
  left: 0;
}

.register-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* ปรับปุ่มทั่วไปให้มีลูกเล่น แต่ไม่รวม photo_btn */
button:not(.photo_btn), .btn, a.btn {
  transition: all 0.3s ease;
}

button:not(.photo_btn):hover, .btn:hover, a.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

button:not(.photo_btn):active, .btn:active, a.btn:active {
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Photo button special hover effect */
.photo_btn {
  transition: all 0.3s ease;
}

.photo_btn:hover {
  transform: translateX(-50%) scale(1.05);
  opacity: 0.8;
}

.photo_btn:hover span {
  animation: pulse 1s infinite;
}

/* ลูกเล่นสำหรับปุ่มที่มีไอคอน */
.notification-btn button, .thb-btn button, .language-btn button {
  transition: all 0.3s ease;
  overflow: hidden;
}

.notification-btn button:hover, .thb-btn button:hover, .language-btn button:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  background-color: rgba(255, 255, 255, 0.1);
}

.notification-btn button:hover img, .thb-btn button:hover img, .language-btn button:hover img {
  animation: rotateIcon 0.5s ease;
}

/* Fixed buttons ลูกเล่น */
.fixed-btns .btn_item {
  transition: all 0.3s ease;
}

.fixed-btns .btn_item:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Card hover effect */
.card-item {
  transition: all 0.4s ease;
  position: relative;
  top: 0;
}

.card-item:hover {
  top: -10px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.card-thumbnail {
  overflow: hidden;
}

.card-thumbnail img {
  transition: transform 0.5s ease;
}

.card-item:hover .card-thumbnail img {
  transform: scale(1.05);
}

/* Hover effects for sport/category items */
.sport-item {
  transition: all 0.3s ease;
}

.sport-item:hover {
  transform: translateY(-7px);
}

.sport-item img {
  transition: all 0.3s ease;
}

.sport-item:hover img {
  transform: scale(1.1);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* ===== 3. INTERACTIVE ELEMENTS ===== */
/* Hero section animation */
.hero-slide-item {
  position: relative;
  overflow: hidden;
}

.hero-slide-item:after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.6));
  opacity: 0;
  transition: opacity 0.5s ease;
}

.hero-slide-item:hover:after {
  opacity: 1;
}

.hero-wrapper {
  animation: fadeIn 0.8s ease-out forwards;
}

.hero-logo {
  animation: float 3s ease-in-out infinite;
}

/* Search box animation */
.search-box, .check-in-out, .room-info {
  transition: all 0.3s ease;
}

.search-box:focus-within, .check-in-out:focus-within, .room-info:focus-within {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.search-box input, .checkin-box input {
  transition: all 0.3s ease;
}

.search-box input:focus, .checkin-box input:focus {
  padding-left: 15px;
}

/* ===== 4. SCROLL ANIMATIONS ===== */
/* Add these classes to elements you want to animate on scroll */
.scroll-fade-in {
  opacity: 0;
  animation: fadeIn 0.8s ease-out forwards;
  animation-play-state: paused;
}

.scroll-slide-up {
  opacity: 0;
  transform: translateY(30px);
  animation: slideInUp 0.8s ease-out forwards;
  animation-play-state: paused;
}

.scroll-fade-in.animate, .scroll-slide-up.animate {
  animation-play-state: running;
}

/* ===== 5. DETAILED SECTION ANIMATIONS ===== */
/* Properties Detail Page */

/* Overview section */
.overview-title h3 {
  position: relative;
  display: inline-block;
}

.overview-title h3:after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 0;
  height: 3px;
  background: #007bff; /* ปรับสีตามที่ใช้ในเว็บไซต์ */
  transition: width 0.4s ease;
}

.overview-title h3:hover:after {
  width: 100%;
}

/* Highlight boxes */
.highlight-box {
  transition: all 0.3s ease;
  overflow: hidden;
}

.highlight-box:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.highlight-box:after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.highlight-box:hover:after {
  opacity: 1;
}

/* Facilities and Amenities list */
.facilities-lists ul li, .location-lists ul li {
  transition: all 0.3s ease;
  position: relative;
  padding-left: 25px;
}

.facilities-lists ul li:before, .location-lists ul li:before {
  content: '•';
  position: absolute;
  left: 0;
  transition: all 0.3s ease;
  opacity: 0.7;
}

.facilities-lists ul li:hover, .location-lists ul li:hover {
  transform: translateX(5px);
  color: #007bff; /* ปรับสีตามที่ใช้ในเว็บไซต์ */
}

.facilities-lists ul li:hover:before, .location-lists ul li:hover:before {
  opacity: 1;
  color: #007bff; /* ปรับสีตามที่ใช้ในเว็บไซต์ */
}

/* Map interaction */
.location-map {
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

.location-map:hover {
  transform: scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.location-map:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 123, 255, 0.1); /* ปรับสีตามที่ใช้ในเว็บไซต์ */
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
  pointer-events: none;
}

.location-map:hover:before {
  opacity: 1;
}

/* Reserve box effect */
.reserve-box-top {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.reserve-box-top:hover {
  background-color: #001f3f; /* Navy blue */
}

.reserve-box-top:after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(13,110,253,0.15), rgba(13,110,253,0.05));
  transition: all 0.5s ease;
}

.reserve-box-top:hover:after {
  top: 0;
}

.reserve-btn button {
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

.reserve-btn button:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
  transition: all 0.8s ease;
}

.reserve-btn button:hover:before {
  left: 100%;
}

/* Review section ปรับปรุงตามรูปภาพที่ 3 */
/* กล่องรีวิวหลัก */
.review-card {
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  padding: 20px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
  border: 1px solid #f0f0f0;
}

.review-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
  border-color: #e0e7ff;
}

/* ส่วนหัวของรีวิว */
.review-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.reviewer-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  margin-right: 15px;
  border: 2px solid #1a73e8;
  transition: all 0.3s ease;
}

.review-card:hover .reviewer-avatar {
  transform: scale(1.1);
  box-shadow: 0 5px 15px rgba(26, 115, 232, 0.2);
}

.reviewer-info {
  flex: 1;
}

.reviewer-name {
  font-weight: bold;
  font-size: 17px;
  margin: 0 0 3px;
  color: #333;
}

.reviewer-meta {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: #777;
}

.review-date {
  margin-left: 10px;
}

/* ดาวคะแนน */
.rating-stars {
  display: flex;
  margin-left: auto;
}

.star-yellow {
  color: #ffb800;
  width: 24px;
  height: 24px;
  transition: all 0.3s ease;
}

.review-card:hover .star-yellow {
  transform: rotate(20deg) scale(1.1);
}

/* รูปภาพในรีวิว */
.review-images {
  display: flex;
  gap: 10px;
  margin: 15px 0;
  flex-wrap: wrap;
}

.review-image {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  transition: all 0.3s ease;
}

.review-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.3s ease;
}

.review-card:hover .review-image {
  transform: translateY(-2px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

.review-card:hover .review-image img {
  transform: scale(1.05);
}

.review-image-count {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  transition: all 0.3s ease;
}

.review-image-count:hover {
  opacity: 1;
}

/* ข้อความรีวิว */
.review-text {
  margin: 10px 0;
  color: #555;
  line-height: 1.6;
}

/* คะแนนดาว */
.rating-number {
  font-size: 20px;
  font-weight: bold;
  color: #ffb800;
  background: #fff8e5;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(255, 184, 0, 0.1);
  transition: all 0.3s ease;
}

.review-card:hover .rating-number {
  transform: scale(1.1) rotate(10deg);
  box-shadow: 0 5px 15px rgba(255, 184, 0, 0.2);
}

/* อนิเมชั่นรีวิว */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.review-area .review-card {
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

.review-area .review-card:nth-child(1) {
  animation-delay: 0.1s;
}

.review-area .review-card:nth-child(2) {
  animation-delay: 0.2s;
}

.review-area .review-card:nth-child(3) {
  animation-delay: 0.3s;
}

.review-area .review-card:nth-child(4) {
  animation-delay: 0.4s;
}

/* Pagination ปรับแต่งตามรูปภาพที่ 3 */
.pagination-wrapper {
  display: flex;
  justify-content: center;
  margin: 30px 0;
}

.pagination-wrapper ul {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 5px;
}

.pagination-wrapper li {
  margin: 0 3px;
}

.pagination-wrapper li a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s ease;
  text-decoration: none;
  background-color: #f0f4ff;
  color: #1a73e8;
}

.pagination-wrapper li.active a,
.pagination-wrapper li a:hover {
  background-color: #1a73e8;
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(26, 115, 232, 0.3);
}

.pagination-wrapper li.prev a,
.pagination-wrapper li.next a {
  width: 40px;
  height: 40px;
  background-color: #fff;
  color: #1a73e8;
  border: 1px solid #e0e7ff;
}

.pagination-wrapper li.prev a:hover,
.pagination-wrapper li.next a:hover {
  background-color: #1a73e8;
  color: white;
  border-color: #1a73e8;
}

/* Policies section */
.policies-card {
  transition: all 0.3s ease;
}

.policies-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.policies-card-icon {
  transition: all 0.3s ease;
}

.policies-card:hover .policies-card-icon {
  transform: scale(1.05);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}


/* ===== 7. ADDITIONAL EFFECTS FOR DETAILS PAGE ===== */
/* สำหรับภาพในแกลเลอรี่ */
.gallery-item {
  overflow: hidden;
  position: relative;
}

.gallery-item img {
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

.gallery-item:after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,0.3));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover:after {
  opacity: 1;
}

/* บริเวณรูปภาพและแกลเลอรี่หลัก */
.main-gallery {
  position: relative;
}

.main-gallery:after {
  content: 'คลิกเพื่อดูเพิ่มเติม';
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 10px 15px;
  border-radius: 5px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.main-gallery:hover:after {
  opacity: 1;
}

/* เพิ่มลูกเล่นหรือ Badge สำหรับ Promotion */
.promo-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  background: linear-gradient(45deg, #ff512f, #dd2476);
  color: white;
  padding: 10px 15px;
  border-radius: 5px;
  transform: rotate(5deg);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  z-index: 10;
  transition: all 0.3s ease;
}

.promo-badge:hover {
  transform: rotate(0) scale(1.1);
}

/* Pagination hover effect */
.pagination-wrapper li a {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.pagination-wrapper li a:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 70%);
  transform: scale(0);
  opacity: 0;
  transition: all 0.4s ease;
}

.pagination-wrapper li a:hover:before {
  transform: scale(2);
  opacity: 1;
}

.pagination-wrapper li a:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* ===== 8. RESPONSIVE IMPROVEMENTS ===== */
@media (max-width: 768px) {
  /* ปรับแต่ง animations ให้เบาลงบนมือถือเพื่อประสิทธิภาพ */
  .card-item:hover {
    top: -5px;
  }
  
  .sport-item:hover {
    transform: translateY(-3px);
  }
  
  .highlight-box:hover {
    transform: translateY(-2px) scale(1.02);
  }
  
  /* ปรับ touch feedback สำหรับมือถือ */
  button:not(.photo_btn):active, .btn:active, a.btn:active {
    transform: scale(0.98);
    opacity: 0.9;
  }
  
  .photo_btn:active {
    transform: translateX(-50%) scale(0.95);
    opacity: 0.7;
  }
  
  .search-box:focus-within, .check-in-out:focus-within, .room-info:focus-within {
    transform: translateY(-2px);
  }
}