/* Motion layer inspired by the Wafer reference, adapted to SnappSpot's warm RTL UI.
   Kept separate from business/page styles so it can be disabled without affecting layout. */
:root {
  --ui-ease: cubic-bezier(.22, 1, .36, 1);
  --ui-fast: 160ms;
  --ui-normal: 280ms;
  --ui-slow: 520ms;
  --ui-border-soft: rgba(61, 74, 47, .12);
  --ui-shadow-soft: 0 2px 5px rgba(46, 42, 34, .04),
                    0 10px 24px rgba(46, 42, 34, .07),
                    0 24px 50px rgba(46, 42, 34, .045);
}

/* No global transition: only components with known interactive states. */
.sidebar {
  transition: transform var(--ui-normal) var(--ui-ease),
              width var(--ui-normal) var(--ui-ease),
              box-shadow var(--ui-normal) var(--ui-ease),
              visibility var(--ui-normal) var(--ui-ease);
}
.sidebar-brand, .brand-mark, .sidebar-nav a, .sidebar-footer a {
  transition: color var(--ui-fast) ease, background-color var(--ui-fast) ease,
              border-color var(--ui-fast) ease, transform var(--ui-normal) var(--ui-ease),
              opacity var(--ui-normal) ease;
}
.sidebar-nav a:hover { transform: translateX(-2px); }
.sidebar-nav a:active, .btn:active, .chip:active { transform: scale(.985); }

.btn, .chip, .input, .select, .editable-input, .star-btn,
.prov, .info-card, .table-wrap, .card, .map-zoom-controls .btn {
  transition: background-color var(--ui-fast) ease, color var(--ui-fast) ease,
              border-color var(--ui-fast) ease, box-shadow var(--ui-normal) var(--ui-ease),
              transform var(--ui-normal) var(--ui-ease);
}
.btn:not(:disabled):hover, .map-zoom-controls .btn:hover {
  box-shadow: 0 5px 16px rgba(46, 42, 34, .10);
}
.card, .prov, .table-wrap {
  box-shadow: 0 1px 2px rgba(46, 42, 34, .025);
}
.card:hover, .prov:hover, .info-card:hover {
  border-color: rgba(143, 123, 102, .48);
}
.input:focus-visible, .select:focus-visible, .editable-input:focus-visible {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(61, 74, 47, .12);
}

/* Subtle content entrance. Content is never hidden while waiting for JS. */
@keyframes uiRiseIn {
  from { opacity: .01; transform: translateY(9px); filter: blur(2px); }
  to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}
.content > .page-head,
.content > .cmp-grid,
.content > #columnsWrap,
.content > .ai-layout,
.content > .card,
.content > .table-wrap,
.content > .cmp-results {
  animation: uiRiseIn 560ms var(--ui-ease) both;
}
.content > *:nth-child(2) { animation-delay: 45ms; }
.content > *:nth-child(3) { animation-delay: 90ms; }
.content > *:nth-child(4) { animation-delay: 135ms; }

/* Login: layered but restrained shadow and a crisp, accessible focus treatment. */
.auth-card {
  border: 1px solid rgba(255, 255, 255, .72) !important;
  box-shadow: 0 0 0 1px rgba(46, 42, 34, .035),
              0 3px 8px rgba(31, 27, 20, .07),
              0 14px 34px rgba(31, 27, 20, .13),
              0 32px 64px rgba(31, 27, 20, .10) !important;
  animation: uiRiseIn 700ms var(--ui-ease) both;
}
.auth .input { transition: border-color var(--ui-fast) ease, box-shadow var(--ui-normal) var(--ui-ease), background-color var(--ui-fast) ease; }
.auth .input:focus { box-shadow: 0 0 0 3px rgba(61, 74, 47, .14), 0 4px 14px rgba(46, 42, 34, .06); }
.auth .btn { transition: background-color var(--ui-fast) ease, transform var(--ui-fast) var(--ui-ease), box-shadow var(--ui-normal) var(--ui-ease); }
.auth .btn:active { transform: translateY(0) scale(.985); }

/* Map motion stays limited to surrounding controls and county styling; no transforms on map geometry. */
.map-zoom-controls { animation: uiRiseIn 420ms var(--ui-ease) both; }
.map-zoom-controls .btn:hover { transform: translateY(-1px); }
.map-zoom-controls .btn:active { transform: scale(.97); }
.map-zoom-hint { transition: opacity var(--ui-normal) ease, transform var(--ui-normal) var(--ui-ease); }

@media (max-width: 900px) {
  .sidebar-nav a:hover { transform: none; }
  .content > .page-head,
  .content > .cmp-grid,
  .content > #columnsWrap,
  .content > .ai-layout,
  .content > .card,
  .content > .table-wrap,
  .content > .cmp-results { animation-duration: 420ms; }
}

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