/* ================================================================
   MEOKS — Commerce Operating System
   animations.css · Keyframe'ler ve hareket katmanı
   Loader · Marquee · Glow · Neon border · Floating · Pulse · Typing
   ================================================================ */

/* ============ 1 · Yükleme ekranı ============ */
.loader {
  position: fixed; inset: 0;
  z-index: 999;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 26px;
  transition: opacity 0.6s ease, visibility 0.6s;
}
.loader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }

.loader__logo { display: flex; align-items: center; }

.loader__word {
  font-size: 1.7rem; font-weight: 700; letter-spacing: 0.26em;
  animation: loaderWord 1.8s ease-in-out infinite;
}

.loader__bar {
  width: 220px; height: 4px;
  border-radius: 4px;
  background: var(--bg-3);
  overflow: hidden;
}
.loader__progress {
  display: block;
  height: 100%; width: 0%;
  border-radius: inherit;
  background: var(--grad-brand);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.6);
  transition: width 0.3s ease;
}

.loader__hint {
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
}

@keyframes loaderWord {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* Sayfa içeriği loader bitmeden animasyon başlatmasın */
body.preload .marquee__track,
body.preload .hero__float,
body.preload .hero__badge-dot { animation-play-state: paused; }

/* ============ 2 · Neon border (dashboard, AI chat, CTA) ============ */
.neon-border { position: relative; }
.neon-border::before {
  content: "";
  position: absolute; inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(120deg,
    rgba(47, 128, 237, 0.0) 0%,
    rgba(47, 128, 237, 0.7) 25%,
    rgba(0, 229, 255, 0.9) 50%,
    rgba(47, 128, 237, 0.7) 75%,
    rgba(47, 128, 237, 0.0) 100%);
  background-size: 300% 100%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
  animation: neonSlide 5s linear infinite;
  animation-play-state: paused; /* app.js öğe ekrana girince .is-live verir */
  pointer-events: none;
  z-index: 1;
}
.neon-border.is-live::before { animation-play-state: running; }

@keyframes neonSlide {
  0% { background-position: 0% 0; }
  100% { background-position: 300% 0; }
}

/* ============ 3 · Marquee (sonsuz logo şeridi) ============ */
.marquee[data-direction="left"] .marquee__track { animation: marqueeLeft 36s linear infinite; }
.marquee[data-direction="right"] .marquee__track { animation: marqueeRight 42s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }

@keyframes marqueeLeft {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes marqueeRight {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

/* ============ 4 · Hero: yüzen kartlar & rozet & scroll ============ */
.hero__float--1 { animation: floatY 6s ease-in-out infinite; }
.hero__float--2 { animation: floatY 7.5s ease-in-out 0.8s infinite; }
.hero__float--3 { animation: floatY 6.8s ease-in-out 1.6s infinite; }

/* translate özelliği JS'in kullandığı transform'dan bağımsızdır;
   margin animasyonu gibi her karede layout hesaplatmaz (yalnızca composite). */
@keyframes floatY {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -16px; }
}

.hero__badge-dot { animation: dotPulse 2s ease-in-out infinite; }

@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 6px var(--cyan); opacity: 1; }
  50% { box-shadow: 0 0 16px var(--cyan); opacity: 0.6; }
}

.hero__scroll-mouse span { animation: scrollWheel 1.8s ease-in-out infinite; }

@keyframes scrollWheel {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(10px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ============ 5 · Harita: merkez nabız ============ */
.map-node__pulse { animation: mapPulse 2.4s var(--ease) infinite; }

@keyframes mapPulse {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(1.55); opacity: 0; }
}

/* Not: düğümlerde sürekli box-shadow animasyonu vardı; her karede repaint
   yaptırdığı için kaldırıldı — hover'daki parlama yeterli. */

/* ============ 6 · Dashboard: canlı nokta & yeni sipariş ============ */
.dash__live-dot { animation: dotPulse 1.6s ease-in-out infinite; }

.feed__item.is-new { animation: feedIn 0.5s var(--ease) both; }

@keyframes feedIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

/* ============ 7 · AI chat: yazıyor noktaları & imleç ============ */
.ai-chat__typing span { animation: typingDot 1.2s ease-in-out infinite; }
.ai-chat__typing span:nth-child(2) { animation-delay: 0.18s; }
.ai-chat__typing span:nth-child(3) { animation-delay: 0.36s; }

@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.ai-chat__msg--bot.is-typing::after {
  content: "▋";
  color: #A78BFF;
  animation: cursorBlink 0.8s step-end infinite;
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.ai-chat__status-dot { animation: dotPulse 2.2s ease-in-out infinite; }

/* ============ 8 · Genel reveal yedeği (AOS yoksa) ============ */
/* app.js AOS'u başlatamazsa data-aos öğelerini görünür yapar;
   bu blok yalnızca .no-aos senaryosunda devreye girer. */
body.no-aos [data-aos] {
  opacity: 1 !important;
  transform: none !important;
}

/* ============ 9 · Glow hover yardımcı sınıfı ============ */
.btn--glow::after {
  content: "";
  position: absolute; inset: -3px;
  border-radius: inherit;
  background: var(--grad-brand);
  filter: blur(14px);
  opacity: 0;
  z-index: -1;
  transition: opacity 0.35s ease;
}
.btn--glow:hover::after { opacity: 0.55; }

/* ============ 10 · Azaltılmış hareket ============ */
@media (prefers-reduced-motion: reduce) {
  .loader__word,
  .marquee__track,
  .hero__float--1, .hero__float--2, .hero__float--3,
  .map-node,
  .map-node__pulse,
  .wheel__orbit,
  .wheel__core-pulse,
  .neon-border::before { animation: none !important; }
}
