/**
 * ClouSo – gemeinsame Motion, Reveal & Micro-Interactions
 * Von index (main.css) und Produktseiten eingebunden.
 */

@keyframes clouso-fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes clouso-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes clouso-pulse-soft {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

/* Scroll-Reveal */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
  will-change: opacity, transform;
}

.reveal.in-view,
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal.delay-1 { transition-delay: 0.08s; }
.reveal.delay-2 { transition-delay: 0.16s; }
.reveal.delay-3 { transition-delay: 0.24s; }
.reveal.delay-4 { transition-delay: 0.32s; }
.reveal.delay-5 { transition-delay: 0.4s; }

/* Karten-Hover (CashTill, Chatbot, Index) */
.card-hover {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.card-hover:active {
  transform: translateY(-2px);
}

/* Button-Micro-Interactions */
.btn-motion {
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.btn-motion:hover {
  transform: translateY(-1px);
}

.btn-motion:active {
  transform: translateY(0) scale(0.98);
}

/* Ökosystem: Nodes nacheinander wenn Container sichtbar */
.ecosystem-viz .ecosystem-viz__title,
.ecosystem-viz .ecosystem-viz__node,
.ecosystem-viz .ecosystem-viz__hub,
.ecosystem-viz .ecosystem-viz__connect {
  opacity: 0;
  transform: translateY(6px);
}

.ecosystem-viz.in-view .ecosystem-viz__title {
  animation: clouso-fade-up 0.45s ease forwards;
}

.ecosystem-viz.in-view .ecosystem-viz__row:first-of-type .ecosystem-viz__node:nth-child(1) {
  animation: clouso-fade-up 0.45s ease 0.06s forwards;
}

.ecosystem-viz.in-view .ecosystem-viz__row:first-of-type .ecosystem-viz__node:nth-child(2) {
  animation: clouso-fade-up 0.45s ease 0.12s forwards;
}

.ecosystem-viz.in-view .ecosystem-viz__row:first-of-type .ecosystem-viz__node:nth-child(3) {
  animation: clouso-fade-up 0.45s ease 0.18s forwards;
}

.ecosystem-viz.in-view .ecosystem-viz__connect:nth-of-type(1) {
  animation: clouso-fade-in 0.35s ease 0.24s forwards;
}

.ecosystem-viz.in-view .ecosystem-viz__hub {
  animation: clouso-fade-up 0.5s ease 0.28s forwards;
}

.ecosystem-viz.in-view .ecosystem-viz__connect:nth-of-type(2) {
  animation: clouso-fade-in 0.35s ease 0.34s forwards;
}

.ecosystem-viz.in-view .ecosystem-viz__row:last-of-type .ecosystem-viz__node:nth-child(1) {
  animation: clouso-fade-up 0.45s ease 0.4s forwards;
}

.ecosystem-viz.in-view .ecosystem-viz__row:last-of-type .ecosystem-viz__node:nth-child(2) {
  animation: clouso-fade-up 0.45s ease 0.46s forwards;
}

/* Festival-Flow: dezente Pfeil-Animation */
.festival-flow.in-view .festival-flow__arrow {
  animation: clouso-pulse-soft 2s ease-in-out infinite;
}

.festival-flow.in-view .festival-flow__node--accent {
  animation: clouso-fade-up 0.5s ease 0.15s both;
}

/* Fokus für Tastatur-Nutzer */
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid #4795D1;
  outline-offset: 2px;
}

/* FAQ Ausklapp-Elemente (AccessControl+, CashTill) */
.faq-details {
  border-bottom: 1px solid #e2e8f0;
}

.faq-details:first-of-type {
  border-top: 1px solid #e2e8f0;
}

.faq-details summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 2.5rem 1rem 0;
  position: relative;
  font-weight: 600;
  color: #0f172a;
}

.faq-details summary::-webkit-details-marker {
  display: none;
}

.faq-details summary::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: translateY(-60%) rotate(45deg);
  transition: transform 0.2s ease;
}

.faq-details[open] summary::after {
  transform: translateY(-40%) rotate(-135deg);
}

.faq-details .faq-answer {
  padding: 0 0 1.25rem 0;
  color: #475569;
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal.in-view,
  .reveal.visible {
    opacity: 1;
    transform: none;
    transition: none;
    will-change: auto;
  }

  .card-hover,
  .card-hover:hover,
  .card-hover:active {
    transform: none;
    transition: none;
  }

  .btn-motion:hover,
  .btn-motion:active {
    transform: none;
  }

  .ecosystem-viz .ecosystem-viz__title,
  .ecosystem-viz .ecosystem-viz__node,
  .ecosystem-viz .ecosystem-viz__hub,
  .ecosystem-viz .ecosystem-viz__connect,
  .ecosystem-viz.in-view .ecosystem-viz__title,
  .ecosystem-viz.in-view .ecosystem-viz__node,
  .ecosystem-viz.in-view .ecosystem-viz__hub,
  .ecosystem-viz.in-view .ecosystem-viz__connect {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .festival-flow.in-view .festival-flow__node--accent {
    animation: none;
  }

  .faq-details summary::after {
    transition: none;
  }
}
