
/* V4.6.9.4 micro-interaction and motion polish */
/* Goal: calmer, premium Apple-grade motion without touching logic */

:root{
  --ease-premium: cubic-bezier(.22,.61,.36,1);
  --ease-press: cubic-bezier(.2,.8,.2,1);
  --dur-fast: 140ms;
  --dur-mid: 220ms;
  --dur-slow: 320ms;
  --hover-rise: translateY(-1px);
  --press-drop: translateY(0.5px) scale(.992);
}

/* Global transition discipline */
button,
a,
input,
select,
textarea,
.segment-chip,
.chip,
.nav-item,
.note-card,
.command-item,
.row,
.metric,
.panel,
.detail-card,
.review-card,
.stream-card,
.attachment-card,
.secondary-btn,
.primary-btn,
.icon-btn,
.sidebar .nav-item,
.bottom-nav .nav-item,
.topbar .icon-btn,
.topbar .search-btn,
.modal,
.drawer-pane,
.input,
.select,
.input-tagbox,
.command-input-wrap{
  transition:
    background-color var(--dur-fast) var(--ease-premium),
    color var(--dur-fast) var(--ease-premium),
    opacity var(--dur-fast) var(--ease-premium),
    box-shadow var(--dur-mid) var(--ease-premium),
    transform var(--dur-mid) var(--ease-premium),
    border-color var(--dur-fast) var(--ease-premium)!important;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  *,
  *::before,
  *::after{
    animation: none !important;
    transition-duration: 0ms !important;
    scroll-behavior: auto !important;
  }
}

/* Premium hover / press behavior */
button:hover,
.primary-btn:hover,
.secondary-btn:hover,
.icon-btn:hover,
.search-btn:hover,
.segment-chip:hover,
.chip:hover,
.nav-item:hover,
.bottom-nav .nav-item:hover,
.topbar .icon-btn:hover{
  transform: var(--hover-rise);
}

button:active,
.primary-btn:active,
.secondary-btn:active,
.icon-btn:active,
.search-btn:active,
.segment-chip:active,
.chip:active,
.nav-item:active,
.bottom-nav .nav-item:active,
.topbar .icon-btn:active{
  transform: var(--press-drop);
  transition-duration: 90ms !important;
}

/* Card motion calmer and unified */
.note-card,
.command-item,
.row,
.metric,
.panel,
.detail-card,
.review-card,
.stream-card,
.attachment-card{
  will-change: transform, box-shadow;
}

.note-card:hover,
.command-item:hover,
.row:hover,
.metric:hover,
.panel:hover,
.detail-card:hover,
.review-card:hover,
.stream-card:hover,
.attachment-card:hover{
  transform: translateY(-1px);
}

.note-card:active,
.command-item:active,
.row:active,
.metric:active,
.panel:active,
.detail-card:active,
.review-card:active,
.stream-card:active,
.attachment-card:active{
  transform: translateY(0);
}

/* Search and input focus feel */
.input:focus,
.select:focus,
textarea:focus,
input:focus,
.input-tagbox:focus-within,
.command-input-wrap:focus-within{
  transform: translateY(-0.5px);
  box-shadow:
    0 0 0 1px rgba(120,120,140,.12),
    0 12px 30px rgba(15,23,42,.045)!important;
}
html.dark .input:focus,
html.dark .select:focus,
html.dark textarea:focus,
html.dark input:focus,
html.dark .input-tagbox:focus-within,
html.dark .command-input-wrap:focus-within{
  box-shadow:
    0 0 0 1px rgba(255,255,255,.08),
    0 14px 32px rgba(0,0,0,.24)!important;
}

/* Sidebar / nav calmness */
.sidebar .nav-item,
.bottom-nav .nav-item{
  transform-origin: center center;
}
.sidebar .nav-item.active,
.bottom-nav .nav-item.active{
  transition-duration: 180ms !important;
}

/* Topbar smoothness */
.topbar{
  transition:
    background-color var(--dur-mid) var(--ease-premium),
    box-shadow var(--dur-mid) var(--ease-premium),
    backdrop-filter var(--dur-mid) var(--ease-premium)!important;
}

/* Modal and drawer entrance feel */
.modal,
.drawer-pane{
  animation: premiumFadeUp var(--dur-slow) var(--ease-premium) both;
}
@keyframes premiumFadeUp{
  from{
    opacity: 0;
    transform: translateY(8px) scale(.992);
  }
  to{
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Backdrop */
.modal-backdrop,
.drawer-backdrop{
  animation: premiumFade var(--dur-mid) var(--ease-premium) both;
}
@keyframes premiumFade{
  from{ opacity: 0; }
  to{ opacity: 1; }
}

/* Sticky shell calmness */
.topbar,
.bottom-nav{
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* Command palette rows */
.command-item .title,
.command-item .meta{
  transition:
    color var(--dur-fast) var(--ease-premium),
    opacity var(--dur-fast) var(--ease-premium);
}

/* Make hover feedback calmer on dense lists */
.list-row,
.resource-row,
.history-item,
.comment-item,
.ref-item,
.qa-row,
.result-item{
  transition:
    background-color var(--dur-fast) var(--ease-premium),
    box-shadow var(--dur-fast) var(--ease-premium),
    transform var(--dur-fast) var(--ease-premium)!important;
}
.list-row:hover,
.resource-row:hover,
.history-item:hover,
.comment-item:hover,
.ref-item:hover,
.qa-row:hover,
.result-item:hover{
  transform: translateY(-0.5px);
}

/* Toolbar and chips */
.rich-toolbar button,
.type-switch .segment-chip{
  transition:
    background-color var(--dur-fast) var(--ease-premium),
    color var(--dur-fast) var(--ease-premium),
    transform var(--dur-fast) var(--ease-premium),
    box-shadow var(--dur-mid) var(--ease-premium)!important;
}

/* Fullscreen editor feels calmer */
.editor-shell.fullscreen,
.editor-shell.fullscreen .rich-editor,
.editor-shell.fullscreen .editor-input{
  transition:
    background-color var(--dur-mid) var(--ease-premium),
    box-shadow var(--dur-mid) var(--ease-premium)!important;
}

/* Slightly soften overly twitchy transforms if any inline hover styles exist */
.note-card:hover .card-title,
.command-item:hover .title,
.nav-item:hover .nav-label{
  transform: none !important;
}
