/* ============================================
   ThaiCross Gym Wien — Animations
   Powered by BudiSync | budisync.com
   ============================================ */

/* Fallback — alles sichtbar wenn GSAP nicht lädt */
.reveal, .reveal-stagger > *, .split-text .char {
  opacity: 1 !important;
  transform: none !important;
}

/* ============================================
   Reveal Animations (GSAP controlled)
   ============================================ */
.reveal {
  opacity: 1;
  transform: translateY(30px);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-stagger > * {
  opacity: 1;
  transform: translateY(20px);
}

.reveal-stagger.is-visible > * {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* ============================================
   Split Text
   ============================================ */
.split-text {
  overflow: hidden;
}

.split-text .char {
  display: inline-block;
  opacity: 1;
  transform: translateY(40px) rotate(5deg);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.split-text.is-animated .char {
  opacity: 1;
  transform: translateY(0) rotate(0deg);
}

/* ============================================
   Glitch Effect (Events Page Hero)
   ============================================ */
@keyframes glitch-1 {
  0%   { clip-path: inset(0 0 95% 0); transform: translate(-2px, 0); }
  20%  { clip-path: inset(40% 0 50% 0); transform: translate(2px, 0); }
  40%  { clip-path: inset(70% 0 20% 0); transform: translate(-1px, 0); }
  60%  { clip-path: inset(15% 0 75% 0); transform: translate(1px, 0); }
  80%  { clip-path: inset(85% 0 5% 0); transform: translate(-2px, 0); }
  100% { clip-path: inset(0 0 95% 0); transform: translate(0, 0); }
}

@keyframes glitch-2 {
  0%   { clip-path: inset(80% 0 10% 0); transform: translate(2px, 0); }
  20%  { clip-path: inset(20% 0 70% 0); transform: translate(-2px, 0); }
  40%  { clip-path: inset(55% 0 35% 0); transform: translate(1px, 0); }
  60%  { clip-path: inset(5% 0 85% 0); transform: translate(-1px, 0); }
  80%  { clip-path: inset(60% 0 30% 0); transform: translate(2px, 0); }
  100% { clip-path: inset(80% 0 10% 0); transform: translate(0, 0); }
}

.glitch-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.glitch-overlay::before,
.glitch-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: inherit;
  opacity: 0;
}

.glitch-overlay.active::before {
  opacity: 0.03;
  background: rgba(58, 171, 219, 0.5);
  animation: glitch-1 4s infinite steps(1);
}

.glitch-overlay.active::after {
  opacity: 0.03;
  background: rgba(231, 76, 60, 0.5);
  animation: glitch-2 4s infinite steps(1);
  animation-delay: 0.3s;
}

/* ============================================
   Countdown Flip Animation
   ============================================ */
.countdown-block {
  position: relative;
  perspective: 300px;
}

.countdown-number {
  font-family: var(--font-head);
  font-size: clamp(36px, 6vw, 72px);
  color: var(--accent);
  line-height: 1;
  display: block;
}

.countdown-label {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--subtext);
  margin-top: 8px;
  display: block;
}

.countdown-number.flip {
  animation: flipNumber 0.4s ease-in-out;
}

@keyframes flipNumber {
  0% { transform: rotateX(0deg); opacity: 1; }
  50% { transform: rotateX(-90deg); opacity: 0; }
  100% { transform: rotateX(0deg); opacity: 1; }
}

/* ============================================
   Scroll-snap Carousels (Mobile)
   ============================================ */
.snap-scroll {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  gap: 16px;
  padding-bottom: 16px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.snap-scroll::-webkit-scrollbar {
  display: none;
}

.snap-scroll > * {
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* Carousel Dots */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  padding: 0;
  min-width: 8px;
  min-height: 8px;
}

.carousel-dot.active {
  background: var(--accent);
  width: 24px;
  border-radius: 4px;
}

/* ============================================
   Navbar Scroll State
   ============================================ */
.site-header {
  transition: background 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}

.site-header.scrolled {
  background: rgba(0, 0, 0, 0.95) !important;
  box-shadow: 0 1px 0 var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* ============================================
   Hamburger Menu Animation
   ============================================ */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 48px;
  height: 48px;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

.hamburger.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.is-open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================
   Mobile Menu
   ============================================ */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 999;
  display: flex;
  flex-direction: column;
  padding: 100px 32px 40px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
}

.mobile-menu nav a {
  display: flex;
  align-items: center;
  height: 64px;
  font-family: var(--font-head);
  font-size: 36px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: color 0.2s ease;
  transform: translateX(-40px);
  opacity: 0;
}

.mobile-menu.is-open nav a {
  transform: translateX(0);
  opacity: 1;
}

.mobile-menu nav a:hover {
  color: var(--accent);
}

.mobile-menu nav a.active {
  color: var(--accent);
}

.mobile-menu-footer {
  margin-top: auto;
  padding-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ============================================
   Gradient Text
   ============================================ */
.gradient-text {
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   Glow Pulse
   ============================================ */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 20px var(--accent-glow); }
  50% { box-shadow: 0 0 40px var(--accent-glow-strong); }
}

.glow-pulse {
  animation: glowPulse 2s ease-in-out infinite;
}

/* ============================================
   Shimmer (Loading placeholders)
   ============================================ */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.shimmer {
  background: linear-gradient(
    90deg,
    var(--surface) 25%,
    var(--surface-2) 50%,
    var(--surface) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ============================================
   Horizontal Scroll Track (Desktop)
   ============================================ */
.disciplines-pin {
  overflow: hidden;
  position: relative;
}

.disciplines-track {
  display: flex;
  gap: 24px;
  width: max-content;
}

/* ============================================
   FAQ Accordion
   ============================================ */
.faq-item {
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 24px 0;
  font-family: var(--font-head);
  font-size: clamp(18px, 2.5vw, 24px);
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  gap: 16px;
  min-height: 48px;
}

.faq-question:hover {
  color: var(--accent);
}

.faq-icon {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  color: var(--accent);
}

.faq-item.is-open .faq-icon {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 300px;
  overflow: hidden;
  padding-bottom: 24px;
  transition: max-height 0.4s ease, padding 0.3s ease;
}

.faq-answer.is-closed {
  max-height: 0;
  padding-bottom: 0;
}

.faq-answer p {
  color: var(--subtext);
  line-height: 1.7;
  font-size: 16px;
}

/* ============================================
   Number Steps
   ============================================ */
.step-number {
  font-family: var(--font-head);
  font-size: 80px;
  line-height: 1;
  color: var(--accent);
  opacity: 0.8;
  display: block;
  margin-bottom: -8px;
}

/* ============================================
   Animated Gradient Background
   ============================================ */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animated-gradient {
  background: linear-gradient(135deg, var(--bg) 0%, var(--surface) 50%, var(--bg) 100%);
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
}

/* ============================================
   Hover Lift
   ============================================ */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}

/* ============================================
   Line Draw Animation
   ============================================ */
@keyframes lineDraw {
  from { width: 0; }
  to { width: 100%; }
}

.line-draw {
  display: block;
  height: 2px;
  background: var(--accent);
  width: 0;
}

.line-draw.animate {
  animation: lineDraw 0.8s ease forwards;
}

/* ============================================
   Prefers Reduced Motion Overrides
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-stagger > * {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .split-text .char {
    opacity: 1;
    transform: none;
  }

  .glitch-overlay.active::before,
  .glitch-overlay.active::after {
    animation: none;
    opacity: 0;
  }

  .countdown-number.flip {
    animation: none;
  }

  .glow-pulse {
    animation: none;
  }

  .shimmer {
    animation: none;
  }

  .animated-gradient {
    animation: none;
  }

  .scroll-arrow {
    animation: none;
  }
}

/* ============================================
   Event Hero: Scheinwerfer Animationen
   ============================================ */

@keyframes spotlightLeft {
  0% {
    transform: rotate(12deg);
    opacity: 0.6;
  }
  100% {
    transform: rotate(20deg);
    opacity: 1;
  }
}

@keyframes spotlightRight {
  0% {
    transform: rotate(-12deg);
    opacity: 1;
  }
  100% {
    transform: rotate(-20deg);
    opacity: 0.6;
  }
}
