/* Đảm bảo sử dụng tên class đã đổi nếu bạn đổi ở HTML */
.search-container-custom {
  display: flex;
  align-items: center;
  width: 100%; /* Hoặc đặt chiều rộng cố định nếu muốn */
  max-width: 600px; /* Ví dụ: giới hạn chiều rộng tối đa */
  height: 60px;
  background: rgba(255, 255, 255, 0.1); /* translucent white */
  backdrop-filter: blur(6px); /* blur background */
  -webkit-backdrop-filter: blur(6px);
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  margin: 10px auto; /* Căn giữa nếu cần */
}

.search-container-custom .dropdown-section {
  display: flex;
  align-items: center;
  /*padding: 0px;*/
  padding-top: 15px;
  border-right: 1px solid rgba(255, 255, 255, 0.2); /* Thêm đường kẻ phân cách nếu muốn */
}

.search-container-custom .input-section {
  flex: 1;
  display: flex;
  align-items: center;
  padding-top: 15px;
  /* Bỏ padding ở đây vì các nhóm con sẽ có padding riêng hoặc input tự giãn */
  /* padding: 0 10px; */
  /* Đảm bảo input-section có thể chứa các nhóm input */
  min-width: 0; /* Giúp flexbox xử lý tràn nội dung tốt hơn */
}

.search-container-custom select {
  border: none;
  outline: none;
  font-size: 14px;
  background: transparent; /* Thử nền trong suốt để lấy nền của dropdown-section */
  color: rgb(255, 255, 255); /* Màu chữ trắng */
  padding-right: 20px; /* Thêm khoảng trống cho mũi tên dropdown (nếu có) */
  appearance: none; /* Ẩn giao diện mặc định của trình duyệt */
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  /* Cân nhắc thêm mũi tên tùy chỉnh nếu muốn */
}

 /* Đổi màu nền cho option để dễ nhìn hơn khi xổ xuống */
.search-container-custom select option {
    background: rgba(50, 50, 50, 0.9); /* Màu nền tối hơn */
    color: white;
}

/* Định dạng chung cho các nhóm input */
.search-container-custom .input-group {
  display: flex; /* Để các input trong nhóm nằm ngang */
  width: 100%;   /* Chiếm toàn bộ chiều rộng của input-section */
  align-items: center; /* Căn giữa các input theo chiều dọc nếu chúng có chiều cao khác nhau */
  padding: 0 10px; /* Thêm lại padding ở đây */
}

/* Định dạng cho các input bên trong nhóm */
.search-container-custom .input-group input[type="text"] {
  flex: 1; /* Chia sẻ không gian đều nhau */
  /* width: 100%; Không cần width 100% nữa vì flex: 1 đã xử lý */
  border: none;
  outline: none;
  font-size: 14px;
  background: transparent;
  color: rgb(255, 255, 255);
  /* Thêm một chút margin giữa các input nếu có nhiều hơn 1 */
  margin-right: 8px;
}

/* Loại bỏ margin cho input cuối cùng trong nhóm */
.search-container-custom .input-group input[type="text"]:last-child {
  margin-right: 0;
}

/* Class để ẩn các nhóm không hoạt động */
.search-container-custom .hidden {
  display: none !important;
}

.search-container-custom input::placeholder {
  color: rgba(255, 255, 255, 0.6); /* Màu placeholder rõ hơn một chút */
}

.search-container-custom .search-button {
  width: 40px;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  padding: 0;
  padding-top: 15px;
  border-left: 1px solid rgba(255, 255, 255, 0.2); /* Thêm đường kẻ phân cách nếu muốn */
}

.search-container-custom .search-button:hover {
  color: rgb(255, 255, 255); /* Màu trắng sáng khi hover */
  /* background: rgba(255, 255, 255, 0.1); */ /* Thêm hiệu ứng nền nhẹ khi hover */
}

.search-container-custom .search-button svg {
    display: block; /* Đảm bảo SVG hiển thị đúng */
}

/* Media queries cho thiết bị di động */
@media screen and (max-width: 767px) {
  .search-container-custom {
    max-width: 100%; /* Chiếm toàn bộ chiều rộng trên điện thoại */
    width: calc(100% - 20px); /* Trừ đi một chút margin hai bên */
    margin: 10px 10px; /* Margin ngang để không sát với viền điện thoại */
  }
  
  /* Giảm padding để tiết kiệm không gian */
  .search-container-custom .dropdown-section {
    padding: 0 5px;
  }
  
  /* Giảm font-size của select */
  .search-container-custom select {
    font-size: 13px;
  }
  
  /* Điều chỉnh padding của nhóm input */
  .search-container-custom .input-group {
    padding: 0 5px;
  }
  
  /* Giảm font-size của input */
  .search-container-custom .input-group input[type="text"] {
    font-size: 13px;
  }
  
  /* Chuyển hướng các input trong nhóm city và year về hiển thị dọc */
  .search-container-custom .input-group-city,
  .search-container-custom .input-group-year {
    flex-direction: column;
    align-items: stretch;
    padding-top: 5px;
    padding-bottom: 5px;
  }
  
  /* Điều chỉnh margin và cách hiển thị cho các input trong nhóm dọc */
  .search-container-custom .input-group-city input[type="text"],
  .search-container-custom .input-group-year input[type="text"] {
    margin-right: 0;
    margin-bottom: 5px;
  }
  
  /* Loại bỏ margin bottom cho input cuối cùng */
  .search-container-custom .input-group-city input[type="text"]:last-child,
  .search-container-custom .input-group-year input[type="text"]:last-child {
    margin-bottom: 0;
  }
  
  /* Tăng chiều cao của container khi có 2 input hiển thị dọc */
  .search-container-custom .input-group-city.active,
  .search-container-custom .input-group-year.active {
    height: auto;
  }
  
  /* Tăng chiều cao của thanh tìm kiếm khi hiển thị 2 input dọc */
  .search-container-custom.expanded {
    height: auto;
    min-height: 40px;
  }
}

/* Media queries cho điện thoại màn hình rất nhỏ */
@media screen and (max-width: 375px) {
  /* Thu nhỏ icon tìm kiếm nếu cần */
  .search-container-custom .search-button {
    width: 32px;
  }
  
  /* Giảm thêm font-size nếu cần */
  .search-container-custom select,
  .search-container-custom .input-group input[type="text"] {
    font-size: 12px;
  }
}

/* Kiểu dáng cho thông báo lỗi */
.search-container-custom .error-message {
  color: #ff6b6b;
  font-size: 12px;
  padding: 0 10px;
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  border-radius: 3px;
  padding: 3px 8px;
  white-space: nowrap;
}

/* Căn lề phía trên đồng đều cho tất cả các phần tử con chính */
.search-container-custom > div,
.search-container-custom > button {
  padding-top: 3px;
}
