/* ============================================================
   Guesty Booking Extension – Frontend Styles
   ============================================================ */

/* ── Module wrapper ─────────────────────────────────────────── */
.guesty-booking-module {
  max-width: 100%;
  margin: 0 auto;
}

/* ── Booking Form ───────────────────────────────────────────── */
.guesty-booking-form {
  background: #ffffff;
  padding: 28px 30px;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.09);
  margin-bottom: 32px;
}

.guesty-form-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
  align-items: end;
}

/* ── Fields ─────────────────────────────────────────────────── */
.guesty-field {
  display: flex;
  flex-direction: column;
}

.guesty-field > label {
  font-weight: 600;
  font-size: 13px;
  color: #333;
  margin-bottom: 6px;
}

/* ── Date Inputs ────────────────────────────────────────────── */
.guesty-date-field {
  position: relative;
}

.flatpickr-hidden-input {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.guesty-date-wrapper {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  min-height: 52px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.guesty-date-wrapper:hover {
  border-color: #aaa;
}

.guesty-date-labels {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.guesty-date-label {
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #555;
  line-height: 1.2;
  margin-bottom: 0;
  cursor: pointer;
}

.guesty-date-display {
  font-size: 14px;
  color: #222;
  margin-top: 2px;
  line-height: 1.3;
}

/* ── Room Selector ──────────────────────────────────────────── */
.guesty-rooms {
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
  min-height: 52px;
  transition: border-color 0.25s;
  width: 100%;
  appearance: auto;
}

.guesty-rooms:focus {
  outline: none;
  border-color: #0073aa;
}

/* ── Search Button ──────────────────────────────────────────── */
.guesty-book-button {
  display: block;
  padding: 14px 24px;
  background-color: #fbb03b;
  color: #1a1a1a;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  font-family: inherit;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.2s, transform 0.15s;
  width: 100%;
  min-height: 52px;
  line-height: 1.2;
}

.guesty-book-button:hover {
  background-color: #e9a02a;
  color: #1a1a1a;
  text-decoration: none;
  transform: translateY(-1px);
}

.guesty-book-button:active {
  transform: translateY(0);
}

/* ── Loading ────────────────────────────────────────────────── */
.guesty-loading {
  text-align: center;
  padding: 48px 20px;
  color: #666;
}

.guesty-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #eee;
  border-top-color: #fbb03b;
  border-radius: 50%;
  animation: guesty-spin 0.8s linear infinite;
  margin: 0 auto 14px;
}

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

/* ── Error / No Results ─────────────────────────────────────── */
.guesty-error {
  padding: 18px 22px;
  background: #fff3f3;
  border: 1px solid #f5c6c6;
  border-radius: 6px;
  color: #c0392b;
  text-align: center;
  font-size: 15px;
}

.guesty-no-results {
  padding: 48px 20px;
  text-align: center;
  color: #777;
  font-size: 16px;
}

/* ── Listing Card ───────────────────────────────────────────── */
.guesty-listing-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.09);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}

.guesty-listing-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.13);
}

/* ── Card Image ─────────────────────────────────────────────── */
.guesty-listing-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #f0f0f0;
}

.guesty-listing-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Card Content ───────────────────────────────────────────── */
.guesty-listing-content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guesty-listing-title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  color: #222;
  line-height: 1.3;
}

.guesty-listing-location {
  font-size: 13px;
  color: #777;
}

.guesty-listing-details {
  font-size: 13px;
  color: #666;
  padding: 10px 0;
  border-top: 1px solid #f0f0f0;
  border-bottom: 1px solid #f0f0f0;
}

.guesty-listing-price {
  font-size: 22px;
  font-weight: 700;
  color: #fbb03b;
}

.guesty-listing-price span {
  font-size: 14px;
  font-weight: 400;
  color: #888;
}

.guesty-listing-dates {
  font-size: 13px;
  color: #777;
}

/* Book button inside card is a link, not a form button */
.guesty-listing-card .guesty-book-button {
  margin-top: auto;
  min-height: auto;
  padding: 12px 20px;
  font-size: 15px;
}

/* ── Flatpickr overrides ────────────────────────────────────── */
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
  background: #fbb03b !important;
  border-color: #fbb03b !important;
  color: #1a1a1a !important;
}

.flatpickr-day.inRange {
  background: rgba(251, 176, 59, 0.15) !important;
  border-color: transparent !important;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 980px) {
  .guesty-results-container {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 768px) {
  .guesty-booking-form {
    padding: 20px;
  }

  .guesty-form-fields {
    grid-template-columns: 1fr;
  }

  .guesty-listing-image {
    height: 180px;
  }
}

@media (max-width: 480px) {
  .guesty-listing-image {
    height: 150px;
  }

  .guesty-listing-content {
    padding: 16px;
  }
}

