/**
 * Agoda Hotel Search CSS
 */

/* General styles */
.agoda-hotel-search {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue",
    sans-serif;
  color: #333;
  line-height: 1.5;
  max-width: 100%;
  margin: 0 auto;
  width: 100%;
}

.agoda-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}

.agoda-btn-primary {
  background-color: #6200ee;
  color: #fff;
  border: none;
}

.agoda-btn-primary:hover {
  background-color: #5000c9;
}

.agoda-btn-secondary {
  background-color: #f5f5f5;
  color: #333;
  border: 1px solid #ddd;
}

.agoda-btn-secondary:hover {
  background-color: #e5e5e5;
}

.agoda-btn-outline {
  background-color: transparent;
  color: #6200ee;
  border: 1px solid #6200ee;
}

.agoda-btn-outline:hover {
  background-color: rgba(98, 0, 238, 0.05);
}

/* Search form styles */
.agoda-hotel-search-form {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  font-family: Arial, sans-serif;
}

.agoda-hotel-search-form[data-theme="purple"] {
  background-color: #6200ee;
  color: #fff;
}

.agoda-hotel-search-form h2 {
  text-align: center;
  margin-bottom: 30px;
  color: #333;
}

.agoda-hotel-search-title {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
}

.agoda-search-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.agoda-form-row {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  gap: 1rem;
}

.agoda-field {
  display: flex;
  flex-direction: column;
}

.agoda-form-group {
  flex: 1;
  min-width: 200px;
}

.agoda-form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.agoda-field label {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 8px;
  color: #333;
}

.agoda-destination-input,
.agoda-date-input {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid #ddd;
  border-radius: 0.25rem;
  background-color: #fff;
}

.agoda-field input[type="text"],
.agoda-field input[type="date"] {
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
}

.agoda-destination-input:focus,
.agoda-date-input:focus {
  outline: none;
  border-color: #6200ee;
  box-shadow: 0 0 0 2px rgba(98, 0, 238, 0.2);
}

.agoda-dates {
  display: flex;
  gap: 20px;
}

.agoda-error {
  border-color: #d32f2f !important;
  box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.2) !important;
}

.agoda-dates .agoda-field {
  flex: 1;
}

.agoda-search-btn {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 500;
}

.guest-rooms-dropdown-wrapper {
  position: relative;
}

.agoda-guests-wrapper {
  position: relative;
}

.guest-rooms-summary {
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  background-color: #fff;
}

.agoda-guests-display {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid #ddd;
  border-radius: 0.25rem;
  background-color: #fff;
  cursor: pointer;
}

.guest-rooms-dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 15px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.agoda-guests-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 0 0 0.25rem 0.25rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  display: none;
  max-height: 80vh;
  overflow-y: auto;
}

@media (max-width: 768px) {
  .agoda-guests-dropdown {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 0.5rem;
    z-index: 1010;
  }

  .agoda-dropdown-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1005;
    display: none;
  }
}

.guest-rooms-dropdown-content.show {
  display: block;
}

.guest-rooms-dropdown-content .agoda-field {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.agoda-guests-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.age-info {
  font-size: 12px;
  font-weight: normal;
  color: #666;
}

.agoda-age-hint {
  font-size: 0.75rem;
  color: #666;
}

/* Quantity controls styling */
.quantity-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.agoda-quantity-control {
  display: flex;
  align-items: center;
}

.quantity-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #f5f5f5;
  border: 1px solid #ddd;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.agoda-quantity-btn {
  width: 2rem;
  height: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.25rem;
  background-color: #e0e0e0;
  border: 1px solid #ccc;
  border-radius: 50%;
  cursor: pointer;
  color: #333;
}

.quantity-btn:hover {
  background-color: #e9e9e9;
}

.agoda-quantity-btn:hover {
  background-color: #d0d0d0;
}

.quantity-display {
  display: inline-block;
  min-width: 30px;
  text-align: center;
  font-weight: bold;
  font-size: 16px;
}

/* Add styles for the quantity display - UPDATED */
.agoda-quantity-display {
  display: inline-block;
  width: 40px; /* Slightly wider for 2-digit support */
  height: 30px;
  text-align: center;
  font-weight: bold;
  font-size: 14px;
  margin: 0 2px;
  padding: 2px;
  line-height: 30px; /* Same as height for vertical centering */
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}


.apply-btn-wrapper {
  display: flex;
  justify-content: flex-end;
  margin-top: 15px;
}

.agoda-children-ages-container {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #ddd;
}

.apply-btn {
  padding: 8px 20px;
  background-color: #5392f9;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.agoda-children-ages-title {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.apply-btn:hover {
  background-color: #4285f4;
}

.agoda-children-ages-subtitle {
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 1rem;
}

.search-btn {
  padding: 12px;
  background-color: #5392f9;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
}

.agoda-child-age-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.search-btn:hover {
  background-color: #4285f4;
}

.agoda-child-age-select {
  width: 120px;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 0.25rem;
}

.agoda-guests-apply {
  text-align: right;
  margin-top: 1rem;
}

/* Autocomplete styles */
.agoda-autocomplete-wrapper {
  position: relative;
}

.agoda-autocomplete-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1000;
  max-height: 300px;
  overflow-y: auto;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 0 0 0.25rem 0.25rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  display: none;
}

.agoda-autocomplete-item {
  padding: 0.75rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.agoda-autocomplete-item:hover {
  background-color: #f5f5f5;
}

.agoda-autocomplete-loading {
  padding: 0.75rem;
  text-align: center;
  color: #666;
}

/* Toggle search form button */
.agoda-toggle-search-form {
  margin-bottom: 1rem;
}

.agoda-toggle-icon {
  display: inline-block;
  margin-right: 0.5rem;
  transition: transform 0.2s;
}

/* Search results styles */
.agoda-hotel-search-results {
  margin-top: 2rem;
  width: 100%;
}

.agoda-search-container {
  width: 100%;
}

.agoda-results-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  width: 100%;
}

.agoda-filters-sidebar {
  width: 250px;
  padding: 1rem;
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.agoda-results-container {
  flex: 1;
  min-width: 0;
  width: 100%;
}

.agoda-filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.agoda-filters-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.agoda-btn-close-filters {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  display: none;
}

.agoda-filter-group {
  margin-bottom: 1.5rem;
}

.agoda-filter-group h4 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1rem;
  font-weight: 600;
}

.agoda-price-range {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.agoda-price-slider {
  margin-bottom: 1rem;
}

.agoda-star-filters,
.agoda-amenity-filters,
.agoda-review-filters {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.agoda-checkbox,
.agoda-radio {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.agoda-stars {
  color: #ffc107;
}

.agoda-filter-actions {
  margin-top: 1.5rem;
}

.agoda-mobile-filter-toggle {
  display: none;
  margin-bottom: 1rem;
  gap: 0.5rem;
}

.agoda-results-header {
  margin-bottom: 1.5rem;
}

.agoda-results-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.agoda-hotel-card {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  width: 100%;
}

.agoda-hotel-image {
  width: 200px;
  height: 150px;
  margin-right: 1rem;
  margin-bottom: 1rem;
}

.agoda-hotel-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0.25rem;
}

.agoda-hotel-details {
  flex: 1;
  min-width: 200px;
  margin-right: 1rem;
  margin-bottom: 1rem;
}

.agoda-hotel-name-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.agoda-hotel-name {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.agoda-hotel-stars {
  color: #ffc107;
  font-size: 1rem;
}

.agoda-hotel-amenities {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.agoda-amenity {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
}

.agoda-hotel-review {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.agoda-review-score {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background-color: #6200ee;
  color: #fff;
  border-radius: 0.25rem;
  font-weight: 600;
}

.agoda-review-count {
  font-size: 0.875rem;
  color: #666;
}

.agoda-hotel-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  min-width: 150px;
}

.agoda-price-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: #6200ee;
}

.agoda-price-night {
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 1rem;
}

.agoda-book-btn {
  width: 100%;
  text-align: center;
}

.agoda-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 0;
}

.agoda-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(98, 0, 238, 0.1);
  border-left-color: #6200ee;
  border-radius: 50%;
  animation: agoda-spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes agoda-spin {
  to {
    transform: rotate(360deg);
  }
}

.agoda-no-results,
.agoda-error-message {
  padding: 2rem;
  text-align: center;
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Responsive styles */
@media (max-width: 768px) {
  .agoda-dates {
    flex-direction: column;
    gap: 15px;
  }

  .guest-rooms-dropdown-content {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    border-radius: 10px 10px 0 0;
    z-index: 1000;
  }

  .agoda-filters-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    z-index: 1001;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    padding-bottom: 80px; /* Add extra padding at the bottom for scrolling */
  }

  .agoda-filters-visible {
    transform: translateX(0);
  }

  .agoda-btn-close-filters {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    width: 40px;
    height: 40px;
    background-color: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  }

  .agoda-mobile-filter-toggle {
    display: flex;
  }

  .agoda-hotel-card {
    flex-direction: column;
  }

  .agoda-hotel-image {
    width: 100%;
    margin-right: 0;
  }

  .agoda-hotel-details {
    margin-right: 0;
  }

  .agoda-hotel-price {
    width: 100%;
    align-items: flex-start;
  }

  /* Add a fixed close button at the bottom of the filter sidebar */
  .agoda-mobile-close-button {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #6200ee;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1002;
    display: none;
  }

  .agoda-filters-visible .agoda-mobile-close-button {
    display: block;
  }

  /* Add a backdrop for the filter sidebar */
  .agoda-filter-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
  }

  .agoda-filter-backdrop.visible {
    display: block;
  }
}
