/* ==========================================================
   DIZZY COMPASS – Cleaned & Optimised Stylesheet (Nov 2025)
   ========================================================== */

:root {
  --bg: #f8f8f8;
  --panel: #ffffff;
  --text: #222;
  --muted: #666;
  --gold: #c6a449;
  --gold-2: #a99136;
  --card: #ffffff;
  --border: #e5e5e5;
  --shadow: rgba(0, 0, 0, 0.06);
  --font-heading: "Playfair Display", serif;
  --font-body: "Nunito Sans", sans-serif;
  --accent: var(--gold);
  --primary: var(--gold);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

/* ----------------------------------------------------------
   HEADER
---------------------------------------------------------- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.brand {
  font-weight: 700;
  font-family: var(--font-heading);
  font-size: 22px;
}
.brand span { color: var(--gold); }
.nav a { margin-left: 20px; color: var(--muted); font-weight: 500; }
.nav a.active { color: var(--gold); }

/* ----------------------------------------------------------
   HERO SECTION
---------------------------------------------------------- */
.page-header {
  position: relative;
  min-height: 300px;
  height: 260px;
  background: url('https://source.unsplash.com/1600x900/?luxury,hotel') center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  transition: background-image 0.6s ease-in-out, opacity 0.8s ease;
}
.page-header.loading { opacity: 0; }

.page-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.35), rgba(0,0,0,0.15));
}
.page-header .header-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 0 20px;
}
.page-header h1 {
  font-family: var(--font-heading);
  font-size: 42px;
  margin-bottom: 10px;
  font-weight: 600;
}
.page-header p {
  font-size: 17px;
  color: #f2f2f2;
}

/* ----------------------------------------------------------
   FILTERS
---------------------------------------------------------- */
.filters {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 24px 0 16px;
  box-shadow: 0 4px 10px var(--shadow);
  margin: 25px auto;
  max-width: 1200px;
  text-align: center;
}

.filter-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

.filter-row select.select {
  flex: 1 1 200px;
  max-width: 230px;
  min-width: 180px;
  padding: 8px 10px;
  font-size: 0.95rem;
}

.select {
  appearance: none;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  padding: 10px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.select:focus,
.select:hover {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(198, 164, 73, 0.15);
  outline: none;
}

.amenity-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 8px;
}
.amenity-row label {
  font-size: 0.95rem;
  color: #333;
  white-space: nowrap;
}

.filter-actions {
  text-align: center;
  margin-top: 15px;
}

#reset-filters {
  background-color: #c7a349;
  color: #fff;
  border: none;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}
#reset-filters:hover { background-color: #b28f37; }

/* ----------------------------------------------------------
   GRID & TILE CARDS
---------------------------------------------------------- */
.grid {
  position: relative;
  display: block;       /* Virtual renderer controls child layout */
  margin: 40px auto 0;
  max-width: 1200px;    /* keeps tiles nicely centred */
  min-height: 400px;    /* avoids collapse before JS render */
}


.tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  height: 545px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

.tile-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #f3f3f3;
  flex-shrink: 0;
}
.tile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.4s ease-in-out;
}

.tile-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding: 12px 14px 16px;
}

.tile-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  margin: 6px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 40px;
}

.tile-sub {
  color: #777;
  font-size: 13px;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-stars { color: #f9a825; font-size: 14px; margin-bottom: 4px; }

.amenities-row {
  display: flex;
  flex-wrap: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  gap: 5px;
  max-width: 100%;
}
.amenities-row i {
  flex: 0 0 auto;
  font-size: 13px;
}

.trip-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 6px 0;
}
.trip-row img.trip-logo {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.9;
}

.tile-nights {
  font-size: 0.9em;
  color: var(--gold);
  margin-top: 4px;
  font-style: italic;
}

.tile-price {
  color: var(--accent);
  font-weight: 600;
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15px;
}

.tile-buttons {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.tile-buttons button {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  padding: 10px 14px;
  transition: all 0.2s ease;
}
.btn-details {
  background: #fff;
  color: #c7a546;
  border: 2px solid #c7a546;
}
.btn-details:hover {
  background: #c7a546;
  color: #fff;
}
.btn-quote {
  background: #c7a546;
  color: #fff;
  border: 2px solid #c7a546;
}
.btn-quote:hover {
  background: #b6973e;
  border-color: #b6973e;
}

/* ----------------------------------------------------------
   MODALS / OVERLAYS
---------------------------------------------------------- */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.7);
  z-index: 9999;
  transition: opacity 0.3s ease;
}
.modal.hidden { display: none; }

.modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 0 15px rgba(0,0,0,0.3);
  text-align: center;
}
.close-modal {
  position: absolute;
  right: 16px;
  top: 12px;
  font-size: 24px;
  cursor: pointer;
}

/* ----------------------------------------------------------
   HUD & SUCCESS OVERLAY
---------------------------------------------------------- */
#hud {
  position: fixed;
  bottom: 10px;
  left: 12px;
  font-size: 13px;
  font-weight: 500;
  color: #b9935a;
  background: rgba(255, 255, 255, 0.9);
  padding: 6px 10px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.4s ease;
}

#quote-success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
#quote-success-overlay.visible {
  opacity: 1;
  pointer-events: all;
}
.success-content {
  background: #fff;
  border-radius: 14px;
  padding: 30px 40px;
  text-align: center;
  max-width: 360px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
  animation: popIn 0.4s ease;
}
.success-content .checkmark {
  font-size: 48px;
  color: #2ecc71;
  margin-bottom: 10px;
}
@keyframes popIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ----------------------------------------------------------
   RESPONSIVE
---------------------------------------------------------- */
@media(max-width:900px) {
  .filter-row { flex-direction: column; align-items: center; }
}
@media(max-width:480px) {
  .filter-row select.select { width: 100%; max-width: none; }
  .amenity-row { justify-content: flex-start; }
}
/* ---------- VIRTUAL GRID CONTAINER ---------- */
.grid {
  position: relative;         /* required for absolute children */
  display: block;             /* JS controls tile placement */
  width: 100%;
  max-width: 1200px;
  margin: 40px auto 0;
  min-height: 400px;
  overflow: hidden;
}

/* ---------- TILE CARD BASE (GPU friendly) ---------- */
.tile {
  position: absolute;
  width: 280px;               /* controlled by JS anyway */
  height: 545px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  overflow: hidden;
  will-change: transform;
  contain: layout paint;
  backface-visibility: hidden;
  transform: translateZ(0);   /* GPU acceleration */
  transition: none !important; /* prevent scroll reflows */
}

/* Optional: subtle hover without affecting scroll perf */
.tile:hover .tile-image img {
  filter: brightness(0.95);
}

/* ---------- TILE IMAGE ---------- */
.tile-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #f3f3f3;
}
.tile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- TILE BODY ---------- */
.tile-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: calc(100% - 200px);
  padding: 12px 14px 16px;
}
/* ===========================
   FILTER PANEL – PREMIUM RESTORE
=========================== */
.filters {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  padding: 24px 0 18px;
  margin: 30px auto 40px;
  max-width: 1200px;
}

/* top row */
.filter-row.top-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 20px;
  max-width: 1000px;
  margin: 0 auto 16px;
  padding: 0 24px;
}

/* second row */
.filter-row.second-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px 20px;
  max-width: 1000px;
  margin: 0 auto 16px;
  padding: 0 24px;
  border-top: 1px solid #eee;
  padding-top: 16px;
}

/* selects */
.select {
  appearance: none;
  background: #fff;
  border: 1px solid #ddd;
  color: #222;
  font-size: 15px;
  padding: 10px 14px;
  border-radius: 6px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.select:focus, .select:hover {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(198,164,73,0.15);
  outline: none;
}

/* amenities grid */
.filters .amenities {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 24px;
  margin-top: 12px;
}
.filters .amenities label {
  font-size: 14px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* reset button alignment */
.filter-actions {
  display: flex;
  justify-content: flex-end;
  margin: 12px 30px 0;
}
#reset-filters {
  background: var(--gold);
  color: #fff;
  border: none;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.25s ease;
}
#reset-filters:hover {
  background: var(--gold-2);
}

/* section title */
#results-title {
  text-align: center;
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 600;
  margin: 0 auto 40px;
  color: #222;
}
