/* search-styles.css — search.xeitobook.com */

:root {
  --color-primary: hsl(0deg 0% 98%);
  --color-secondary: hsl(24deg 100% 50%);
  --color-dark: hsl(0, 0%, 15%);
  --color-gray-light: hsl(0deg 0% 88%);
  --color-bg: hsl(0deg 0% 95%);
  --color-bg-grey-light: hsl(0deg 0% 92%);
  --color-text-black: hsl(0, 0%, 8%);
  --color-text-muted: hsl(0deg 0% 50%);
  --color-error: hsl(0deg 85% 60%);
  --color-success: hsl(143 60% 42%);
  --color-stripe: hsl(248 98% 61%);
  --gradient-stripe: linear-gradient(20deg, hsl(248 98% 61%) 0%, hsl(248 98% 72%) 100%);
  --gradient-orange: linear-gradient(20deg, hsl(24deg 100% 50%) 25%, hsl(24deg 100% 62%) 100%);
  --corner: 12px;
  --corner-sm: 8px;
  --shadow-card: hsl(0deg 0% 0% / 6%) 0px 2px 16px, hsl(0deg 0% 0% / 4%) 0px 0px 0px 1px;
  --shadow-header: hsl(0deg 0% 0% / 8%) 0px 2px 12px;
}

body.dark-theme {
  --color-primary: hsl(0, 0%, 10%);
  --color-bg: hsl(0, 0%, 7%);
  --color-bg-grey-light: hsl(0, 0%, 16%);
  --color-gray-light: hsl(0, 0%, 22%);
  --color-text-black: hsl(0deg 0% 94%);
  --color-text-muted: hsl(0, 0%, 60%);
  --shadow-card: hsl(0deg 0% 0% / 30%) 0px 2px 20px, hsl(0deg 0% 100% / 5%) 0px 0px 0px 1px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--color-bg);
  color: var(--color-text-black);
  min-height: 100vh;
}

/* ── Header ── */
.search-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-primary);
  box-shadow: var(--shadow-header);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 24px;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--color-text-black);
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--color-bg-grey-light);
  border: 1.5px solid var(--color-gray-light);
  border-radius: var(--corner);
  padding: 6px 10px;
  flex: 1;
  max-width: 600px;
  flex-wrap: nowrap;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.filter-field label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.filter-field input {
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-black);
  outline: none;
  cursor: pointer;
  width: 100%;
}

.filter-field input::placeholder { color: var(--color-text-muted); }

.filter-divider {
  width: 1px;
  height: 28px;
  background: var(--color-gray-light);
  flex-shrink: 0;
  margin: 0 4px;
}

.filter-guests { flex: 0 0 auto; }

.guests-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.g-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--color-gray-light);
  background: var(--color-primary);
  color: var(--color-text-black);
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}

.g-btn:hover:not(:disabled) { background: var(--color-gray-light); }
.g-btn:disabled { opacity: 0.3; cursor: not-allowed; }

#fGuestsVal {
  font-size: 13px;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
}

.btn-filter-search {
  background: var(--gradient-stripe);
  color: #fff;
  border: none;
  border-radius: var(--corner-sm);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.2s, transform 0.15s;
  white-space: nowrap;
}

.btn-filter-search:hover { opacity: 0.9; transform: translateY(-1px); }

/* ── Main ── */
.results-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

.results-meta {
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* ── Loading / Error ── */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 20px;
  color: var(--color-text-muted);
  font-size: 15px;
}

.spinner-lg {
  width: 36px;
  height: 36px;
  border: 3px solid var(--color-gray-light);
  border-top-color: var(--color-stripe);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.error-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-error);
  font-size: 15px;
}

/* ── Grid ── */
.accommodations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* ── Card ── */
.accommodation-card {
  background: var(--color-primary);
  border-radius: var(--corner);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: fadeUp 0.35s ease both;
}

.accommodation-card:hover {
  transform: translateY(-3px);
  box-shadow: hsl(0deg 0% 0% / 10%) 0px 8px 28px;
}

.accommodation-card.unavailable {
  opacity: 0.6;
  pointer-events: none;
}

.accommodation-card.unavailable:hover {
  transform: none;
  box-shadow: var(--shadow-card);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--color-bg-grey-light);
  display: block;
}

.card-image-placeholder {
  width: 100%;
  height: 200px;
  background: var(--color-bg-grey-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 36px;
}

.card-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-black);
  line-height: 1.3;
}

.card-location {
  font-size: 12px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.card-tag {
  font-size: 11px;
  padding: 3px 8px;
  background: var(--color-bg-grey-light);
  border-radius: 20px;
  color: var(--color-text-muted);
  font-weight: 500;
}

.card-footer {
  padding: 12px 18px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--color-gray-light);
  gap: 12px;
}

.card-price {
  display: flex;
  flex-direction: column;
}

.card-price-amount {
  font-size: 20px;
  font-weight: 800;
  color: var(--color-text-black);
  font-variant-numeric: tabular-nums;
}

.card-price-label {
  font-size: 11px;
  color: var(--color-text-muted);
}

.btn-book {
  background: var(--gradient-stripe);
  color: #fff;
  border: none;
  border-radius: var(--corner-sm);
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  white-space: nowrap;
}

.btn-book:hover:not(:disabled) { opacity: 0.9; transform: translateY(-1px); }

.btn-book:disabled {
  background: var(--color-gray-light);
  color: var(--color-text-muted);
  cursor: not-allowed;
  transform: none;
}

.availability-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  margin-bottom: 4px;
}

.badge-available {
  background: hsl(143 60% 42% / 12%);
  color: var(--color-success);
}

.badge-unavailable {
  background: hsl(0deg 85% 60% / 10%);
  color: var(--color-error);
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: hsl(0deg 0% 0% / 60%);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  position: relative;
  background: transparent;
  width: 100%;
  max-width: 512px;
  height: 912px;
}

.modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: none;
  background: var(--color-text-black);
  color: var(--color-primary);
  font-size: 14px;
  cursor: pointer;
  z-index: 10;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; 
  animation: closeFadeIn 0.5s ease-in forwards;
  animation-delay: 1s;
}

@keyframes closeFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

#bookingIframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ── Utilities ── */
.hidden { display: none !important; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .search-header { padding: 10px 14px; gap: 10px; }
  .filter-bar { max-width: 100%; }
  .results-main { padding: 20px 14px 40px; }
  .accommodations-grid { grid-template-columns: 1fr; }
  .modal-box { height: 100vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}