/* ══════════════════════════════════════════════════════════
   animations.css — FIFA 2026 Stadium Hub
   Micro-animations, keyframes, and welcome screen sequences
══════════════════════════════════════════════════════════ */

/* BUG 4 FIX: Welcome screen must be a single non-scrolling viewport-fixed layer.
   No overflow:auto — body scroll is locked by JS on load, restored on dismiss.
   Content is sized to fit common viewport heights without scrolling. */
#welcome-screen {
  position: fixed;
  inset: 0;
  background: var(--color-bg-base);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.65s cubic-bezier(0.7, 0, 0.3, 1), opacity 0.65s ease;
}
#welcome-screen.hide {
  transform: translateY(-100%);
  opacity: 0;
}

/* Background Pitch/Rings */
.welcome-pitch {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(45, 92, 52, 0.05) 0%, transparent 70%);
}
.welcome-rings {
  position: absolute;
  width: 100vmin; height: 100vmin;
  display: flex; align-items: center; justify-content: center;
}
.welcome-ring {
  position: absolute;
  border: 1px solid rgba(45, 92, 52, 0.1);
  border-radius: 50%;
  animation: expandRing 8s linear infinite;
  opacity: 0;
}
.welcome-ring:nth-child(1) { width: 20%; height: 20%; animation-delay: 0s; }
.welcome-ring:nth-child(2) { width: 40%; height: 40%; animation-delay: 2s; }
.welcome-ring:nth-child(3) { width: 60%; height: 60%; animation-delay: 4s; }
.welcome-ring:nth-child(4) { width: 80%; height: 80%; animation-delay: 6s; }

@keyframes expandRing {
  0% { transform: scale(0.5); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}

.welcome-content {
  position: relative;
  z-index: 10;
  text-align: center;
  max-width: 800px;
  /* Reduced padding to ensure single-screen fit at 768px tall */
  padding: 16px 24px;
  width: 100%;
}

.welcome-badge {
  display: inline-block;
  background: var(--color-pitch-green);
  color: white;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 14px;
  animation: slideDownFade 0.6s ease-out forwards;
}

.welcome-ball {
  display: block;
  font-size: 3rem;
  margin: 0 auto 10px;
  animation: floatBall 4s ease-in-out infinite, fadeIn 1s ease-out forwards;
}
@keyframes floatBall {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-15px) rotate(10deg); }
}

.welcome-title {
  font-size: clamp(2rem, 5vw, 3.8rem);
  color: var(--color-header-bg);
  margin-bottom: 10px;
  animation: slideUpFade 0.8s ease-out forwards;
}
.welcome-subtitle {
  font-size: clamp(0.95rem, 1.8vw, 1.2rem);
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto 24px;
  line-height: 1.6;
  animation: slideUpFade 1s ease-out forwards;
}

.welcome-features {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 20px;
}
.welcome-feature-chip {
  background: rgba(198, 161, 91, 0.1);
  color: var(--color-gold);
  border: 1px solid rgba(198, 161, 91, 0.2);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.9rem;
  opacity: 0;
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.welcome-feature-chip:nth-child(1) { animation-delay: 0.2s; }
.welcome-feature-chip:nth-child(2) { animation-delay: 0.3s; }
.welcome-feature-chip:nth-child(3) { animation-delay: 0.4s; }
.welcome-feature-chip:nth-child(4) { animation-delay: 0.5s; }
.welcome-feature-chip:nth-child(5) { animation-delay: 0.6s; }
.welcome-feature-chip:nth-child(6) { animation-delay: 0.7s; }

.welcome-stats {
  display: flex; justify-content: center; gap: 24px; margin-bottom: 24px;
  animation: fadeIn 1.2s ease-out forwards;
  flex-wrap: wrap;
}
.welcome-stat-value {
  display: block; font-family: var(--font-display); font-size: 1.8rem; color: var(--color-pitch-green);
}
.welcome-stat-label {
  display: block; font-size: 0.8rem; font-weight: 600; color: var(--color-text-dim); text-transform: uppercase; letter-spacing: 0.05em;
}

.welcome-cta {
  background: var(--color-gold);
  color: #17211D;
  border: none;
  border-radius: var(--radius-pill);
  padding: 16px 40px;
  font-size: 1.2rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 12px;
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
  animation: slideUpFade 1.4s ease-out forwards;
  box-shadow: 0 10px 30px rgba(198, 161, 91, 0.3);
}
.welcome-cta:hover {
  background: #d6b36e; transform: translateY(-3px); box-shadow: 0 15px 40px rgba(198, 161, 91, 0.4);
}
.welcome-cta svg { transition: transform 0.3s; }
.welcome-cta:hover svg { transform: translateX(5px); }

.welcome-footer {
  margin-top: 16px; font-size: 0.78rem; color: var(--color-text-dim); opacity: 0;
  animation: fadeIn 1.6s ease-out forwards;
}

/* ── Basic Keyframes ──────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideDownFade {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─── Chat Message Spring Slide ─────────────────────────── */
@keyframes msgSlideIn {
  0%   { opacity: 0; transform: translateY(16px) scale(0.96); }
  60%  { opacity: 1; transform: translateY(-3px) scale(1.01); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── AI Avatar Animations ─────────────────────────────── */
@keyframes avatarPulse {
  0%, 100% { opacity: 0; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(1.15); }
}
@keyframes dotBlink {
  0%, 100% { opacity: 1; } 50% { opacity: 0.4; }
}

/* ─── Dropdown Entry ──────────────────────────────────── */
@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Chat Typing Indicator ────────────────────────────────── */
.typing-indicator { display: flex; gap: 4px; padding: 16px; align-items: center; }
.typing-dot {
  width: 6px; height: 6px; background: var(--color-text-dim); border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* ── Shimmer (skeleton loading) ───────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #ebe7df 25%, #f7f4ee 50%, #ebe7df 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* ── Hover lift for Flat Cards ────────────────────────────── */
.hover-lift { transition: transform 0.25s ease, box-shadow 0.25s ease; }
.hover-lift:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(20, 23, 28, 0.08);
}

/* ── Utilities ────────────────────────────────────────────── */
.animate-fadeIn { animation: slideUpFade 0.4s ease-out forwards; }

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