/* ============================================
   SISTEMA DE ANIMAÇÕES CUSTOMIZADAS
   ============================================ */

/* Gradient Shift Animation - Gradiente animado */
@keyframes gradient-shift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

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

/* Pulse Soft - Pulse suave e elegante */
@keyframes pulse-soft {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.03);
  }
}

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

/* Blob Morphing - Formas orgânicas que mudam */
@keyframes blob-morph {
  0%, 100% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    transform: translate(0, 0) scale(1);
  }
  25% {
    border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    transform: translate(15px, -15px) scale(1.08);
  }
  50% {
    border-radius: 70% 30% 50% 50% / 30% 50% 70% 60%;
    transform: translate(-15px, 15px) scale(0.95);
  }
  75% {
    border-radius: 40% 60% 30% 60% / 70% 30% 50% 50%;
    transform: translate(8px, 8px) scale(1.03);
  }
}

.animate-blob-morph {
  animation: blob-morph 10s ease-in-out infinite;
}

/* Shimmer Loading - Efeito de brilho para skeletons */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.animate-shimmer {
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 1.5s linear infinite;
}

/* Border Rotate - Borda com gradiente animado */
@keyframes border-rotate {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.animate-border-rotate {
  background: linear-gradient(
    90deg,
    #6366f1,
    #8b5cf6,
    #06b6d4,
    #8b5cf6,
    #6366f1
  );
  background-size: 300% 300%;
  animation: border-rotate 5s ease infinite;
}

/* Hover 3D Effect - Rotação 3D sutil em hover */
.hover-3d {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

.hover-3d:hover {
  transform: perspective(1000px) rotateX(2deg) rotateY(-2deg) translateY(-4px);
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.2);
}

/* Glow Effect - Brilho expansivo */
.glow-effect {
  position: relative;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.glow-effect::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(45deg, #6366f1, #8b5cf6, #06b6d4);
  opacity: 0;
  filter: blur(8px);
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}

.glow-effect:hover::before {
  opacity: 0.5;
}

.glow-effect:hover {
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.4);
}

/* Glass Morphism - Efeito de vidro fosco */
.glass-morphism {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Scroll Reveal - Animação de entrada suave */
@keyframes scroll-reveal {
  from {
    opacity: 0;
    transform: translateY(25px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.scroll-reveal {
  opacity: 0;
  animation: scroll-reveal 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.scroll-reveal-delay-1 {
  animation-delay: 0.08s;
}

.scroll-reveal-delay-2 {
  animation-delay: 0.15s;
}

.scroll-reveal-delay-3 {
  animation-delay: 0.22s;
}

.scroll-reveal-delay-4 {
  animation-delay: 0.3s;
}

/* Hover Scale - Crescimento suave */
.hover-scale {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.hover-scale:hover {
  transform: scale(1.04);
}

/* Otimizações de Performance */
.will-change-transform {
  will-change: transform;
}

.will-change-opacity {
  will-change: opacity;
}

/* Rich text rendering */
.rich-content {
  color: inherit;
}

.rich-content h3,
.rich-content h4 {
  color: #e2e8f0;
  font-weight: 700;
  line-height: 1.3;
  margin: 0.7rem 0 0.5rem;
}

.rich-content h3 {
  font-size: 1.05em;
}

.rich-content h4 {
  font-size: 0.98em;
}

.rich-content p {
  margin: 0.5rem 0;
}

.rich-content ul,
.rich-content ol {
  margin: 0.55rem 0;
  padding-left: 1.1rem;
}

.rich-content ul {
  list-style: none;
  padding-left: 0;
}

.rich-content ul li {
  position: relative;
  padding-left: 1.1rem;
}

.rich-content ul li::before {
  content: "➜";
  position: absolute;
  left: 0;
  top: 0.12em;
  color: #818cf8;
  font-size: 0.82em;
  line-height: 1;
}

.rich-content li + li {
  margin-top: 0.2rem;
}

.rich-content blockquote {
  margin: 0.65rem 0;
  padding-left: 0.75rem;
  border-left: 3px solid rgba(99, 102, 241, 0.55);
  color: #cbd5e1;
}

.rich-content a {
  color: #a5b4fc;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rich-content a:hover {
  color: #c7d2fe;
}

/* Compact mode used for cards with "Ler mais" */
.rich-content-compact p,
.rich-content-compact h3,
.rich-content-compact h4,
.rich-content-compact blockquote,
.rich-content-compact ul,
.rich-content-compact ol,
.rich-content-compact li,
.rich-content-compact div,
.rich-content-compact span {
  display: inline;
  margin: 0;
  padding: 0;
}

.rich-content-compact ul,
.rich-content-compact ol {
  list-style: none;
  padding-left: 0;
}

.rich-content-compact li::before {
  content: "➜ ";
  color: #818cf8;
}

.rich-content-clamp-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.rich-content-compact {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.rich-content-compact a {
  overflow-wrap: anywhere;
  word-break: break-all;
}

/* Rich text editor input placeholder + defaults */
.rich-editor-input:empty::before {
  content: attr(data-placeholder);
  color: #475569;
  pointer-events: none;
}

.rich-editor-input p {
  margin: 0.45rem 0;
}

.rich-editor-input ul,
.rich-editor-input ol {
  margin: 0.5rem 0;
  padding-left: 1.1rem;
}

/* Desabilitar animações em dispositivos móveis (opcional, para performance) */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Mobile: reduzir microinterações e brilho decorativo */
@media (max-width: 767px) {
  .hover-3d:hover {
    transform: none;
    box-shadow: none;
  }

  .hover-scale:hover {
    transform: none;
  }

  .glow-effect::before,
  .glow-effect:hover::before {
    opacity: 0;
  }

  .glow-effect:hover {
    box-shadow: none;
  }
}
