@import url("popups.css");

h1,
h2,
h3,
h4,
h5,
h6 {
  color: #0280e5;
}

body {
  margin: 0;
  padding: 0;
  background-color: #e0f7ff;
  /*font-family: Arial, Helvetica, sans-serif;
    /*font-family: "Outfit";*/
  /*font-family: "Commissioner";*/
  font-family: "Red Hat Text", Arial, Helvetica, sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
}

.hero-section {
  flex-grow: 0; /* Ensures it keeps its natural height */
}

.content-container {
  flex: 1; /* Allows these sections to grow to fill the space */
}

#footer-container {
  flex-shrink: 0; /* Footer remains at the bottom */
}

.navbar {
  position: sticky;
  bottom: 0;
  width: 100%;
  background-color: #f8f9fa;
  /* Ensure additional styles for the navbar */
}
.page-heading {
  font-size: 32px;
  font-weight: bold;
  text-align: center;
  margin: 40px 0;
  color: #0280e5;
}

.section-heading {
  text-align: center;
  font-size: 24px;
  margin-top: 40px;
  margin-bottom: 20px;
  color: #0280e5;
}

/* ----- Content Container ----- */
.content-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ----- Navigation Bar Styles ----- */

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #0280e5;
  padding: 15px;
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.navbar-content {
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 20px; /* Add padding to match content container */
  box-sizing: border-box;
}

.logo-container {
  background-color: #72c0ff;
  border-radius: 25px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  height: 50px;
  margin-right: 20px;
  gap: 8px;
}

.logo {
  height: 40px;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  font-weight: bold;
  font-size: 16px;
  color: #0280e5;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.profile-container {
  background-color: #72c0ff;
  border-radius: 25px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  height: 50px;
  gap: 8px;
  cursor: default;
  overflow: visible;
  position: relative;
}

.profile-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  font-weight: bold;
  font-size: 16px;
  color: #0280e5;
  text-align: left;
  pointer-events: none;
}

.profile-icon-wrapper {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  flex-shrink: 0;
  align-self: center;
  position: relative;
}

.profile-icon {
  height: 56px;
  width: 56px;
  cursor: pointer;
  display: block;
  position: absolute;
  top: -5px;
  left: -5px;
}

nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}

nav ul li {
  cursor: pointer;
}

nav ul li a {
  text-decoration: none;
  color: inherit;
}

.nav-button {
  display: inline-block;
  padding: 10px 30px;
  background-color: #cee8fb;
  color: #0280e5;
  font-weight: bold;
  border-radius: 25px;
  font-size: 16px;
  text-transform: lowercase;
  cursor: pointer;
  transition: background-color 0.3s;
}

.nav-button:hover {
  background-color: #72c0ff;
}

/* ----- Hero Section Styles ----- */

.hero-section {
  position: relative;
  height: 600px;
  background-image: url("assets/luggala-lodge.jpg");
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.title-container {
  background-color: #cee8fb;
  border-radius: 25px;
  padding: 30px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
}

.title {
  color: #0280e5;
  text-align: center;
  font-size: 48px;
  font-weight: bold;
  text-shadow: none;
  margin: 0 0 20px 0;
}

.search-container {
  position: relative;
  z-index: 2;
}

.search-spinner {
  display: none;
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: 3px solid rgba(30, 120, 255, 0.25);
  border-top-color: rgba(30, 120, 255, 0.9);
  border-radius: 50%;
  animation: search-spin 0.7s linear infinite;
  pointer-events: none;
  z-index: 3;
}

.search-spinner.visible {
  display: block;
}

@keyframes search-spin {
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

@keyframes profile-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 42, 100, 1);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(255, 42, 100, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 42, 100, 0);
  }
}

.profile-pulse {
  animation: profile-pulse 1.5s ease-out infinite;
  border-radius: 50%;
}

@keyframes arrowBob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}

/* Above everything else on the page: the mobile menu (999) and popups
   (999–1001). Taps pass through it to whatever is underneath. */
#profile-prompt {
  position: absolute;
  right: 40px;
  top: 100%;
  z-index: 1100;
  pointer-events: none;
  opacity: 0.9;
  animation: arrowBob 1s ease-in-out infinite;
}

.search-input {
  padding: 10px;
  width: 350px;
  border: none;
  border-radius: 25px;
  font-size: 18px;
  color: #333;
  background-color: white;
  box-shadow: 0 0 20px 5px rgba(255, 42, 100, 0.6);
  display: inline-block;
}

.suggestions {
  border-radius: 10px;
  overflow-y: auto;
  max-height: 250px;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  margin-top: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: none;
}

.suggestion-item:first-child {
  border-top-left-radius: 10px; /* Round top-left corner */
  border-top-right-radius: 10px; /* Round top-right corner */
}

.suggestion-item:last-child {
  border-bottom-left-radius: 10px; /* Round bottom-left corner */
  border-bottom-right-radius: 10px; /* Round bottom-right corner */
}

.suggestion-item {
  padding: 10px 15px;
  cursor: pointer;
}

.suggestion-item:hover {
  background-color: #f0f0f0;
}

.suggestion-item.selected {
  background-color: #e0e0e0;
}

/* ----- Property Card Styles ----- */

/* Grid of fixed-width cards centred in the page. A grid (rather than a
   wrapping flex row) lets the Map View button span the columns and line up
   with the first card however many cards fit per row. */
.property-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, 300px);
  gap: 20px;
  padding: 0 0 20px 0;
  justify-content: center;
}

/* .content-container shrinks to fit its content, and an auto-fill grid only
   asks for one column, so make this container fill the row explicitly.
   Same footprint as before: 1000px of content plus 20px padding each side. */
.featured-properties {
  box-sizing: border-box;
  width: 100%;
  max-width: 1040px;
}

.property-cards > .map-view-button {
  grid-column: 1 / -1;
  justify-self: start;
  margin-bottom: 0;
}

.property-card {
  width: 300px;
  border: none;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  text-align: center;
  position: relative;
  background-color: white;
}

.property-card.new::after {
  content: "NEW!";
  position: absolute;
  top: 15px;
  right: 15px;
  background-color: #ff2a64;
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 14px;
  font-weight: bold;
}

.property-image-wrapper {
  position: relative;
  width: 100%;
  height: 200px;
}

.property-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.property-image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.property-image-wrapper:hover .property-image-overlay,
.search-result-image-wrapper:hover .property-image-overlay {
  opacity: 1;
}

.property-image-ai {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.property-image-ai-label {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.85);
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.property-image-unavailable {
  width: 100%;
  height: 100%;
  background-color: #d8d8d8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #888;
}

.property-details {
  padding: 15px;
}

/* ----- Image Comparison Slider ----- */

.image-slider-wrapper {
  cursor: col-resize;
  user-select: none;
}

.slider-ai-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  will-change: clip-path;
}

.slider-handle {
  position: absolute;
  top: 0;
  height: 100%;
  width: 3px;
  background: rgba(255, 255, 255, 0.9);
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.slider-handle-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  gap: 3px;
  flex-shrink: 0;
}

.slider-arrow {
  font-size: 10px;
  color: #444;
  line-height: 1;
}

.slider-label {
  position: absolute;
  top: 8px;
  font-size: 11px;
  font-weight: 600;
  color: white;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 7px;
  border-radius: 3px;
  pointer-events: none;
  z-index: 5;
}

.slider-label-original {
  left: 8px;
}

.slider-label-ai {
  right: 8px;
}

.property-details h3,
.property-details h4 {
  font-size: 18px;
  margin: 10px 0;
  color: inherit;
}

.property-details p {
  margin: 5px 0;
  color: #555;
}

/* ----- BER Rating Image Styling ----- */

.ber-image {
  height: 16px;
  margin: 4px 0;
}

/* ----- Service Card Styles ----- */

.service-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 20px 0;
  justify-content: center;
  align-items: center;
}

.service-cards-inner {
  display: contents;
}

.service-card {
  width: 400px;
  border: none;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  text-align: center;
  cursor: pointer;
  margin-bottom: 20px;
  position: relative;
  background-color: white;
  display: flex;
  flex-direction: column;
}

.service-card.horizontal {
  flex-direction: row;
  width: 600px;
  text-align: left;
}

.service-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  flex-shrink: 0;
}

.service-card.horizontal .service-image {
  width: 250px;
  height: auto;
}

.service-details {
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
}

.service-card.horizontal {
  background-color: #0280e5;
  box-shadow: 0 0 20px 5px rgba(255, 42, 100, 0.9);
}

.service-card.horizontal .service-details {
  justify-content: center;
  padding: 20px;
}

.service-card.horizontal .service-details h3,
.service-card.horizontal .service-subtitle {
  color: white;
}

.service-details h3 {
  font-size: 16px;
  margin: 10px 0;
}

.service-card.horizontal .service-details h3 {
  font-size: 24px;
}

.service-subtitle {
  font-size: 14px;
  color: #666;
  margin: 5px 0 0 0;
  text-align: center;
}

.service-card.horizontal .service-subtitle {
  font-size: 18px;
  text-align: center;
}

/* ----- Site Feature Styles ----- */

.site-feature {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.3s;
}

.site-feature:hover {
  transform: scale(1.05);
}

.site-feature.therapy-bot {
  width: 240px;
  height: 240px;
  align-self: center;
}

.therapy-bot-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ----- Footer Styles ----- */

.footer {
  background-color: #0280e5;
  padding: 30px 0;
  text-align: center;
  font-size: 14px;
  color: #fff;
  border-top: none;
}

.footer-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
}

.footer-links li {
  cursor: pointer;
  transition: color 0.3s;
}

.footer-links li:hover {
  color: #72c0ff;
}

.footer-copyright {
  margin-top: 10px;
}

/* ----- Registration Form Popup ----- */
.hidden {
  display: none;
}

.popup label {
  display: flex;
  flex-direction: column;
  font-size: 14px;
  color: #555;
  flex: 1 1 calc(50% - 10px);
  min-width: 200px;
}

.popup input[type="text"],
.popup input[type="number"],
.popup select {
  padding: 10px;
  border-radius: 5px;
  border: 1px solid #ccc;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s;
}

.popup input[type="text"]:focus,
.popup input[type="number"]:focus,
.popup select:focus {
  border-color: #0280e5;
}

/* Budget result fields */
.popup-content .budget-result {
  flex: 1 1 calc(50% - 10px);
  min-width: 200px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.popup-content .budget-result label {
  font-size: 14px;
  color: #555;
  flex: unset;
  min-width: unset;
}

.popup-content .budget-result-box {
  background-color: #f0f7ff;
  border: 1px solid #b3d4f5;
  border-left: 4px solid #0280e5;
  border-radius: 6px;
  padding: 10px 14px;
}

.popup-content .budget-result-box input[readonly] {
  border: none;
  background: transparent;
  outline: none;
  padding: 0;
  font-size: 22px;
  font-weight: 700;
  color: #0280e5;
  width: 100%;
}

.form-note {
  font-size: 0.8em;
  color: #666;
  text-align: center;
  margin: 8px 0 0;
  font-style: italic;
}

.profile-description {
  font-size: 0.8em;
  color: #555;
  line-height: 1.5;
  margin: 10px 0 0;
  min-height: 1em;
}

.profile-locked-note {
  font-size: 0.9em;
  color: #555;
  text-align: center;
  margin: 10px 0 0;
}

.validation-message {
  color: #ff0000;
  width: 100%;
  text-align: center;
  min-height: 20px;
  font-size: 0.9em;
  margin: 0;
}

/* Take no space until there's a message, so the profile form's buttons sit
   close to the text above them */
.validation-message:empty {
  display: none;
}

#registrationForm > .button-row {
  margin-top: 0;
}

/* Responsive registration form fields */
@media (max-width: 768px) {
  .popup label {
    flex: 1 1 100%;
    min-width: 100%;
  }
}

/* ----- Search Results Styles ----- */
.search-results-container {
  margin: 0 auto;
  padding: 20px 0;
}

.search-result-card {
  display: flex;
  border: 1px solid #ddd;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  background: white;
  width: 100%;
  height: 300px; /* Increased height from 200px to 300px */
}

.search-result-image-wrapper {
  position: relative;
  width: 450px;
  height: 100%;
  flex-shrink: 0;
}

.search-result-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.search-result-details {
  padding: 20px;
  flex-grow: 1;
  min-width: 0; /* Prevent text from forcing container growth */
}

.property-price {
  font-size: 24px;
  color: #333;
  font-weight: bold;
}

.property-address {
  font-size: 20px;
  margin: 0 0 15px 0;
  color: #333;
}

.property-description {
  font-size: 18px;
  color: #333;
  margin: 0 0 10px 0;
}

/* Media query for mobile responsiveness */
@media (max-width: 768px) {
  .search-result-card {
    height: auto;
  }

  .search-result-image-wrapper {
    width: 100%;
    height: 300px;
  }

  .search-result-image {
    width: 100%;
    height: 100%;
  }
}

/* ----- Search Results Pagination ----- */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
  gap: 15px;
}

.pagination-btn {
  padding: 8px 16px;
  border: 1px solid #ddd;
  background-color: #fff;
  cursor: pointer;
  border-radius: 4px;
}

.pagination[hidden] {
  display: none;
}

.pagination-btn:hover {
  background-color: #f5f5f5;
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: default;
  background-color: #fff;
}

.page-numbers {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-number {
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 4px;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
}

.page-ellipsis {
  padding: 0 2px;
  color: #666;
}

.page-number:hover {
  background-color: #f5f5f5;
}

.page-number.active {
  background-color: #0280e5;
  color: white;
}

@media (max-width: 480px) {
  /* Page numbers get their own row; Previous/Next sit underneath */
  .pagination {
    flex-wrap: wrap;
    gap: 12px;
  }

  .page-numbers {
    order: -1;
    flex-basis: 100%;
    justify-content: center;
    gap: 6px;
  }

  .page-number {
    min-width: 36px;
    padding: 10px 0;
    text-align: center;
  }

  .pagination-btn {
    padding: 10px 20px;
  }
}

/* ----- Map View Button ----- */
.map-view-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  margin: 0 0 16px 0;
  border: 2px solid #0280e5;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  transition: background-color 0.2s;
}

.map-view-button span {
  font-weight: bold;
  color: #0280e5;
}

.map-view-button:hover {
  background-color: #f0f0f0;
}

.map-view-button .map-icon {
  width: 24px;
  height: 24px;
  filter: invert(51%) sepia(68%) saturate(677%) hue-rotate(182deg)
    brightness(91%) contrast(89%);
}

/* ----- Map View Styles ----- */
body {
  margin: 0;
  padding: 0;
}

#map {
  position: absolute;
  top: 80px; /* Add space for navbar */
  bottom: 0;
  right: 0;
  left: 0;
}

/* Mute the OSM basemap so price markers stand out (markers sit in a separate pane) */
#map .leaflet-tile-pane {
  filter: grayscale(1) brightness(1) contrast(0.75);
}

#map-title {
  position: relative;
  margin-top: 70px; /* Adjust margin to account for navbar */
  margin-left: 50px;
  float: left;
  background: white;
  border: 2px solid rgba(0, 0, 0, 0.2);
  padding: 6px 8px;
  font-family: Helvetica;
  font-weight: bold;
  font-size: 24px;
  z-index: 800;
}

.price-marker {
  background: white;
  border: 2px solid #0280e5;
  border-radius: 5px;
  padding: 5px;
  text-align: center;
  color: #0280e5;
  font-weight: bold;
  font-family: "Red Hat Text", Arial, sans-serif;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.price-marker div {
  white-space: nowrap;
}

/* ----- Win Popup ----- */
.popup-win {
  gap: 0;
  overflow: hidden;
}

.popup-win .popup-content {
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.win-heart-container {
  position: relative;
  width: 100%;
  margin-top: -15.6%;
  margin-bottom: -9.4%;
}

.win-heart {
  width: 100%;
  display: block;
}

.popup-win .win-subtitle {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 65%;
  font-size: 18px;
  font-weight: bold;
  color: white;
  text-align: center;
  margin: 0;
}

.popup-win .button-row {
  flex-direction: row;
  margin-top: 20px;
}

.popup-win .button-row button {
  flex: 1;
  white-space: pre-line; /* Labels break onto two rows at "\n" */
}

/* ----- Game Timer and Max Mortgage Styles ----- */
.map-game-hud {
  position: absolute;
  top: 10px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.game-timer,
.game-mortgage {
  background: white;
  border: 2px solid #0280e5;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  font-family: "Red Hat Text", Arial, Helvetica, sans-serif;
  color: #0280e5;
}

.game-timer {
  padding: 15px 22px;
  font-size: 18px;
  font-weight: bold;
}

.game-mortgage {
  padding: 10px 16px;
  font-size: 16px;
  font-weight: bold;
}

/* ----- Team Members ----- */

.team-member {
  margin-bottom: 20px;
}

.team-member b {
  display: block;
  margin-bottom: 10px;
}

.team-photo {
  width: 100px;
  height: 100px;
  margin-right: 15px;
  border-radius: 50%;
  float: left; /* Float the image to the left of the description */
  margin-bottom: 10px; /* Add space beneath the image for text separation */
}

/* Ensure the text clears float for subsequent content in the document */
.team-member::after {
  content: "";
  display: table;
  clear: both;
}

/* ----- Therapy Bot Styles ----- */

.chat-container {
  max-width: 800px;
  margin: 40px auto;
  padding: 0 20px;
}

.chat-box {
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  height: 600px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  background-color: #0280e5;
  color: white;
  padding: 20px;
  text-align: center;
  font-size: 24px;
  font-weight: bold;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 80%;
  animation: fadeIn 0.3s ease-in;
}

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

.message.bot {
  align-self: flex-start;
}

.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #0280e5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  flex-shrink: 0;
}

.message.user .message-avatar {
  background-color: #ff2a64;
}

.bot-avatar-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.message-content.typing-indicator {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 14px 18px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #0280e5;
  opacity: 0.4;
  animation: typingBounce 1.2s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

.message-content {
  background-color: #e0f7ff;
  padding: 12px 16px;
  border-radius: 15px;
  font-size: 16px;
  line-height: 1.5;
}

.message.user .message-content {
  background-color: #ffd6e3;
}

.chat-input-container {
  padding: 20px;
  background-color: #f8f9fa;
  border-top: 1px solid #ddd;
  display: flex;
  gap: 10px;
}

.chat-input {
  flex: 1;
  width: 0; /* Drop the input's default ~20-char width; flex: 1 sets the real width */
  padding: 12px 16px;
  border: 2px solid #0280e5;
  border-radius: 25px;
  font-size: 16px;
  font-family: Helvetica, Arial, sans-serif;
  outline: none;
}

.chat-input:focus {
  border-color: #ff2a64;
}

.send-button {
  padding: 12px 30px;
  background-color: #0280e5;
  color: white;
  border: none;
  border-radius: 25px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s;
}

.send-button:hover {
  background-color: #0164b8;
}

.send-button:active {
  background-color: #014a8a;
}

.send-button:disabled,
.send-button:disabled:hover {
  background-color: #b0b8c1;
  cursor: not-allowed;
}

/* Story choice buttons — appear inside chat-messages, aligned with bot messages */
.story-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-self: flex-start;
  padding: 4px 0 4px 50px; /* 40px avatar + 10px gap */
  max-width: 100%;
  animation: fadeIn 0.3s ease-in;
}

.story-choice-btn {
  padding: 9px 16px;
  background: white;
  border: 2px solid #0280e5;
  border-radius: 20px;
  color: #0280e5;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  transition:
    background-color 0.2s,
    color 0.2s;
}

.story-choice-btn:hover {
  background-color: #0280e5;
  color: white;
}

.story-choice-btn:active {
  background-color: #0164b8;
  color: white;
}

.intro-text {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 20px auto;
  padding: 0 20px;
  color: #0280e5;
  font-size: 18px;
}

@media (max-width: 480px) {
  /* .content-container already provides the side gutter */
  .chat-container,
  .intro-text {
    padding: 0;
  }

  .chat-container {
    margin: 20px auto;
  }

  .chat-box {
    height: 70vh;
    min-height: 400px;
  }

  .chat-header {
    padding: 15px;
    font-size: 20px;
  }

  .chat-messages {
    padding: 15px;
  }

  .message {
    max-width: 95%;
    gap: 8px;
  }

  .message-avatar {
    width: 32px;
    height: 32px;
  }

  .bot-avatar-icon {
    width: 22px;
    height: 22px;
  }

  .chat-input-container {
    padding: 12px;
  }

  .send-button {
    padding: 12px 20px;
  }
}

/* ----- Hamburger Button ----- */

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: white;
  border-radius: 2px;
}

/* ----- Mobile Responsive Styles ----- */

/* The navbar collapses to the hamburger menu before its buttons run into the
   logo and profile, which happens below about 1005px */
@media (max-width: 1024px) {
  .hamburger {
    display: flex;
  }

  .navbar-content {
    position: static;
  }

  /* 3-column layout: logo | hamburger | profile */
  .home-link {
    flex: 1;
  }

  .navbar-right {
    flex: 1;
    margin-left: 0;
    justify-content: flex-end;
  }

  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    transform: none;
    background-color: #0280e5;
    padding: 10px 0;
    z-index: 999;
    box-sizing: border-box;
  }

  nav.nav-open {
    display: block;
  }

  nav ul {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
  }
}

@media (max-width: 768px) {
  /* Hero section */
  .hero-section {
    height: auto;
    min-height: 350px;
    padding: 40px 20px;
  }

  .title-container {
    padding: 20px;
    width: 90%;
    box-sizing: border-box;
  }

  .title {
    font-size: 28px;
    margin-bottom: 15px;
  }

  .search-input {
    width: 100%;
    box-sizing: border-box;
    font-size: 16px;
  }

  .search-container {
    width: 100%;
  }

  /* Property cards: one full-width column */
  .property-cards {
    grid-template-columns: 1fr;
  }

  .property-card {
    width: 100%;
  }

  /* Service cards */
  .service-card {
    width: 100%;
  }

  .service-card.horizontal {
    flex-direction: column;
    width: 100%;
  }

  .service-card.horizontal .service-image {
    width: 100%;
    height: 200px;
  }

  /* Search results */
  .search-result-card {
    flex-direction: column;
    height: auto;
  }

  .search-result-image-wrapper {
    width: 100%;
    height: 220px;
  }
}

@media (max-width: 480px) {
  .title {
    font-size: 22px;
  }

  .section-heading {
    font-size: 20px;
  }

  .profile-container {
    height: 40px;
    padding: 0 10px;
  }

  .profile-text {
    font-size: 13px;
  }

  .profile-icon-wrapper {
    width: 37px;
    height: 37px;
  }

  .profile-icon {
    height: 44px;
    width: 44px;
    top: -3px;
    left: -3px;
  }

  .logo-container {
    height: 40px;
    padding: 0 12px;
  }

  .logo {
    height: 30px;
  }

  .logo-text {
    font-size: 13px;
  }
}

/* ============================
   Blog Styles
   ============================ */

.blog-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 1rem 0 2rem;
}

.blog-card {
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.blog-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #0280e5;
  margin: 0;
}

.blog-card-excerpt {
  font-size: 0.9rem;
  color: #444;
  flex-grow: 1;
  margin: 0;
}

.blog-card-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: #0280e5;
  text-decoration: none;
  align-self: flex-start;
}

.blog-card-link:hover {
  text-decoration: underline;
}

.blog-post-nav {
  margin-bottom: 1.25rem;
}

.blog-back {
  font-size: 0.9rem;
  color: #0280e5;
  text-decoration: none;
  font-weight: 600;
}

.blog-back:hover {
  text-decoration: underline;
}

.blog-post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.blog-author {
  font-size: 0.85rem;
  color: #666;
}

.blog-intro {
  color: #555;
  margin-bottom: 2rem;
  font-style: italic;
}

.blog-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.blog-tag--sellers {
  background-color: #fff0d6;
  color: #b06000;
}

.blog-tag--renters {
  background-color: #d6f5ee;
  color: #0a6b50;
}

.blog-tag--homeseekers {
  background-color: #d6eeff;
  color: #0060b0;
}

.blog-tag--insight {
  background-color: #ede8ff;
  color: #5a2da0;
}

.blog-tag--rights {
  background-color: #fde8e8;
  color: #b02020;
}

@media (max-width: 600px) {
  .blog-cards {
    grid-template-columns: 1fr;
  }
}

/* ----- Map Game Reveal ----- */
/* Missed home ringed after the timer runs out; other markers fade back */
.map-game-reveal .price-marker {
  transition: opacity 0.4s ease;
}

.map-game-reveal .price-marker:not(.price-marker--reveal) {
  opacity: 0.3;
}

.price-marker--reveal::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  border: 4px solid #0280e5;
  border-radius: 50%;
  box-sizing: border-box;
  pointer-events: none;
  animation: reveal-pulse 1s ease-out infinite;
}

/* Hidden heart pops up behind the missed home's price tag and ring */
.reveal-heart img {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
  animation: reveal-heart-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes reveal-heart-pop {
  from {
    transform: scale(0);
  }
  to {
    transform: scale(1);
  }
}

@keyframes reveal-pulse {
  from {
    transform: scale(1);
    opacity: 1;
  }
  to {
    transform: scale(1.6);
    opacity: 0;
  }
}
