/**
 * TaviClean — animações e microinterações (respeita prefers-reduced-motion)
 */

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

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.screen.screen-enter-active {
  animation: screenIn 0.38s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes tabFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tab-panel.tab-animating {
  animation: tabFade 0.32s ease forwards;
}

@keyframes heroGlow {
  0%,
  100% {
    box-shadow: 0 4px 20px rgba(30, 84, 183, 0.15);
  }
  50% {
    box-shadow: 0 8px 28px rgba(30, 84, 183, 0.28);
  }
}

.hero-next {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(230, 240, 255, 0.9));
  border: 1px solid rgba(30, 84, 183, 0.12);
  animation: heroGlow 4s ease-in-out infinite;
}

@keyframes pulseDot {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.85;
  }
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-mint);
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes floatIcon {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

.float-icon {
  animation: floatIcon 3.5s ease-in-out infinite;
}

/* Drawer centro de operação */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.drawer-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(92vw, 360px);
  max-width: 400px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f7fb 100%);
  z-index: 95;
  transform: translateX(-105%);
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 8px 0 40px rgba(0, 40, 100, 0.12);
  display: flex;
  flex-direction: column;
}

.drawer-panel.is-open {
  transform: translateX(0);
}

.drawer-head {
  padding: 20px 18px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.9);
}

.drawer-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 12px;
  scrollbar-width: none;
}

.drawer-tabs::-webkit-scrollbar {
  display: none;
}

.drawer-tab {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  background: #eef2f7;
  color: #6b7b8d;
  transition: all 0.2s;
}

.drawer-tab.active {
  background: linear-gradient(135deg, #1e54b7, #3b7ddd);
  color: white;
  box-shadow: 0 4px 12px rgba(30, 84, 183, 0.25);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px 28px;
}

.drawer-section {
  display: none;
}

.drawer-section.is-active {
  display: block;
  animation: tabFade 0.35s ease forwards;
}

/* Cards interativos */
.card-lift {
  transition:
    transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.25s ease;
}

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

@media (hover: hover) {
  .card-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 40, 100, 0.1);
  }
}

/* Pipeline */
.pipeline-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.pipeline-col {
  text-align: center;
  padding: 10px 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: transform 0.2s;
}

.pipeline-col strong {
  display: block;
  font-size: 18px;
  font-weight: 800;
  color: #1e54b7;
}

.pipeline-col span {
  font-size: 9px;
  color: #8896ab;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Agenda timeline */
.timeline-item {
  position: relative;
  padding-left: 18px;
  border-left: 3px solid #e2e8f0;
  margin-left: 8px;
  padding-bottom: 4px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 6px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e54b7, #3b7ddd);
  box-shadow: 0 0 0 3px rgba(30, 84, 183, 0.2);
}

.timeline-item.done {
  border-left-color: var(--accent-mint);
  opacity: 0.75;
}

.timeline-item.done::before {
  background: var(--accent-mint);
}

/* Checklist celebração */
@keyframes progressFlash {
  0% {
    filter: brightness(1);
  }
  40% {
    filter: brightness(1.15);
  }
  100% {
    filter: brightness(1);
  }
}

.checklist-complete #checklist-progress,
.checklist-complete #svc-detail-progress {
  animation: progressFlash 0.8s ease;
}

@keyframes sparkle {
  0%,
  100% {
    opacity: 0;
  }
  50% {
    opacity: 0.6;
  }
}

/* Botões */
.press-scale {
  transition: transform 0.15s ease;
}

.press-scale:active {
  transform: scale(0.96);
}

/* Stock badge */
.stock-low {
  color: #dc2626;
  font-weight: 700;
}

/* Shimmer loading (opcional) */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.shimmer-bg {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* Scroll reveal (IntersectionObserver) */
.observe-rise {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.observe-rise.revealed {
  opacity: 1;
  transform: translateY(0);
}

.bar-anim {
  transition: height 0.85s cubic-bezier(0.34, 1.56, 0.64, 1);
}
