/* ===================================================
   Nachhilfe-Website — Animationen
   =================================================== */

/* ---- Keyframes ---- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-28px); }
  to   { opacity: 1; transform: translateX(0); }
}

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

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

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

@keyframes pulse-ring {
  0%   { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(107,78,255,0.4); }
  70%  { transform: scale(1);    box-shadow: 0 0 0 12px rgba(107,78,255,0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(107,78,255,0); }
}

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

@keyframes bounceIn {
  0%   { opacity: 0; transform: scale(0.3); }
  50%  { opacity: 1; transform: scale(1.08); }
  70%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}

/* ---- Scroll-reveal Klassen ---- */
/* Elemente erhalten diese Klasse und werden beim Scrollen animiert  */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.reveal-left {
  transform: translateX(-28px);
}
.reveal.reveal-right {
  transform: translateX(28px);
}
.reveal.reveal-scale {
  transform: scale(0.9);
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* Verzögerungen */
.delay-1 { transition-delay: 0.1s !important; }
.delay-2 { transition-delay: 0.2s !important; }
.delay-3 { transition-delay: 0.3s !important; }
.delay-4 { transition-delay: 0.4s !important; }
.delay-5 { transition-delay: 0.5s !important; }
.delay-6 { transition-delay: 0.6s !important; }

/* ---- Hero-Animationen (sofort) ---- */
.hero-badge   { animation: fadeInDown 0.6s ease both; }
.hero-title   { animation: fadeInUp   0.65s ease 0.1s both; }
.hero-desc    { animation: fadeInUp   0.65s ease 0.2s both; }
.hero-actions { animation: fadeInUp   0.65s ease 0.3s both; }
.hero-stats   { animation: fadeInUp   0.65s ease 0.4s both; }

.hcard-1 { animation: fadeInRight 0.7s ease 0.2s both; }
.hcard-2 { animation: fadeInRight 0.7s ease 0.35s both; }
.hcard-3 { animation: fadeInRight 0.7s ease 0.5s both; }
.hcard-4 { animation: fadeInRight 0.7s ease 0.65s both; }

/* Schwebende Karten */
.hero-card-stack .hcard-2 {
  animation: fadeInRight 0.7s ease 0.35s both,
             float 4s ease-in-out 1.2s infinite;
}

/* ---- Navbar Eintritt ---- */
.navbar { animation: fadeInDown 0.5s ease both; }

/* ---- Zahlen-Counter ---- */
.stat-number[data-count] {
  display: inline-block;
  transition: transform 0.3s ease;
}

/* ---- Karten Hover-Shine ---- */
.subject-card,
.feature-card,
.preis-card,
.testimonial-card {
  position: relative;
  overflow: hidden;
}
.subject-card::after,
.feature-card::after,
.preis-card::after,
.testimonial-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255,255,255,0.45) 50%,
    transparent 60%
  );
  transform: translateX(-100%);
  transition: transform 0.55s ease;
  pointer-events: none;
  border-radius: inherit;
}
.subject-card:hover::after,
.feature-card:hover::after,
.preis-card:hover::after,
.testimonial-card:hover::after {
  transform: translateX(100%);
}

/* ---- Pulse auf CTA Buttons ---- */
.btn-primary.pulse {
  animation: pulse-ring 2s infinite;
}

/* ---- Step-Nummern Bounce ---- */
.step:hover .step-number {
  animation: bounceIn 0.4s ease;
}

/* ---- Formular: Input Focus-Animation ---- */
.form-control {
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}
.form-control:focus {
  transform: scale(1.005);
}

/* ---- Time-Slot Selection ---- */
.time-slot {
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.time-slot.selected {
  animation: scaleIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---- Tab-Wechsel ---- */
.faecher-detail-grid {
  transition: opacity 0.3s ease;
}
.faecher-detail-grid.switching {
  opacity: 0;
}

/* ---- Success-Animation ---- */
.form-success { animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* ---- Page-Load Overlay ---- */
.page-loader {
  position: fixed;
  inset: 0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}
.loader-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--primary);
  margin: 0 4px;
  display: inline-block;
  animation: loaderBounce 1.1s ease-in-out infinite both;
}
.loader-dot:nth-child(2) { animation-delay: 0.18s; }
.loader-dot:nth-child(3) { animation-delay: 0.36s; }

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

/* Barrierefreiheit: Animationen deaktivieren wenn gewünscht */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
