/* Jarvis Studio — Animações e micro-interações
   Skeleton loading, fade transitions, micro-feedbacks */

/* === Skeleton Loading === */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.7; }
}

.skeleton {
  background: linear-gradient(90deg, #1a1b1e 0%, #25262b 50%, #1a1b1e 100%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: 4px;
  color: transparent !important;
}

.skeleton-text {
  height: 1em;
  margin-bottom: 0.5em;
  display: inline-block;
  width: 100%;
}

.skeleton-block {
  min-height: 100px;
  width: 100%;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.skeleton-pdf-page {
  aspect-ratio: 1 / 1.414;
  width: 100%;
  max-width: 600px;
}

/* === Fade Transitions === */
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in-down {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fade-in 0.3s ease-out forwards;
}

.fade-out {
  animation: fade-out 0.2s ease-out forwards;
}

.fade-in-up {
  animation: fade-in-up 0.3s ease-out forwards;
}

.fade-in-down {
  animation: fade-in-down 0.3s ease-out forwards;
}

/* === Theme Transition === */
.theme-transition {
  transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

/* === Smooth Scroll === */
.smooth-scroll {
  scroll-behavior: smooth;
}

/* === Progress Bar === */
@keyframes progress-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.progress-bar {
  height: 4px;
  background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 50%, #3b82f6 100%);
  background-size: 200% 100%;
  animation: progress-shimmer 1.5s linear infinite;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.progress-bar-static {
  height: 4px;
  background: #3b82f6;
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* === Typing Indicator === */
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

.typing-indicator {
  display: inline-flex;
  gap: 4px;
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: 12px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typing-bounce 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* === Copy Highlight === */
@keyframes highlight-flash {
  0% { background-color: rgba(34, 197, 94, 0.3); }
  100% { background-color: transparent; }
}

.copy-highlight {
  animation: highlight-flash 0.4s ease-out;
}

/* === Toast Notification === */
@keyframes toast-slide-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-slide-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }
}

.toast.toast-exit {
  animation: toast-slide-out 0.24s ease-out forwards;
}

/* === Panel Collapse/Expand === */
@keyframes panel-expand {
  from {
    max-width: 0;
    opacity: 0;
  }
  to {
    max-width: 320px;
    opacity: 1;
  }
}

@keyframes panel-collapse {
  from {
    max-width: 320px;
    opacity: 1;
  }
  to {
    max-width: 0;
    opacity: 0;
  }
}

.panel-expand {
  animation: panel-expand 0.3s ease-out forwards;
}

.panel-collapse {
  animation: panel-collapse 0.3s ease-out forwards;
}

/* === Hover Quick Actions === */
@keyframes quick-actions-fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.quick-actions {
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: translateY(4px);
}

*:hover > .quick-actions {
  opacity: 1;
  transform: translateY(0);
}

/* === Autosave Indicator === */
@keyframes autosave-pulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

.autosave-indicator {
  animation: autosave-pulse 2s ease-in-out infinite;
}

/* === Drag Drop Zone === */
@keyframes drag-pulse {
  0%, 100% { border-color: var(--border); background: transparent; }
  50% { border-color: #3b82f6; background: rgba(59, 130, 246, 0.1); }
}

.drag-zone {
  transition: all 0.2s ease;
}

.drag-zone.drag-over {
  animation: drag-pulse 1s ease-in-out infinite;
  border: 2px dashed #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

/* === Checkmark Animation === */
@keyframes checkmark-draw {
  0% { stroke-dashoffset: 24; }
  100% { stroke-dashoffset: 0; }
}

.checkmark-animate path {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: checkmark-draw 0.4s ease-out forwards;
}

/* === Keyboard Shortcuts Modal === */
@keyframes modal-fade-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.shortcuts-modal {
  animation: modal-fade-in 0.2s ease-out;
}

/* === Ripple Effect === */
@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

/* === Keyboard Shortcuts Overlay === */
.shortcuts-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in 0.18s ease-out forwards;
}

.shortcuts-modal {
  background: var(--bg-elevated, #1e1f24);
  color: var(--text-primary, #e4e4e7);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  border-radius: 12px;
  padding: 20px 24px;
  width: min(440px, 92vw);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
  animation: fade-in-up 0.22s ease-out forwards;
}

.shortcuts-modal h3 {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.shortcuts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
}

.shortcut-row:last-child {
  border-bottom: none;
}

.shortcut-row kbd {
  background: var(--bg-surface, #2a2b32);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.15));
  border-radius: 5px;
  padding: 2px 7px;
  font-family: monospace;
  font-size: 0.8rem;
}
