/*
 * FLOWAYZ TYPOGRAPHY SYSTEM
 * Système typographique cohérent et responsive
 */

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11' 1, 'ss01' 1;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

h1 {
  font-size: var(--text-4xl);
  letter-spacing: var(--tracking-tighter);
}

h2 {
  font-size: var(--text-3xl);
  letter-spacing: var(--tracking-tighter);
}

h3 {
  font-size: var(--text-2xl);
  letter-spacing: var(--tracking-tight);
}

h4 {
  font-size: var(--text-xl);
  letter-spacing: var(--tracking-tight);
}

h5 {
  font-size: var(--text-lg);
  letter-spacing: var(--tracking-tight);
}

h6 {
  font-size: var(--text-base);
}

p {
  margin-bottom: var(--space-4);
  line-height: var(--leading-relaxed);
}

a {
  color: var(--flowayz-teal);
  text-decoration: none;
  transition: color 0.25s ease;
}

a:hover {
  color: var(--accent, var(--flowayz-coral));
}

/* Underline slide-in for content links */
.prose a, a.link-underline {
  position: relative;
}
.prose a::after, a.link-underline::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.prose a:hover::after, a.link-underline:hover::after {
  width: 100%;
}

strong, b {
  font-weight: var(--font-bold);
  color: var(--text-primary);
}

em, i {
  font-style: italic;
}

small {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

blockquote {
  border-left: 4px solid var(--flowayz-teal);
  padding-left: var(--space-4);
  margin: var(--space-5) 0;
  font-style: italic;
  color: var(--text-secondary);
}

code {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: var(--text-sm);
  background: var(--bg-tertiary);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--flowayz-teal);
}

pre {
  background: var(--bg-tertiary);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: var(--space-5) 0;
}

pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

ul, ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-5);
}

li {
  margin-bottom: var(--space-2);
  line-height: var(--leading-relaxed);
}

ul {
  list-style-type: disc;
}

ol {
  list-style-type: decimal;
}

hr {
  border: none;
  border-top: 1px solid var(--border-default);
  margin: var(--space-6) 0;
}

/* Container utilities */
.container-flowayz {
  max-width: 1280px;
  margin: 0 auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

@media (min-width: 768px) {
  .container-flowayz {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
}

/* Responsive typography */
@media (max-width: 640px) {
  h1 {
    font-size: var(--text-3xl);
  }

  h2 {
    font-size: var(--text-2xl);
  }

  h3 {
    font-size: var(--text-xl);
  }

  .container-flowayz {
    padding-left: var(--space-3);
    padding-right: var(--space-3);
  }
}
/*
 * FLOWAYZ ANIMATIONS
 * Animations fluides et micro-interactions pour UX exceptionnelle
 */

/* === WAVE ANIMATIONS (Loading) === */
@keyframes wave-flow {
  0%, 100% {
    transform: translateY(0) scaleY(1);
    opacity: 0.6;
  }
  50% {
    transform: translateY(-20px) scaleY(1.2);
    opacity: 1;
  }
}

@keyframes wave-horizontal {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.animate-wave {
  animation: wave-flow 2s ease-in-out infinite;
}

.animate-wave:nth-child(2) {
  animation-delay: 0.2s;
}

.animate-wave:nth-child(3) {
  animation-delay: 0.4s;
}

/* === PULSE ANIMATIONS (Icons, Borders) === */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 123, 84, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 20px 10px rgba(255, 123, 84, 0);
    transform: scale(1.05);
  }
}

/* === GRADIENT ANIMATION === */
@keyframes gradient-x {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.animate-gradient-x {
  animation: gradient-x 3s ease infinite;
  background-size: 200% 100%;
}

/* === BLOB ANIMATION === */
@keyframes blob {
  0%, 100% { 
    transform: translate(0, 0) scale(1); 
  }
  33% { 
    transform: translate(30px, -50px) scale(1.1); 
  }
  66% { 
    transform: translate(-20px, 20px) scale(0.9); 
  }
}

.animate-blob {
  animation: blob 7s infinite;
}

.animation-delay-2000 {
  animation-delay: 2s;
}

.animation-delay-4000 {
  animation-delay: 4s;
}

/* === PULSE SLOW === */
@keyframes pulse-slow {
  0%, 100% { 
    opacity: 1;
    transform: scale(1);
  }
  50% { 
    opacity: 0.9;
    transform: scale(1.05);
  }
}

.animate-pulse-slow {
  animation: pulse-slow 3s ease-in-out infinite;
}

/* === FLOAT ANIMATION === */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

/* === RIPPLE EFFECT === */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  transform: scale(0);
  animation: ripple-animation 0.6s ease-out;
  pointer-events: none;
}

@keyframes ripple-animation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* === LANDING PAGE ANIMATIONS === */
@keyframes float {
  0%, 100% {
    transform: translateY(0) translateX(0);
  }
  33% {
    transform: translateY(-20px) translateX(10px);
  }
  66% {
    transform: translateY(10px) translateX(-10px);
  }
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

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

.animate-fade-in-up {
  opacity: 0;
  animation: fade-in-up 0.6s ease-out forwards;
}

.animate-fade-in {
  opacity: 0;
  animation: fade-in 0.6s ease-out forwards;
}

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

@keyframes pulse-scale {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.animate-pulse-scale {
  animation: pulse-scale 2s ease-in-out infinite;
}

@keyframes progress {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

.animate-progress {
  animation: progress 2s ease-out infinite;
}

/* Scroll-triggered animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease-out;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes pulse-border {
  0%, 100% {
    border-color: var(--flowayz-coral);
    border-width: 2px;
  }
  50% {
    border-color: var(--flowayz-teal);
    border-width: 3px;
  }
}

.pulse-icon {
  animation: pulse-glow 2s ease-in-out infinite;
}

.pulse-border {
  animation: pulse-border 1.5s ease-in-out infinite;
}

/* === RIPPLE EFFECT (Buttons) === */
@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 0.6;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

.ripple-effect {
  position: relative;
  overflow: hidden;
}

.ripple-effect::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  pointer-events: none;
}

.ripple-effect:active::after {
  animation: ripple 0.6s ease-out;
}

/* === SCALE UP (Cards) === */
@keyframes scale-up-card {
  from {
    transform: scale(1);
    box-shadow: var(--shadow-md);
  }
  to {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
  }
}

.hover-scale:hover {
  animation: scale-up-card 0.3s ease-out forwards;
}

/* === SLIDE IN MODAL === */
@keyframes slide-in-modal {
  from {
    transform: translateY(-50%) scale(0.9);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.modal-animate {
  animation: slide-in-modal 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* === FADE IN === */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* === ROTATE LOADING === */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.rotate-loading {
  animation: rotate 1s linear infinite;
}

/* === SHIMMER (Skeleton Loading) === */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.shimmer {
  background: linear-gradient(
    90deg,
    var(--flowayz-gray-100) 0%,
    var(--flowayz-gray-200) 50%,
    var(--flowayz-gray-100) 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* === SKELETON LOADERS (Theme-aware) === */
@keyframes skeleton-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes skeleton-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Base skeleton styles */
.skeleton-card,
.skeleton-list,
.skeleton-message,
.skeleton-table {
  position: relative;
  overflow: hidden;
}

/* Skeleton shimmer overlay effect */
.skeleton-line,
.skeleton-avatar,
.skeleton-image,
.skeleton-icon,
.skeleton-badge,
.skeleton-cell {
  position: relative;
  overflow: hidden;
}

.skeleton-line::after,
.skeleton-avatar::after,
.skeleton-image::after,
.skeleton-icon::after,
.skeleton-badge::after,
.skeleton-cell::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.15) 50%,
    transparent 100%
  );
  animation: skeleton-shimmer 1.5s infinite;
}

/* Dark mode shimmer adjustment */
[data-mode="dark"] .skeleton-line::after,
[data-mode="dark"] .skeleton-avatar::after,
[data-mode="dark"] .skeleton-image::after,
[data-mode="dark"] .skeleton-icon::after,
[data-mode="dark"] .skeleton-badge::after,
[data-mode="dark"] .skeleton-cell::after {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 50%,
    transparent 100%
  );
}

/* Typing dots for skeleton messages */
.skeleton-message .typing-dot {
  animation: typing-dot-bounce 1.4s ease-in-out infinite;
}

@keyframes typing-dot-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-4px);
  }
}

/* === BOUNCE === */
@keyframes bounce-gentle {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.bounce-gentle {
  animation: bounce-gentle 2s ease-in-out infinite;
}

/* === PROGRESS BAR WAVE === */
@keyframes progress-wave {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 200% 0%;
  }
}

.progress-wave {
  background: linear-gradient(
    90deg,
    var(--flowayz-coral) 0%,
    var(--flowayz-teal) 50%,
    var(--flowayz-coral) 100%
  );
  background-size: 200% 100%;
  animation: progress-wave 2s ease-in-out infinite;
}

/* === GLOW TEXT === */
@keyframes glow-text {
  0%, 100% {
    text-shadow: 0 0 10px rgba(255, 123, 84, 0.3);
  }
  50% {
    text-shadow: 0 0 20px rgba(255, 123, 84, 0.6), 0 0 30px rgba(255, 123, 84, 0.4);
  }
}

.glow-text {
  animation: glow-text 2s ease-in-out infinite;
}

/* === DRAG DROP ZONE ANIMATIONS === */
@keyframes border-dance {
  0%, 100% {
    border-color: var(--flowayz-teal);
    transform: rotate(0deg);
  }
  50% {
    border-color: var(--flowayz-coral);
    transform: rotate(180deg);
  }
}

.dropzone-active {
  animation: border-dance 1s linear infinite;
}

/* === UTILITY ANIMATION CLASSES === */
.animate-once {
  animation-iteration-count: 1 !important;
}

.animate-delay-1 {
  animation-delay: 0.1s;
}

.animate-delay-2 {
  animation-delay: 0.2s;
}

.animate-delay-3 {
  animation-delay: 0.3s;
}

.animate-delay-4 {
  animation-delay: 0.4s;
}

.animate-slow {
  animation-duration: 2s;
}

.animate-fast {
  animation-duration: 0.5s;
}

/* === HOVER LIFT === */
.hover-lift {
  transition: all var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* === SMOOTH FADE TRANSITION === */
.smooth-fade {
  transition: opacity var(--transition-slow);
}

.smooth-fade.hidden {
  opacity: 0;
  pointer-events: none;
}

/* === SCALE BOUNCE === */
@keyframes scale-bounce {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* === BOUNCE SUBTLE (pour checkmarks et sélections) === */
@keyframes bounce-subtle {
  0%, 100% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.15);
  }
  60% {
    transform: scale(0.95);
  }
}

.animate-bounce-subtle {
  animation: bounce-subtle 0.6s ease-in-out;
}

/* === RIPPLE CLICK EFFECT === */
@keyframes ripple-click {
  0% {
    transform: scale(0);
    opacity: 0.6;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

.ripple-click {
  position: relative;
  overflow: hidden;
}

.ripple-click::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.ripple-click:active::before {
  width: 300px;
  height: 300px;
  animation: ripple-click 0.6s ease-out;
}

/* === SMOOTH SCALE TRANSITION === */
.smooth-scale {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.smooth-scale:hover {
  transform: scale(1.02);
}

.smooth-scale:active {
  transform: scale(0.98);
}

/* === SCALE BOUNCE (Corrected) === */
@keyframes scale-bounce {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.1);
  }
  50% {
    transform: scale(0.95);
  }
  70% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.scale-bounce {
  animation: scale-bounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* === SVG PATH ANIMATION === */
@keyframes draw-line {
  from {
    stroke-dashoffset: 1000;
  }
  to {
    stroke-dashoffset: 0;
  }
}

.draw-svg-line {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: draw-line 2s ease-out forwards;
}

/* === TYPING INDICATOR === */
@keyframes typing-dot {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

.typing-indicator span {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 2px;
  background: var(--flowayz-coral);
  border-radius: 50%;
  animation: typing-dot 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

/* === TOAST NOTIFICATIONS === */
@keyframes toast-slide-in {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toast-slide-out {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

.toast {
  transform: translateX(400px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast-show {
  animation: toast-slide-in 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.toast-hide {
  animation: toast-slide-out 0.3s ease-in forwards;
}

/* === STREAMING ANIMATIONS (AI Chat) === */
@keyframes streaming-cursor {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.streaming-cursor {
  animation: streaming-cursor 1s infinite;
  display: inline-block;
  width: 2px;
  height: 1em;
  background: currentColor;
  vertical-align: text-bottom;
  margin-left: 1px;
}

@keyframes message-appear {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.message-appear {
  animation: message-appear 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes optimistic-message {
  0% {
    opacity: 0.7;
    transform: translateY(5px);
  }
  50% {
    opacity: 0.8;
    transform: translateY(0);
  }
  100% {
    opacity: 0.7;
  }
}

.optimistic-message {
  animation: optimistic-message 0.2s ease-out;
}

@keyframes connection-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }
}

.connection-status-online {
  animation: connection-pulse 2s infinite;
}

@keyframes fade-out-quick {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.9);
  }
}

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

/* === AI THINKING ANIMATIONS (Hypnotic Loading) === */

/* Avatar with pulsing ring */
.ai-thinking-avatar {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.ai-thinking-avatar .avatar-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    var(--accent, #8B5CF6),
    #EC4899,
    #F59E0B,
    var(--accent, #8B5CF6)
  );
  animation: avatar-ring-spin 2s linear infinite;
  opacity: 0.8;
}

.ai-thinking-avatar .avatar-ring::before {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--bg-surface);
}

.ai-thinking-avatar .avatar-core {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #8B5CF6 0%, #6366F1 100%);
  color: white;
  z-index: 1;
  animation: avatar-pulse 1.5s ease-in-out infinite;
}

@keyframes avatar-ring-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes avatar-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 20px 5px rgba(139, 92, 246, 0.2);
  }
}

/* Thinking text with animated dots */
.ai-thinking-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-thinking-text {
  font-size: 1rem;
  font-weight: 500;
}

.thinking-dots span {
  animation: thinking-dot-bounce 1.4s ease-in-out infinite;
  display: inline-block;
}

.thinking-dots span:nth-child(1) { animation-delay: 0s; }
.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes thinking-dot-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-4px);
  }
}

/* Sound wave animation */
.ai-wave-container {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 32px;
  padding: 8px 0;
}

.ai-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 100%;
}

.ai-wave span {
  display: block;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent, #8B5CF6), #EC4899);
  border-radius: 4px;
  animation: ai-wave-bar 1.2s ease-in-out infinite;
}

.ai-wave span:nth-child(1) { animation-delay: 0s; height: 60%; }
.ai-wave span:nth-child(2) { animation-delay: 0.1s; height: 100%; }
.ai-wave span:nth-child(3) { animation-delay: 0.2s; height: 80%; }
.ai-wave span:nth-child(4) { animation-delay: 0.3s; height: 100%; }
.ai-wave span:nth-child(5) { animation-delay: 0.4s; height: 60%; }

@keyframes ai-wave-bar {
  0%, 100% {
    transform: scaleY(0.5);
    opacity: 0.5;
  }
  50% {
    transform: scaleY(1);
    opacity: 1;
  }
}

/* Status badge */
.ai-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 9999px;
  background: var(--accent-10, rgba(139, 92, 246, 0.1));
  color: var(--accent, #8B5CF6);
  font-size: 0.75rem;
  font-weight: 500;
}

.ai-status-badge .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent, #8B5CF6);
  animation: status-dot-pulse 1.5s ease-in-out infinite;
}

@keyframes status-dot-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.7;
  }
}

/* Optimistic message sending indicator */
.sending-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sending-dots {
  display: inline-flex;
  gap: 2px;
}

.sending-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
  animation: sending-dot 1.2s ease-in-out infinite;
}

.sending-dots span:nth-child(1) { animation-delay: 0s; }
.sending-dots span:nth-child(2) { animation-delay: 0.2s; }
.sending-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes sending-dot {
  0%, 100% {
    transform: scale(1);
    opacity: 0.4;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
}

/* === AI RESPONSE PLACEHOLDER (Pre-scroll) === */
.ai-response-placeholder {
  animation: placeholder-fade-in 0.3s ease-out;
}

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

/* Placeholder avatar pulse */
.ai-placeholder-avatar {
  position: relative;
}

.ai-placeholder-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: inherit;
  animation: placeholder-pulse 1.5s ease-in-out infinite;
}

@keyframes placeholder-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.7;
  }
}

/* Thinking text animation */
.ai-thinking-text {
  background: linear-gradient(90deg,
    var(--text-secondary) 0%,
    var(--text-primary) 50%,
    var(--text-secondary) 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: thinking-shimmer 2s ease-in-out infinite;
}

@keyframes thinking-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Thinking dots animation */
.ai-thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.ai-thinking-dots .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8B5CF6, #EC4899);
  animation: thinking-dot-jump 1.4s ease-in-out infinite;
}

.ai-thinking-dots .dot:nth-child(1) { animation-delay: 0s; }
.ai-thinking-dots .dot:nth-child(2) { animation-delay: 0.15s; }
.ai-thinking-dots .dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes thinking-dot-jump {
  0%, 60%, 100% {
    transform: translateY(0) scale(1);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-6px) scale(1.2);
    opacity: 1;
  }
}

/* === QUOTE GENERATION LOADING ANIMATIONS === */

/* Slow ping animation for outer ring */
@keyframes ping-slow {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.2;
  }
  100% {
    transform: scale(1);
    opacity: 0.5;
  }
}

.animate-ping-slow {
  animation: ping-slow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Slow spin for middle ring */
@keyframes spin-slow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-spin-slow {
  animation: spin-slow 3s linear infinite;
}

/* Reverse spin for inner ring */
@keyframes spin-reverse {
  from {
    transform: rotate(360deg);
  }
  to {
    transform: rotate(0deg);
  }
}

.animate-spin-reverse {
  animation: spin-reverse 2s linear infinite;
}

/* Pulsing glow for center element */
.animate-pulse-glow {
  animation: pulse-glow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Gradient shift animation for background */
@keyframes gradient-shift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.animate-gradient-shift {
  background-size: 200% 200%;
  animation: gradient-shift 4s ease infinite;
}

/* Fade cycle for rotating text */
@keyframes fade-cycle {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.animate-fade-cycle {
  animation: fade-cycle 2s ease-in-out infinite;
}

/* Floating particles */
@keyframes particle-float {
  0%, 100% {
    transform: translateY(0) translateX(0) scale(1);
    opacity: 0;
  }
  10% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.8;
  }
  50% {
    transform: translateY(-100px) translateX(20px) scale(0.5);
  }
}

.particle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent, #FF7B54), #8B5CF6);
  animation: particle-float 4s ease-in-out infinite;
  opacity: 0;
}

.particle-1 {
  left: 10%;
  bottom: 20%;
  animation-delay: 0s;
}

.particle-2 {
  left: 30%;
  bottom: 30%;
  animation-delay: 0.8s;
  width: 6px;
  height: 6px;
}

.particle-3 {
  right: 20%;
  bottom: 25%;
  animation-delay: 1.6s;
  width: 10px;
  height: 10px;
}

.particle-4 {
  right: 35%;
  bottom: 15%;
  animation-delay: 2.4s;
  width: 5px;
  height: 5px;
}

.particle-5 {
  left: 50%;
  bottom: 35%;
  animation-delay: 3.2s;
  width: 7px;
  height: 7px;
}

/* === SECTION HIGHLIGHT ANIMATION === */
@keyframes highlight-section {
  0%, 100% {
    background-color: transparent;
  }
  50% {
    background-color: var(--accent-10, rgba(255, 123, 84, 0.1));
  }
}

.highlight-section {
  animation: highlight-section 2s ease-in-out;
  transition: background-color 0.3s ease;
}

/* === ACCESSIBILITY: REDUCED MOTION === */
/* Respects user preference for reduced motion (accessibility) */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  /* Keep essential loading indicators visible but static */
  .shimmer,
  .animate-wave,
  .typing-indicator span,
  .ai-wave span,
  .sending-dots span,
  .ai-thinking-dots .dot {
    animation: none !important;
    opacity: 1 !important;
  }

  /* Disable parallax and floating effects */
  .animate-float,
  .animate-blob,
  .hover-lift:hover {
    transform: none !important;
    animation: none !important;
  }

  /* Keep hover states but without animation */
  .smooth-scale:hover,
  .hover-scale:hover {
    transform: none !important;
    animation: none !important;
  }
}
/* ==========================================================================
   DOPAMINE UX — FL Studio-Style Animation System
   3 levels: off / subtle / ultra
   All animations use transform & opacity only (GPU-accelerated)
   Uses var(--accent) for glow colors
   ========================================================================== */

/* ==========================================================================
   Section 1: Variables & Timings
   ========================================================================== */

:root {
  --dop-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dop-bounce: cubic-bezier(0.68, -0.55, 0.27, 1.55);
  --dop-smooth: cubic-bezier(0.25, 0.1, 0.25, 1);
  --dop-snappy: cubic-bezier(0.19, 1, 0.22, 1);
  --dop-stagger-base: 60ms;
}

/* ==========================================================================
   Section 2: Staggered Reveal (Page Entry)
   ========================================================================== */

[data-animations="subtle"] .dop-stagger,
[data-animations="ultra"] .dop-stagger {
  opacity: 0;
  transform: translateY(12px);
  animation: dop-fade-up 0.5s var(--dop-smooth) forwards;
}

/* Stagger delays via nth-child */
[data-animations="subtle"] .dop-stagger-parent > .dop-stagger:nth-child(1),
[data-animations="ultra"] .dop-stagger-parent > .dop-stagger:nth-child(1) { animation-delay: calc(var(--dop-stagger-base) * 0); }
[data-animations="subtle"] .dop-stagger-parent > .dop-stagger:nth-child(2),
[data-animations="ultra"] .dop-stagger-parent > .dop-stagger:nth-child(2) { animation-delay: calc(var(--dop-stagger-base) * 1); }
[data-animations="subtle"] .dop-stagger-parent > .dop-stagger:nth-child(3),
[data-animations="ultra"] .dop-stagger-parent > .dop-stagger:nth-child(3) { animation-delay: calc(var(--dop-stagger-base) * 2); }
[data-animations="subtle"] .dop-stagger-parent > .dop-stagger:nth-child(4),
[data-animations="ultra"] .dop-stagger-parent > .dop-stagger:nth-child(4) { animation-delay: calc(var(--dop-stagger-base) * 3); }
[data-animations="subtle"] .dop-stagger-parent > .dop-stagger:nth-child(5),
[data-animations="ultra"] .dop-stagger-parent > .dop-stagger:nth-child(5) { animation-delay: calc(var(--dop-stagger-base) * 4); }
[data-animations="subtle"] .dop-stagger-parent > .dop-stagger:nth-child(6),
[data-animations="ultra"] .dop-stagger-parent > .dop-stagger:nth-child(6) { animation-delay: calc(var(--dop-stagger-base) * 5); }
[data-animations="subtle"] .dop-stagger-parent > .dop-stagger:nth-child(7),
[data-animations="ultra"] .dop-stagger-parent > .dop-stagger:nth-child(7) { animation-delay: calc(var(--dop-stagger-base) * 6); }
[data-animations="subtle"] .dop-stagger-parent > .dop-stagger:nth-child(8),
[data-animations="ultra"] .dop-stagger-parent > .dop-stagger:nth-child(8) { animation-delay: calc(var(--dop-stagger-base) * 7); }
[data-animations="subtle"] .dop-stagger-parent > .dop-stagger:nth-child(9),
[data-animations="ultra"] .dop-stagger-parent > .dop-stagger:nth-child(9) { animation-delay: calc(var(--dop-stagger-base) * 8); }
[data-animations="subtle"] .dop-stagger-parent > .dop-stagger:nth-child(10),
[data-animations="ultra"] .dop-stagger-parent > .dop-stagger:nth-child(10) { animation-delay: calc(var(--dop-stagger-base) * 9); }
[data-animations="subtle"] .dop-stagger-parent > .dop-stagger:nth-child(n+11),
[data-animations="ultra"] .dop-stagger-parent > .dop-stagger:nth-child(n+11) { animation-delay: calc(var(--dop-stagger-base) * 10); }

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

/* ==========================================================================
   Section 3: Card Interactions
   ========================================================================== */

/* Subtle — Hover lift + shadow */
[data-animations="subtle"] .card {
  transition: transform 0.25s var(--dop-smooth), box-shadow 0.25s var(--dop-smooth), border-color 0.25s ease;
}

[data-animations="subtle"] .card:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

/* Disable card hover effects inside forms (static cards) */
[data-animations="subtle"] .card:has(form):hover,
[data-animations="subtle"] .card:has(.form-input):hover,
[data-animations="subtle"] .card:has(.form-textarea):hover,
[data-animations="subtle"] form .card:hover {
  transform: none;
  box-shadow: none;
}

/* Ultra — Lift + scale + accent glow */
[data-animations="ultra"] .card {
  transition: transform 0.3s var(--dop-spring), box-shadow 0.3s var(--dop-spring), border-color 0.3s ease;
}

[data-animations="ultra"] .card:hover {
  box-shadow:
    0 12px 35px rgba(0, 0, 0, 0.1),
    0 0 20px color-mix(in srgb, var(--accent) 20%, transparent);
}

/* Form cards in ultra: no zoom, soft accent glow instead */
[data-animations="ultra"] .card:has(form):hover,
[data-animations="ultra"] .card:has(.form-input):hover,
[data-animations="ultra"] .card:has(.form-textarea):hover,
[data-animations="ultra"] form .card:hover {
  transform: none;
  box-shadow:
    0 0 0 1px var(--accent-20, rgba(56, 178, 172, 0.2)),
    0 0 20px var(--accent-10, rgba(56, 178, 172, 0.1)),
    0 0 40px var(--accent-5, rgba(56, 178, 172, 0.05));
  border-color: var(--accent-20, rgba(56, 178, 172, 0.2));
}

/* Ultra — 3D tilt (applied via JS on .dop-tilt elements) */
[data-animations="ultra"] .dop-tilt {
  transition: transform 0.15s ease-out;
  transform-style: preserve-3d;
}

/* ==========================================================================
   Section 4: Button Effects
   ========================================================================== */

/* Subtle — Lift + bounce-back */
[data-animations="subtle"] .btn {
  transition: transform 0.3s var(--dop-spring), box-shadow 0.3s var(--dop-spring), background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

[data-animations="subtle"] .btn:hover {
  transform: translateY(-1px);
}

[data-animations="subtle"] .btn:active {
  transform: scale(0.97);
  transition-duration: 0.1s;
}

/* Ultra — Glow + deep press + bounce-back */
[data-animations="ultra"] .btn {
  transition: transform 0.4s var(--dop-bounce), box-shadow 0.4s var(--dop-bounce), background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

[data-animations="ultra"] .btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 4px 15px rgba(0, 0, 0, 0.1),
    0 0 15px color-mix(in srgb, var(--accent) 15%, transparent);
}

[data-animations="ultra"] .btn:active {
  transform: scale(0.94);
  transition-duration: 0.15s;
}

/* Ultra — Ripple effect */
[data-animations="ultra"] .btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255,255,255,0.3) 0%, transparent 60%);
  opacity: 0;
  transform: scale(0);
  transition: transform 0.5s ease-out, opacity 0.5s ease-out;
  pointer-events: none;
}

[data-animations="ultra"] .btn:active::after {
  opacity: 1;
  transform: scale(2.5);
  transition-duration: 0.1s, 0s;
}

/* Success state morphing */
[data-animations="subtle"] .dop-success,
[data-animations="ultra"] .dop-success {
  animation: dop-success-pulse 0.6s var(--dop-spring);
}

@keyframes dop-success-pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   Section 5: Input Focus Effects
   ========================================================================== */

/* Subtle — Accent border + soft ring */
[data-animations="subtle"] .form-input:focus,
[data-animations="subtle"] input:focus,
[data-animations="subtle"] textarea:focus,
[data-animations="subtle"] select:focus {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Ultra — Accent border + pulsing glow */
[data-animations="ultra"] .form-input:focus,
[data-animations="ultra"] input:focus,
[data-animations="ultra"] textarea:focus,
[data-animations="ultra"] select:focus {
  animation: dop-focus-glow 2s ease-in-out infinite;
}

@keyframes dop-focus-glow {
  0%, 100% {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
  }
  50% {
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 30%, transparent),
                0 0 15px color-mix(in srgb, var(--accent) 10%, transparent);
  }
}

/* ==========================================================================
   Section 6: Navigation & Sidebar
   ========================================================================== */

/* Subtle — Active nav item with accent accent */
[data-animations="subtle"] .sidebar .sidebar-link {
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

[data-animations="subtle"] .sidebar .sidebar-link:hover {
  background-color: color-mix(in srgb, var(--accent) 5%, transparent);
}

/* Ultra — Slide-in hover background */
[data-animations="ultra"] .sidebar .sidebar-link {
  position: relative;
  overflow: hidden;
  transition: color 0.2s ease;
}

[data-animations="ultra"] .sidebar .sidebar-link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--dop-snappy);
  pointer-events: none;
  z-index: 0;
}

[data-animations="ultra"] .sidebar .sidebar-link:hover::before {
  transform: scaleX(1);
}

[data-animations="ultra"] .sidebar .sidebar-link > * {
  position: relative;
  z-index: 1;
}

/* Ultra — Badge pulse */
[data-animations="ultra"] .sidebar .badge,
[data-animations="ultra"] .sidebar [data-badge] {
  animation: dop-badge-pulse 2s ease-in-out infinite;
}

@keyframes dop-badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* ==========================================================================
   Section 7: Toast / Flash Enhancements
   ========================================================================== */

/* Subtle — Spring entrance */
[data-animations="subtle"] .flash-message {
  animation: dop-toast-in 0.5s var(--dop-spring) forwards;
}

/* Ultra — Spring entrance with icon bounce */
[data-animations="ultra"] .flash-message {
  animation: dop-toast-in 0.5s var(--dop-spring) forwards;
}

[data-animations="ultra"] .flash-message .flash-message-icon {
  animation: dop-icon-bounce 0.6s var(--dop-bounce) 0.2s both;
}

@keyframes dop-toast-in {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes dop-icon-bounce {
  0% { transform: scale(0.5) rotate(-10deg); }
  60% { transform: scale(1.2) rotate(5deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* Stacked toasts offset (ultra) */
[data-animations="ultra"] .flash-message:nth-child(2) { animation-delay: 50ms; }
[data-animations="ultra"] .flash-message:nth-child(3) { animation-delay: 100ms; }

/* ==========================================================================
   Section 8: Number Counter Animation
   ========================================================================== */

/* Counter elements — animated by JS dopamine controller */
[data-animations="subtle"] .dop-counter,
[data-animations="ultra"] .dop-counter {
  display: inline-block;
}

/* ==========================================================================
   Section 9: Skeleton -> Content Crossfade
   ========================================================================== */

[data-animations="subtle"] .dop-skeleton-reveal,
[data-animations="ultra"] .dop-skeleton-reveal {
  animation: dop-reveal 0.4s var(--dop-smooth) forwards;
}

@keyframes dop-reveal {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ==========================================================================
   Section 10: Celebrations (Ultra only)
   ========================================================================== */

/* Confetti container */
.dop-celebration-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

/* Confetti particle */
.dop-confetti {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: dop-confetti-fall linear forwards;
}

@keyframes dop-confetti-fall {
  0% {
    transform: translateY(-10px) rotate(0deg) scale(1);
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg) scale(0.5);
    opacity: 0;
  }
}

/* Sparkle */
.dop-sparkle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: dop-sparkle 0.8s var(--dop-spring) forwards;
}

@keyframes dop-sparkle {
  0% {
    transform: scale(0) rotate(0deg);
    opacity: 1;
  }
  50% {
    transform: scale(1.5) rotate(180deg);
    opacity: 1;
  }
  100% {
    transform: scale(0) rotate(360deg);
    opacity: 0;
  }
}

/* Success ring */
[data-animations="ultra"] .dop-success-ring {
  animation: dop-success-ring 0.8s var(--dop-smooth) forwards;
}

@keyframes dop-success-ring {
  0% {
    transform: scale(0.5);
    opacity: 1;
    box-shadow: 0 0 0 0 var(--accent);
  }
  100% {
    transform: scale(1);
    opacity: 0;
    box-shadow: 0 0 0 30px transparent;
  }
}

/* ==========================================================================
   Section 11: Page Transitions (Morph)
   ========================================================================== */

/* Crossfade page transitions (Subtle + Ultra) */
.dop-page-exit {
  animation: dop-fade-out 0.15s ease forwards;
}

.dop-page-enter {
  animation: dop-fade-up 0.3s var(--dop-spring) forwards;
}

@keyframes dop-fade-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

/* Ultra — View Transitions API morph */
::view-transition-old(main-content) {
  animation: dop-morph-out 0.2s var(--dop-smooth);
}

::view-transition-new(main-content) {
  animation: dop-morph-in 0.3s var(--dop-spring);
}

::view-transition-old(sidebar) {
  animation: none;
}

::view-transition-new(sidebar) {
  animation: none;
}

::view-transition-old(header) {
  animation: none;
}

::view-transition-new(header) {
  animation: none;
}

@keyframes dop-morph-out {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.98);
  }
}

@keyframes dop-morph-in {
  from {
    opacity: 0;
    transform: scale(1.02);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ==========================================================================
   Section 12: Reduced Motion Override (Off Level)
   ========================================================================== */

[data-animations="off"] .dop-stagger,
[data-animations="off"] .dop-counter,
[data-animations="off"] .dop-tilt,
[data-animations="off"] .dop-skeleton-reveal {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

[data-animations="off"] .card,
[data-animations="off"] .btn {
  transition-duration: 0.01ms !important;
}

[data-animations="off"] .flash-message {
  animation: none !important;
}

/* Also respect prefers-reduced-motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .dop-stagger,
  .dop-counter,
  .dop-tilt,
  .dop-skeleton-reveal,
  .flash-message,
  .dop-confetti,
  .dop-sparkle {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
