/* Small, dependency-free helpers on top of the Tailwind CDN build. */
:root {
  color-scheme: light;
  --divar: #a62626;
  --divar-dark: #6f1f1f;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Vazirmatn", Tahoma, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: #f6caca;
  color: #6f1f1f;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

#log-stream::-webkit-scrollbar-thumb {
  background: #334155;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#conversion-slider {
  direction: ltr;
  outline: none;
}

#conversion-slider::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #059669;
  border: 4px solid #fff;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.35);
  cursor: grab;
}

#conversion-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #059669;
  border: 4px solid #fff;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.35);
  cursor: grab;
}

#conversion-slider:focus-visible {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.modal-panel {
  animation: modal-in 160ms ease-out both;
}

#scrape-modal:not(.hidden),
#neighborhood-modal:not(.hidden),
#add-local-listing-modal:not(.hidden),
[id^="edit-client-"]:not(.hidden),
[id^="renew-client-"]:not(.hidden),
#add-client-modal:not(.hidden) {
  display: flex;
}

body.modal-open {
  overflow: hidden;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #64748b;
}

.live-dot.is-active {
  background: #34d399;
  animation: live-pulse 1.6s ease-in-out infinite;
}

@keyframes live-pulse {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.4);
  }
  50% {
    opacity: 0.65;
    box-shadow: 0 0 0 5px rgba(52, 211, 153, 0);
  }
}

.log-line {
  animation: log-in 180ms ease-out both;
}

@keyframes log-in {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.log-level {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  margin-top: 2px;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 9px;
  font-weight: 800;
  line-height: 15px;
  text-transform: uppercase;
}

.log-level-info {
  background: rgba(14, 165, 233, 0.15);
  color: #7dd3fc;
}

.log-level-success {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}

.log-level-warn {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
}

.log-level-error {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
}

.log-level-debug {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
}

.log-message {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 11px;
  line-height: 20px;
  color: #cbd5e1;
}

.log-message.is-warn {
  color: #fef3c7;
}

.log-message.is-error {
  color: #fecaca;
}

.log-message.is-success {
  color: #d1fae5;
}

.task-pill-hidden {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
