/* Smooth scrolling for every anchor jump, including a hash arriving from a
   fresh page load (e.g. for-rent.html's "Contact Us" link goes to
   index.html#contact) - JS also handles same-page anchor clicks explicitly
   (see chrome.js) for browsers/cases this alone doesn't cover. */
html {
  scroll-behavior: smooth;
}

/* Page transition: fade in on arrival, fade out just before navigating to
   another internal page (see chrome.js's link interception). */
body {
  animation: page-fade-in 0.25s ease;
}

@keyframes page-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

body.page-leaving {
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* Skeleton loading placeholders for property cards/text while the CSV
   fetch is in flight, and for individual images while they decode. */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton {
  background: linear-gradient(90deg, #eef0ee 25%, #e2e5e2 37%, #eef0ee 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

.img-fade {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.img-fade.loaded {
  opacity: 1;
}

/* Property card hover effect + entrance animation whenever a card is
   (re)rendered - covers first load and every search/filter refresh. */
.property-card {
  animation: fade-in-up 0.4s ease both;
}

.property-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Property modal: fade + scale in/out instead of an instant show/hide.
   Toggled by JS via the "modal-visible" class; "hidden" still fully removes
   it from layout once the transition finishes. */
#propertyModal .modal-overlay {
  transition: opacity 0.2s ease;
  opacity: 0;
}

#propertyModal .modal-panel {
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  opacity: 0;
  transform: scale(0.95);
}

#propertyModal.modal-visible .modal-overlay {
  opacity: 0.75;
}

#propertyModal.modal-visible .modal-panel {
  opacity: 1;
  transform: scale(1);
}

/* Admin add/edit modals (admin.html): identical fade + scale pattern, shared
   by every admin modal (listings/blog/partners/projects/enquiries) so they
   all look the same instead of each one drifting on its own. */
.admin-modal .modal-overlay {
  transition: opacity 0.2s ease;
  opacity: 0;
}

.admin-modal .modal-panel {
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  opacity: 0;
  transform: scale(0.95);
}

.admin-modal.modal-visible .modal-overlay {
  opacity: 0.75;
}

.admin-modal.modal-visible .modal-panel {
  opacity: 1;
  transform: scale(1);
}

/* Dashboard/Reports portlets: Gridstack drags via the ".portlet-drag-handle"
   header bar only (see dashboard.js), so the cursor should say so - a plain
   default/pointer cursor there reads as "not draggable" even though it is.
   The edit/delete buttons inside that same header need their own pointer
   cursor back, since "grab" would otherwise leak onto them too. */
.portlet-drag-handle {
  cursor: grab;
}

.portlet-drag-handle:active {
  cursor: grabbing;
}

.portlet-drag-handle button {
  cursor: pointer;
}

/* Hero section background */
.hero-section {
  background: linear-gradient(rgba(10, 22, 10, 0.65), rgba(10, 22, 10, 0.7)),
    url("https://images.unsplash.com/photo-1487958449943-2429e8be8625?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2070&q=80");
  background-size: cover;
  background-position: center;
}

/* Contact form focus styles */
.contact-form input,
.contact-form textarea {
  transition: all 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: #5f9f51;
  box-shadow: 0 0 0 3px rgba(95, 159, 81, 0.2);
}

/* Mobile menu animation */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.mobile-menu.open {
  max-height: 500px;
}

/* Custom rounded pill selects. Native <select> chrome ignores border-radius
   in most browsers unless appearance is fully reset - border-radius is set
   here directly (not left to the rounded-full utility class) so the pill
   shape never depends on stylesheet load order. Paired with a manually
   positioned chevron icon in the markup, since appearance:none also removes
   the native dropdown arrow. */
.filter-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border-radius: 9999px;
  background-color: #ffffff;
  background-image: none;
  transition:
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

/* Custom select's open menu (see custom-select.js) */
.custom-select-menu {
  animation: dropdown-in 0.15s ease;
  transform-origin: top;
}

@keyframes dropdown-in {
  from {
    opacity: 0;
    transform: scaleY(0.95) translateY(-4px);
  }
  to {
    opacity: 1;
    transform: scaleY(1) translateY(0);
  }
}

/* Autosuggest dropdown under the search inputs (see search.js) */
.search-suggestions {
  animation: dropdown-in 0.15s ease;
}

/* Hide the native "clear" (x) button inside the search box - the app has
   its own "Clear" button, so the built-in one is redundant. Firefox does
   not render one for type="search", so only the WebKit pseudo-elements
   need suppressing. */
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}
