/* Custom styles for house finder app using Tailwind CSS */

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

/* Individual Range Sliders */
.range-slider-min {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 8px;
  background: transparent;
  outline: none;
  z-index: 1;
  pointer-events: none;
}

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

/* Webkit Slider Thumbs */
.range-slider-min::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  height: 24px;
  width: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3B82F6, #2563EB);
  cursor: pointer;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  pointer-events: all;
  position: relative;
  z-index: 3;
}

.range-slider-max::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  height: 24px;
  width: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10B981, #059669);
  cursor: pointer;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  pointer-events: all;
  position: relative;
  z-index: 4;
}

.range-slider-min::-webkit-slider-thumb:hover {
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4), 0 3px 6px rgba(0, 0, 0, 0.15);
}

.range-slider-max::-webkit-slider-thumb:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4), 0 3px 6px rgba(0, 0, 0, 0.15);
}

.range-slider-min::-webkit-slider-thumb:active {
  background: linear-gradient(135deg, #1D4ED8, #1E40AF);
  transform: scale(1.05);
  z-index: 5;
}

.range-slider-max::-webkit-slider-thumb:active {
  background: linear-gradient(135deg, #047857, #065F46);
  transform: scale(1.05);
  z-index: 5;
}

/* Firefox Slider Thumbs */
.range-slider-min::-moz-range-thumb {
  height: 24px;
  width: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3B82F6, #2563EB);
  cursor: pointer;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  pointer-events: all;
}

.range-slider-max::-moz-range-thumb {
  height: 24px;
  width: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10B981, #059669);
  cursor: pointer;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  pointer-events: all;
}

.range-slider-min::-moz-range-track,
.range-slider-max::-moz-range-track {
  background: transparent;
  border: none;
}

/* Enhanced form inputs */
.form-input-enhanced {
  @apply block w-full text-base shadow-sm placeholder-gray-400;
  @apply focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500;
  @apply transition-all duration-200 ease-in-out;
  @apply hover:border-gray-400 hover:shadow-md;
  @apply bg-white/50 backdrop-blur-sm;
  width: 100% !important;
  box-sizing: border-box;
  padding-top: 12px;
  padding-right: 16px;
  padding-bottom: 12px;
  padding-left: 16px;
  border: 1px solid #d1d5db !important;
  border-radius: 16px !important;
}

.form-input-enhanced:focus {
  @apply bg-white/80 transform scale-[1.02] shadow-lg;
}

/* Fix for crossed out links */
a, a:hover, a:focus, a:active, a:visited {
  text-decoration: none !important;
}

/* Specific fix for devise links */
.forgot-password-link {
  text-decoration: none !important;
  text-decoration-line: none !important;
  text-decoration-style: none !important;
}

.form-select-enhanced {
  @apply block w-full px-4 py-3 text-base border border-gray-300 rounded-xl shadow-sm bg-white;
  @apply focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500;
  @apply transition-all duration-200 ease-in-out cursor-pointer;
  @apply hover:border-gray-400 hover:shadow-md appearance-none;
}

/* Smart search accordion */
summary::-webkit-details-marker {
  display: none;
}

details[open] > summary .smart-search-chevron {
  transform: rotate(90deg);
}

/* Expanded photo */
.expanded-photo {
  aspect-ratio: unset !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 4px 8px rgba(0, 0, 0, 0.1);
}

.close-button {
  transition: opacity 0.2s ease;
}

.close-button:hover {
  transform: scale(1.1);
}

/* Zip code 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(59, 130, 246, 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 #3B82F6;
  background: rgba(59, 130, 246, 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: dim frame while loading, fade content in */
turbo-frame#listing_panel {
  display: block;
  transition: opacity 0.2s ease-in;
}

turbo-frame#listing_panel[busy] {
  opacity: 0.6;
}
