/* Custom styles for Stoop Dog listings. Served raw by Propshaft (no @apply). */

/* Hide scrollbar on lightbox thumbnail rail while keeping scroll functional */
[data-photo-grid-target="rail"]::-webkit-scrollbar { display: none; }
[data-photo-grid-target="rail"] { -ms-overflow-style: none; scrollbar-width: none; }

/* Dual Range Slider Container */
.range-slider-container {
  position: relative;
  height: 24px;
}

.range-slider-min,
.range-slider-max {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 8px;
  background: transparent;
  outline: none;
  pointer-events: none;
}
.range-slider-min { z-index: 1; }
.range-slider-max { z-index: 2; }

/* Webkit thumbs - clay */
.range-slider-min::-webkit-slider-thumb,
.range-slider-max::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: #c65d3b;
  cursor: pointer;
  border: 3px solid #ffffff;
  box-shadow: 0 1px 4px rgba(43, 29, 22, 0.2);
  transition: transform 0.15s ease, background 0.15s ease;
  pointer-events: all;
  position: relative;
  z-index: 3;
}
.range-slider-max::-webkit-slider-thumb { z-index: 4; }

.range-slider-min::-webkit-slider-thumb:hover,
.range-slider-max::-webkit-slider-thumb:hover {
  background: #a6492c;
  transform: scale(1.1);
}
.range-slider-min::-webkit-slider-thumb:active,
.range-slider-max::-webkit-slider-thumb:active {
  background: #a6492c;
  transform: scale(1.05);
  z-index: 5;
}

/* Firefox thumbs - clay */
.range-slider-min::-moz-range-thumb,
.range-slider-max::-moz-range-thumb {
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: #c65d3b;
  cursor: pointer;
  border: 3px solid #ffffff;
  box-shadow: 0 1px 4px rgba(43, 29, 22, 0.2);
  pointer-events: all;
}
.range-slider-min::-moz-range-track,
.range-slider-max::-moz-range-track {
  background: transparent;
  border: none;
}

/* Filter inputs (price) - warm brand */
.form-input-enhanced {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  font-size: 14.5px;
  color: #2b1d16;
  background: #ffffff;
  border: 1.5px solid #e7dcc9;
  border-radius: 11px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-input-enhanced::placeholder { color: #b8ac98; }
.form-input-enhanced:focus {
  outline: none;
  border-color: #c65d3b;
  box-shadow: 0 0 0 3px rgba(198, 93, 59, 0.15);
}

/* Filter selects - warm brand with chevron */
.form-select-enhanced {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 11px 38px 11px 14px;
  font-size: 14.5px;
  color: #2b1d16;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%239a8c76' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  border: 1.5px solid #e7dcc9;
  border-radius: 11px;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-select-enhanced:focus {
  outline: none;
  border-color: #c65d3b;
  box-shadow: 0 0 0 3px rgba(198, 93, 59, 0.15);
}

/* Inline "Sort: Newest" dropdown on the listings index (no box, just text + chevron) */
.sd-sort-select {
  font-size: 13.5px;
  font-weight: 700;
  color: #2b1d16;
  background-color: transparent;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239a8c76' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
  padding: 0 19px 0 0;
  border: 0;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.sd-sort-select:focus { outline: none; }

/* Status pills (status_color returns one of these names) */
.status-pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 7px;
}
.pill-active   { background: #e8eddd; color: #4f5c38; }
.pill-new      { background: #fbeccb; color: #9a6a16; }
.pill-pending  { background: #ece7dd; color: #6f6456; }
.pill-progress { background: #fbeccb; color: #9a6a16; }
.pill-sold     { background: #f3e3dd; color: #a6492c; }
.pill-muted    { background: #ece7dd; color: #6f6456; }

/* Smart search accordion chevron */
summary::-webkit-details-marker { display: none; }
details[open] > summary .smart-search-chevron { transform: rotate(90deg); }

/* Brand pagination (Kaminari) */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}
.pagination .page,
.pagination .first,
.pagination .last,
.pagination .prev,
.pagination .next,
.pagination .gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pagination a,
.pagination .current,
.pagination .gap,
.pagination .nav-disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
}
.pagination a {
  background: #ffffff;
  border: 1px solid #e7dcc9;
  color: #6f6456;
}
.pagination a:hover { background: #faf3e9; border-color: #e0d2bb; color: #a6492c; }
.pagination .current {
  background: #c65d3b;
  color: #ffffff;
  font-weight: 700;
}
.pagination .gap { color: #9a8c76; border: none; }
.pagination .nav-disabled {
  background: #ffffff;
  border: 1px solid #e7dcc9;
  color: #cbbfa9;
  cursor: default;
}
.pagination .prev a,
.pagination .next a { color: #9a8c76; }

/* Expanded photo (show page) */
.expanded-photo {
  aspect-ratio: unset !important;
  box-shadow: 0 10px 30px rgba(43, 29, 22, 0.15), 0 4px 8px rgba(43, 29, 22, 0.1);
}
.close-button { transition: opacity 0.2s ease; }
.close-button:hover { transform: scale(1.1); }

/* Zip-code / draw map */
.leaflet-container { font-family: inherit; }
.leaflet-tile-pane { filter: saturate(1.8) contrast(1.05) brightness(1.02); }

button, [type="button"], [role="button"] { cursor: pointer; }

.leaflet-container.draw-mode-active { cursor: crosshair !important; }

.draw-pulse-ring {
  position: absolute;
  width: 20px;
  height: 20px;
  margin-left: -10px;
  margin-top: -10px;
  border-radius: 50%;
  border: 2px solid rgba(198, 93, 59, 0.6);
  background: transparent;
  animation: draw-pulse 1.8s ease-out infinite;
  pointer-events: none;
  z-index: 600;
  will-change: transform, opacity;
}
@keyframes draw-pulse {
  0%   { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.5); opacity: 0; }
}

.draw-ripple {
  position: absolute;
  width: 20px;
  height: 20px;
  margin-left: -10px;
  margin-top: -10px;
  border-radius: 50%;
  border: 2px solid #c65d3b;
  background: rgba(198, 93, 59, 0.25);
  animation: draw-ripple-expand 0.7s ease-out infinite;
  pointer-events: none;
  z-index: 600;
  will-change: transform, opacity;
}
@keyframes draw-ripple-expand {
  0%   { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(3.5); opacity: 0; }
}

/* Chat split-view listing panel */
turbo-frame#listing_panel {
  display: block;
  transition: opacity 0.2s ease-in;
}
turbo-frame#listing_panel[busy] { opacity: 0.6; }
