/* ================================
   MO DIGITAL - ANIMATIONS CSS
   ================================ */

/* ---- KEYFRAMES ---- */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-18px); }
}

@keyframes floatAlt {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50%       { transform: translateY(-12px) rotate(2deg); }
}

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@keyframes marqueeReverse {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

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

@keyframes drawLine {
  from { width: 0; }
  to   { width: 100%; }
}

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

@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 0 rgba(230, 57, 70, 0.4); }
  50%       { box-shadow: 0 0 0 20px rgba(230, 57, 70, 0); }
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@keyframes rotateIn {
  from { transform: rotate(-10deg) scale(0.8); opacity: 0; }
  to   { transform: rotate(0) scale(1); opacity: 1; }
}

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

@keyframes bounceIn {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}

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

@keyframes drawPath {
  from { stroke-dashoffset: 1000; }
  to   { stroke-dashoffset: 0; }
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%       { background-position: 100% 50%; }
}

@keyframes textReveal {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0% 0 0); }
}

@keyframes starFill {
  from { color: rgba(230,57,70,0.2); }
  to   { color: #E63946; }
}

@keyframes confettiFall {
  0%   { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

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

@keyframes loaderBar {
  from { width: 0; }
  to   { width: 100%; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.08); }
}

/* ---- PAGE LOADER ---- */
#page-loader {
  position: fixed;
  inset: 0;
  background: var(--black);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.8s cubic-bezier(0.76, 0, 0.24, 1);
}

#page-loader.exit {
  transform: translateY(-100%);
}

.loader-logo {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  display: flex;
  gap: 0.05em;
  margin-bottom: 48px;
}

.loader-letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.loader-letter.show {
  opacity: 1;
  transform: translateY(0);
}

.loader-letter.red { color: var(--primary-red); }
.loader-letter.white { color: var(--white); }

.loader-bar-track {
  width: 280px;
  height: 2px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.loader-bar-fill {
  height: 100%;
  background: var(--gradient-red);
  border-radius: 2px;
  animation: loaderBar 1.6s var(--ease-smooth) forwards;
}

/* ---- CUSTOM CURSOR ---- */
#cursor-outer {
  position: fixed;
  width: 30px;
  height: 30px;
  border: 2px solid rgba(230, 57, 70, 0.6);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  transition: width 0.3s var(--ease-smooth),
              height 0.3s var(--ease-smooth),
              background 0.3s,
              border-color 0.3s;
  will-change: transform;
  mix-blend-mode: normal;
}

#cursor-dot {
  position: fixed;
  width: 6px;
  height: 6px;
  background: var(--primary-red);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  will-change: transform;
}

#cursor-outer.expanded {
  width: 52px;
  height: 52px;
  background: rgba(230, 57, 70, 0.15);
  border-color: var(--primary-red);
}

#cursor-outer.view-mode {
  width: 70px;
  height: 30px;
  border-radius: 20px;
  background: var(--primary-red);
  border-color: var(--primary-red);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- HERO ANIMATIONS ---- */
.hero-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.6s var(--ease-smooth) forwards;
}

/* Stagger words */
.hero-word:nth-child(1) { animation-delay: 0.2s; }
.hero-word:nth-child(2) { animation-delay: 0.35s; }
.hero-word:nth-child(3) { animation-delay: 0.5s; }
.hero-word:nth-child(4) { animation-delay: 0.65s; }
.hero-word:nth-child(5) { animation-delay: 0.8s; }
.hero-word:nth-child(6) { animation-delay: 0.95s; }

.typewriter-cursor {
  display: inline-block;
  color: var(--primary-red);
  font-weight: 300;
  animation: blink 0.8s infinite;
  margin-left: 4px;
}

/* ---- FLOATING DASHBOARD CARDS ---- */
.dashboard-card {
  background: rgba(26,26,26,0.95);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 16px 20px;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  animation: float 3s ease-in-out infinite;
}

.dashboard-card:nth-child(2) { animation-delay: 1s; animation-duration: 3.5s; }
.dashboard-card:nth-child(3) { animation-delay: 0.5s; animation-duration: 4s; }

.dashboard-metric {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-red);
}

.dashboard-label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  margin-top: 2px;
}

/* ---- SERVICE CARD ICON ---- */
.service-icon {
  width: 56px;
  height: 56px;
  background: rgba(230,57,70,0.12);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all var(--dur-base) var(--ease-smooth);
  margin-bottom: 20px;
}

.card:hover .service-icon {
  background: var(--primary-red);
  animation: spin 0.5s linear;
}

/* ---- HERO LEARN MORE ---- */
.learn-more-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-red);
  font-weight: 600;
  font-size: 0.9rem;
  opacity: 0;
  transition: all var(--dur-base) var(--ease-smooth);
}

.card:hover .learn-more-link { opacity: 1; }

.learn-more-link::after {
  content: '→';
  transition: transform var(--dur-fast);
}
.learn-more-link:hover::after { transform: translateX(4px); }

/* ---- PROCESS LINE ---- */
.process-line {
  position: absolute;
  top: 28px;
  left: 0;
  height: 2px;
  background: var(--mid-gray);
  width: 100%;
  z-index: 0;
}

.process-line-fill {
  height: 100%;
  background: var(--gradient-red);
  width: 0%;
  transition: width 1.5s var(--ease-smooth);
}

.process-line-fill.animate { width: 100%; }

/* ---- MARQUEE TRACK ---- */
.marquee-track {
  display: flex;
  gap: 60px;
  animation: marquee 25s linear infinite;
  width: max-content;
}

.marquee-track-reverse {
  animation: marqueeReverse 20s linear infinite;
}

/* ---- TESTIMONIAL SLIDER ---- */
.slider-track {
  display: flex;
  transition: transform 0.6s var(--ease-smooth);
}

/* ---- STAT COUNTER ---- */
.stat-number {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  color: var(--white);
  line-height: 1;
  animation: counterPop 0.5s var(--ease-smooth) both;
}

/* ---- MAGNETIC BUTTON ---- */
.magnetic-btn {
  transition: transform 0.3s var(--ease-smooth);
}

/* ---- MOST POPULAR PULSE ---- */
.popular-card {
  animation: pulse-red 4s ease-in-out infinite;
}

/* ---- BLOG CARD HOVER ---- */
.blog-card-img {
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 20px;
}

.blog-card-img img,
.blog-card-img .dummy-img {
  transition: transform 0.5s var(--ease-smooth);
  height: 200px;
}

.blog-card:hover .blog-card-img img,
.blog-card:hover .blog-card-img .dummy-img {
  transform: scale(1.06);
}

/* ---- MOBILE MENU ANIMATION ---- */
.mobile-menu-link {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.mobile-menu.open .mobile-menu-link { opacity: 1; transform: translateY(0); }
.mobile-menu.open .mobile-menu-link:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu.open .mobile-menu-link:nth-child(2) { transition-delay: 0.15s; }
.mobile-menu.open .mobile-menu-link:nth-child(3) { transition-delay: 0.2s; }
.mobile-menu.open .mobile-menu-link:nth-child(4) { transition-delay: 0.25s; }
.mobile-menu.open .mobile-menu-link:nth-child(5) { transition-delay: 0.3s; }
.mobile-menu.open .mobile-menu-link:nth-child(6) { transition-delay: 0.35s; }
.mobile-menu.open .mobile-menu-link:nth-child(7) { transition-delay: 0.4s; }
.mobile-menu.open .mobile-menu-link:nth-child(8) { transition-delay: 0.45s; }

/* ---- TEAM CARD HOVER ---- */
.team-card {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  cursor: none;
}

.team-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(230,57,70,0.95) 0%, rgba(160,0,28,0.8) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 24px;
}

.team-card:hover .team-overlay { opacity: 1; }

.team-social-icon {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.9rem;
  transition: all var(--dur-fast) var(--ease-bounce);
  transform: translateY(20px);
  opacity: 0;
}

.team-card:hover .team-social-icon {
  transform: translateY(0);
  opacity: 1;
}

.team-card:hover .team-social-icon:nth-child(1) { transition-delay: 0.05s; }
.team-card:hover .team-social-icon:nth-child(2) { transition-delay: 0.12s; }
.team-card:hover .team-social-icon:nth-child(3) { transition-delay: 0.19s; }

/* ---- READING PROGRESS ---- */
#reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: var(--gradient-red);
  z-index: 10001;
  transition: width 0.1s linear;
}

/* ---- 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;
  }

  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }

  .marquee-track,
  .marquee-track-reverse {
    animation: none !important;
  }
}
