/* ============================================================
   Delta Analítica — animations.css
   Park — especialista em animações, transições e micro-interações
   ============================================================ */

/* --- KEYFRAMES --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInFast {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(24px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0)   scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); max-height: 60px; margin-bottom: 8px; }
  to   { opacity: 0; transform: translateX(24px); max-height: 0;  margin-bottom: 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}

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

@keyframes goldGlow {
  0%, 100% { box-shadow: 0 0 12px rgba(201, 162, 39, 0.25); }
  50%       { box-shadow: 0 0 24px rgba(201, 162, 39, 0.50); }
}

@keyframes progressPulse {
  0%, 100% { box-shadow: 0 0 0 0   rgba(201, 162, 39, 0.4); }
  50%       { box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.0); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15%       { transform: translateX(-8px); }
  30%       { transform: translateX(7px); }
  45%       { transform: translateX(-6px); }
  60%       { transform: translateX(5px); }
  75%       { transform: translateX(-3px); }
  90%       { transform: translateX(2px); }
}

/* --- ANIMATION HELPERS --- */
.anim-fade-in  { animation: fadeIn  0.35s ease both; }
.anim-slide-in { animation: slideInRight 0.35s ease both; }
.anim-scale-in { animation: scaleIn 0.28s ease both; }

.anim-delay-1 { animation-delay: 0.05s; }
.anim-delay-2 { animation-delay: 0.10s; }
.anim-delay-3 { animation-delay: 0.15s; }
.anim-delay-4 { animation-delay: 0.20s; }
.anim-delay-5 { animation-delay: 0.25s; }

/* --- SPINNER --- */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }

/* --- SKELETON --- */
.skeleton {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.05) 25%,
    rgba(255,255,255,0.10) 50%,
    rgba(255,255,255,0.05) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
  height: 16px;
}

/* --- TOAST ANIMATIONS --- */
.toast { animation: toastIn 0.3s ease both; }
.toast.removing { animation: toastOut 0.3s ease forwards; overflow: hidden; }

/* --- PROGRESS BAR --- */
.progress-fill.active { animation: progressPulse 1.5s ease infinite; }

/* --- HOVER LIFT (para cards clicáveis) --- */
.hover-lift { transition: transform 0.2s ease, box-shadow 0.2s ease; }
.hover-lift:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }

/* --- FOCUS RING ACESSÍVEL --- */
:focus-visible {
  outline: 2px solid var(--primaria);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* --- TOPBAR GOLD LINE (animação sutil) --- */
.topbar::after { animation: fadeInFast 0.5s ease; }

/* --- SIDEBAR OPEN --- */
.sidebar { transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.sidebar-overlay { transition: opacity 0.3s ease, backdrop-filter 0.3s ease; }
.sidebar-overlay.active { backdrop-filter: blur(3px); }

/* --- CONVERTER CARD GLOW --- */
.converter-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg,
    transparent 0%,
    rgba(201, 162, 39, 0.08) 50%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 0;
}
.converter-card:hover::after { opacity: 1; }
.converter-card > * { position: relative; z-index: 1; }

/* --- LOGIN CARD GLOW --- */
.login-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: calc(var(--radius-xl) + 1px);
  background: linear-gradient(135deg,
    rgba(201, 162, 39, 0.25) 0%,
    transparent              50%,
    rgba(201, 162, 39, 0.10) 100%
  );
  z-index: -1;
  pointer-events: none;
}

/* --- MODAL --- */
.modal-overlay { backdrop-filter: blur(0px); transition: opacity 0.25s ease, backdrop-filter 0.25s ease; }
.modal-overlay.active { backdrop-filter: blur(4px); }
.modal { transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1); }

/* --- TAB CONTENT SWITCH --- */
.tab-panel.active { animation: fadeIn 0.22s ease both; }

/* --- FILE ITEM APPEAR --- */
.file-item { animation: fadeIn 0.25s ease both; }

/* --- KPI VALUE HOVER --- */
.kpi-value { transition: transform 0.25s ease; }
.kpi-card:hover .kpi-value { transform: scale(1.06); }

/* --- DRAG OVER PULSE --- */
.drop-zone.drag-over .drop-icon { animation: pulse 0.7s ease infinite; }

/* --- BUTTON ACTIVE STATE --- */
.btn { transition: all 0.2s ease; }
.btn:active:not(:disabled) { transform: scale(0.97) !important; }

/* --- BADGE ENTRANCE --- */
.converter-card-badge { animation: fadeInFast 0.4s ease both; animation-delay: 0.1s; }

/* --- REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration:       0.01ms !important;
    animation-iteration-count: 1     !important;
    transition-duration:       0.01ms !important;
  }
}
