/* Localsewa v32.9.11 — Loading & Feedback Consolidation
   One restrained loading language + Sonner-style feedback presentation.
   Replaces the legacy v32.8 loading stylesheet while preserving its final
   testimonial skeleton footprint and existing application behavior. */

:root {
  --ls-loading-soft-duration: 1.8s;
  --ls-loading-spinner-duration: 760ms;
  --ls-loading-ease: cubic-bezier(.4, 0, .2, 1);
  --ls-loading-surface: #e8efea;
  --ls-loading-surface-soft: #f1f5f3;
  --ls-loading-border: #e2ebe5;
  --ls-feedback-radius: 14px;
  --ls-feedback-shadow: 0 14px 42px rgb(16 35 26 / 0.14), 0 2px 8px rgb(16 35 26 / 0.05);
}

/* -------------------------------------------------------------------------
   Skeleton
   ------------------------------------------------------------------------- */
@keyframes ls-skeleton-soft-pulse {
  0%, 100% { opacity: .9; }
  50% { opacity: .66; }
}

.animate-pulse,
.ls-ui-skeleton,
.ls-loading-skeleton {
  animation: ls-skeleton-soft-pulse var(--ls-loading-soft-duration) var(--ls-loading-ease) infinite !important;
  will-change: opacity;
}

/* Skeletons are placeholders, never interactive cards. */
.ls-loading-skeleton,
.ls-loading-skeleton * {
  pointer-events: none !important;
}

.ls-loading-skeleton {
  user-select: none;
}

/* Keep first-load placeholders quiet: no card hover/lift/press behavior. */
.animate-pulse:hover,
.ls-ui-skeleton:hover,
.ls-loading-skeleton:hover {
  transform: none !important;
  box-shadow: inherit;
}

/* Customer review loader mirrors the final testimonial footprint. */
.ls-customer-reviews__loading { margin-top: 1.25rem; }
.ls-customer-reviews__loading-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}
.ls-customer-reviews__skeleton-card {
  min-width: 0;
  min-height: 170px;
  padding: 1rem;
  border: 1px solid rgba(221, 233, 225, .9);
  border-radius: 20px;
  background: rgba(255, 255, 255, .82);
}
@media (min-width: 640px) {
  .ls-customer-reviews__loading-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }
  .ls-customer-reviews__skeleton-card { min-height: 184px; padding: 1.15rem; }
}
@media (min-width: 1024px) {
  .ls-customer-reviews__loading-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* -------------------------------------------------------------------------
   Spinner / action loading
   ------------------------------------------------------------------------- */
@keyframes ls-loading-spin { to { transform: rotate(360deg); } }

.animate-spin,
.ls-inline-spinner,
.ls-ui-spinner,
.ls-loading-spinner {
  animation: ls-loading-spin var(--ls-loading-spinner-duration) linear infinite !important;
  will-change: transform;
}

.ls-inline-spinner,
.ls-loading-spinner {
  display: inline-block;
  flex: 0 0 auto;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 9999px;
}

.ls-action-loading {
  cursor: wait !important;
  user-select: none;
  min-inline-size: var(--ls-loading-control-width, auto);
}

.ls-action-loading:not(.ls-has-native-spinner)::before {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  flex: 0 0 1em;
  margin-right: .48em;
  vertical-align: -.12em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 9999px;
  opacity: .88;
  animation: ls-loading-spin var(--ls-loading-spinner-duration) linear infinite;
}

/* Avoid a static action glyph sitting next to a generated progress spinner. */
.ls-action-loading:not(.ls-has-native-spinner) > svg:first-child {
  display: none !important;
}

.ls-action-loading,
.ls-action-loading:hover,
.ls-action-loading:active {
  transform: none !important;
}

/* -------------------------------------------------------------------------
   Sonner-style feedback — reuses Localsewa's existing event/toast runtime.
   No second toast stack is created.
   ------------------------------------------------------------------------- */
@keyframes ls-feedback-toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.ls-feedback-toast-viewport {
  pointer-events: none;
}

.ui-toast-enter.ls-feedback-toast {
  pointer-events: auto !important;
  width: 100% !important;
  max-width: 390px !important;
  gap: .625rem !important;
  padding: .75rem .8125rem !important;
  border: 1px solid var(--border, #dce8e0) !important;
  border-radius: var(--ls-feedback-radius) !important;
  background: rgb(255 255 255 / .97) !important;
  color: var(--foreground, #10231a) !important;
  box-shadow: var(--ls-feedback-shadow) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  animation: ls-feedback-toast-in 180ms cubic-bezier(.2,0,0,1) both !important;
}

.ui-toast-enter.ls-feedback-toast > span:first-child {
  width: 30px !important;
  height: 30px !important;
  border-radius: 9px !important;
}

.ui-toast-enter.ls-feedback-toast > p {
  color: var(--foreground, #10231a) !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
  font-weight: 600 !important;
}

.ui-toast-enter.ls-feedback-toast > button:last-child {
  width: 30px !important;
  height: 30px !important;
  border-radius: 9px !important;
  color: #718078 !important;
}

@media (hover: hover) and (pointer: fine) {
  .ui-toast-enter.ls-feedback-toast > button:last-child:hover {
    background: #f1f5f3 !important;
    color: #33483d !important;
  }
}

.ui-toast-enter.ls-feedback-toast[data-tone="success"] > span:first-child {
  background: #ecfdf3 !important;
  color: #15803d !important;
}
.ui-toast-enter.ls-feedback-toast[data-tone="info"] > span:first-child {
  background: #eff6ff !important;
  color: #2563eb !important;
}
.ui-toast-enter.ls-feedback-toast[data-tone="warning"] > span:first-child {
  background: #fff7ed !important;
  color: #c2410c !important;
}
.ui-toast-enter.ls-feedback-toast[data-tone="error"] > span:first-child {
  background: #fef2f2 !important;
  color: #dc2626 !important;
}

/* -------------------------------------------------------------------------
   Empty states
   ------------------------------------------------------------------------- */
.ls-empty-state {
  border-color: #dbe7df !important;
  background: rgb(255 255 255 / .78) !important;
}

.ls-empty-state > h2,
.ls-empty-state > h3,
.ls-empty-state > p:first-child {
  color: #173d2e;
}

.ls-empty-state [class*="text-[#64748B]"],
.ls-empty-state [class*="text-[#94A3B8]"] {
  color: #6b7f73 !important;
}

/* -------------------------------------------------------------------------
   Accessibility / reduced motion
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .animate-pulse,
  .ls-ui-skeleton,
  .ls-loading-skeleton {
    animation: none !important;
    opacity: .82 !important;
    will-change: auto !important;
  }

  .animate-spin,
  .ls-inline-spinner,
  .ls-ui-spinner,
  .ls-loading-spinner,
  .ls-action-loading:not(.ls-has-native-spinner)::before {
    animation-duration: 1.6s !important;
  }

  .ui-toast-enter.ls-feedback-toast {
    animation: none !important;
  }
}
