/* ==========================================================================
   PLU ULTRA PREMIUM ENHANCEMENTS
   Industry-Leading Interactions & Animations
   ========================================================================== */

/* ==========================================================================
   1. AURORA BACKGROUND EFFECT
   ========================================================================== */
.aurora-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.aurora-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse 80% 50% at 20% 20%, rgba(88, 166, 255, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse 50% 60% at 50% 50%, rgba(236, 72, 153, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 70% 30% at 90% 10%, rgba(57, 208, 216, 0.1) 0%, transparent 50%);
  animation: auroraMove 25s ease-in-out infinite;
  filter: blur(60px);
}

.aurora-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: auroraFloat 20s ease-in-out infinite;
}

.aurora-blob-1 {
  width: 600px;
  height: 600px;
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.4), rgba(57, 208, 216, 0.3));
  top: -200px;
  left: -200px;
  animation-delay: 0s;
}

.aurora-blob-2 {
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.35), rgba(236, 72, 153, 0.25));
  bottom: -150px;
  right: -150px;
  animation-delay: -7s;
}

.aurora-blob-3 {
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.3), rgba(245, 158, 11, 0.25));
  top: 40%;
  left: 60%;
  animation-delay: -14s;
}

@keyframes auroraMove {
  0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
  25% { transform: translate(50px, -30px) rotate(5deg) scale(1.05); }
  50% { transform: translate(-30px, 50px) rotate(-5deg) scale(0.95); }
  75% { transform: translate(40px, 40px) rotate(3deg) scale(1.02); }
}

@keyframes auroraFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -50px) scale(1.1); }
  66% { transform: translate(-40px, 30px) scale(0.9); }
}

/* ==========================================================================
   2. CINEMATIC HERO ENTRANCE
   ========================================================================== */
.hero-title-line {
  display: block;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  animation: textReveal 1.2s cubic-bezier(0.77, 0, 0.175, 1) forwards;
  opacity: 0;
}

.hero-title-line:first-child {
  animation-delay: 0.3s;
}

.hero-title-line:nth-child(2) {
  animation-delay: 0.5s;
}

@keyframes textReveal {
  from { 
    transform: translateY(100%) rotateX(-80deg);
    opacity: 0;
    filter: blur(10px);
  }
  to { 
    transform: translateY(0) rotateX(0);
    opacity: 1;
    filter: blur(0);
  }
}

/* Glitch Effect on Hover for Hero Title */
.text-gradient:hover {
  animation: glitch 0.3s cubic-bezier(.25, .46, .45, .94) both;
  cursor: default;
}

@keyframes glitch {
  0% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(-2px, -2px); }
  60% { transform: translate(2px, 2px); }
  80% { transform: translate(2px, -2px); }
  100% { transform: translate(0); }
}

/* Character Split Animation */
.char-split {
  display: inline-block;
  opacity: 0;
  transform: translateY(50px) rotateX(-90deg);
  animation: charReveal 0.6s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

@keyframes charReveal {
  to {
    opacity: 1;
    transform: translateY(0) rotateX(0);
  }
}

/* ==========================================================================
   3. MAGNETIC BUTTONS
   ========================================================================== */
.btn-magnetic {
  position: relative;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}

.btn-magnetic::before {
  content: '';
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), 
    rgba(88, 166, 255, 0.3) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
  border-radius: inherit;
  pointer-events: none;
}

.btn-magnetic:hover::before {
  opacity: 1;
}

/* Magnetic Attraction Zone */
.magnetic-zone {
  position: relative;
}

.magnetic-zone::after {
  content: '';
  position: absolute;
  inset: -50px;
  pointer-events: auto;
}

/* ==========================================================================
   4. CURSOR TRAIL EFFECT
   ========================================================================== */
.cursor-trail {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-primary);
  pointer-events: none;
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.3s;
}

.cursor-trail.active {
  opacity: 0.6;
}

/* ==========================================================================
   5. 3D TILT CARDS
   ========================================================================== */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.1s ease-out;
  will-change: transform;
}

.tilt-card-inner {
  transform: translateZ(20px);
}

.tilt-card-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.05) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: translateZ(1px);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  border-radius: inherit;
}

.tilt-card:hover .tilt-card-shine {
  opacity: 1;
}

/* Card Float Animation */
.float-card {
  animation: cardFloat 6s ease-in-out infinite;
}

.float-card:nth-child(2) { animation-delay: -1.5s; }
.float-card:nth-child(3) { animation-delay: -3s; }
.float-card:nth-child(4) { animation-delay: -4.5s; }

@keyframes cardFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(1deg); }
}

/* ==========================================================================
   6. KINETIC TYPOGRAPHY
   ========================================================================== */
.kinetic-text {
  position: relative;
  display: inline-block;
}

.kinetic-text:hover {
  animation: textScramble 0.4s ease-out;
}

@keyframes textScramble {
  0% { 
    filter: blur(8px); 
    letter-spacing: 8px;
    opacity: 0.5;
  }
  50% {
    filter: blur(4px);
    letter-spacing: 4px;
  }
  100% { 
    filter: blur(0); 
    letter-spacing: normal;
    opacity: 1;
  }
}

/* Glow Pulse on Icons */
.icon-glow {
  position: relative;
}

.icon-glow::after {
  content: '';
  position: absolute;
  inset: -30px;
  background: radial-gradient(circle, var(--glow-color, var(--accent-primary)) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.5s;
  z-index: -1;
  pointer-events: none;
}

.icon-glow:hover::after {
  opacity: 0.4;
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.2); opacity: 0.2; }
}

/* ==========================================================================
   7. SCROLL PROGRESS INDICATOR
   ========================================================================== */
.side-progress {
  position: fixed;
  right: 30px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 100;
  padding: 20px 10px;
  background: rgba(13, 17, 23, 0.5);
  backdrop-filter: blur(10px);
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  position: relative;
}

.progress-dot::before {
  content: attr(data-label);
  position: absolute;
  right: 25px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--text-secondary);
  opacity: 0;
  transition: all 0.3s;
  white-space: nowrap;
  background: rgba(13, 17, 23, 0.9);
  padding: 4px 10px;
  border-radius: 4px;
  pointer-events: none;
}

.progress-dot:hover::before {
  opacity: 1;
  right: 20px;
}

.progress-dot.active {
  background: var(--accent-primary);
  transform: scale(1.5);
  box-shadow: 0 0 20px var(--accent-primary-glow);
}

/* Hide on mobile */
@media (max-width: 1200px) {
  .side-progress {
    display: none;
  }
}

/* Hide scroll button in mobile header & hero */
@media (max-width: 768px) {
  .header-center-mobile a#header-backtop.header-fab-btn,
  #header-backtop,
  .header-center-mobile a[title="Nach oben"],
  .header-center-mobile a[title="Back to top"] {
    display: none !important;
  }
  
  /* Hero Scroll Button ausblenden */
  .scroll-indicator,
  .hero .scroll-indicator,
  a.scroll-indicator {
    display: none !important;
  }
}

/* ==========================================================================
   8. SOCIAL PROOF & FOMO
   ========================================================================== */
.social-proof-badge {
  position: fixed;
  bottom: 100px;
  left: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: rgba(13, 17, 23, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(88, 166, 255, 0.2);
  border-radius: 50px;
  font-size: 13px;
  color: var(--text-secondary);
  z-index: 99;
  animation: slideInLeft 0.6s ease-out 2s both;
  transition: all 0.3s;
}

.social-proof-badge:hover {
  border-color: rgba(88, 166, 255, 0.4);
  transform: translateX(5px);
}

/* Light Mode: Social Proof Badge anpassen */
html.light-theme .social-proof-badge {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(88, 166, 255, 0.3);
  color: #374151;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

html.light-theme .social-proof-badge:hover {
  border-color: rgba(88, 166, 255, 0.5);
  box-shadow: 0 6px 24px rgba(88, 166, 255, 0.15);
}

html.light-theme .social-proof-badge strong {
  color: #111827;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

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

.fomo-banner {
  position: fixed;
  top: 100px;
  right: 30px;
  padding: 14px 24px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.9), rgba(239, 68, 68, 0.9));
  backdrop-filter: blur(10px);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: white;
  z-index: 99;
  animation: slideInRight 0.6s ease-out 1.5s both, bannerPulse 3s ease-in-out infinite 2s;
  box-shadow: 0 8px 32px rgba(245, 158, 11, 0.3);
}

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

@keyframes bannerPulse {
  0%, 100% { box-shadow: 0 8px 32px rgba(245, 158, 11, 0.3); }
  50% { box-shadow: 0 8px 40px rgba(245, 158, 11, 0.5); }
}

/* Hide FOMO elements on mobile */
@media (max-width: 768px) {
  .social-proof-badge,
  .fomo-banner {
    display: none;
  }
}

/* ==========================================================================
   9. EASTER EGG - MATRIX MODE
   ========================================================================== */
.matrix-mode {
  --bg-primary: #000;
  --bg-secondary: #001100;
  --text-primary: #0f0;
  --text-secondary: #0a0;
  --accent-primary: #0f0;
}

.matrix-mode .aurora-bg::before {
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(0, 255, 0, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(0, 255, 0, 0.08) 0%, transparent 50%);
}

.matrix-rain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.5s;
}

.matrix-rain.active {
  opacity: 0.1;
}

/* ==========================================================================
   10. SMOOTH THEME TRANSITION
   ========================================================================== */
html {
  transition: background-color 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              color 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

html *,
html *::before,
html *::after {
  transition: background-color 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Disable transitions for performance during scroll */
.is-scrolling * {
  transition: none !important;
}

/* ==========================================================================
   11. ENHANCED CARD HOVER STATES
   ========================================================================== */
.tutorial-card {
  position: relative;
  overflow: hidden;
}

.tutorial-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(88, 166, 255, 0.1),
    transparent 40%
  );
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.tutorial-card:hover::before {
  opacity: 1;
}

/* Border Glow Effect */
.tutorial-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    transparent 0%,
    rgba(88, 166, 255, 0.3) 50%,
    transparent 100%
  );n  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s;
}

.tutorial-card:hover::after {
  opacity: 1;
}

/* ==========================================================================
   12. LOADING STATES & SKELETONS
   ========================================================================== */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 0%,
    var(--bg-elevated) 50%,
    var(--bg-tertiary) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==========================================================================
   MOBILE OPTIMIZATIONS
   ========================================================================== */
@media (pointer: coarse) {
  /* Disable cursor effects on touch devices */
  .cursor-trail,
  .btn-magnetic::before {
    display: none !important;
  }
  
  /* Simplify animations for mobile */
  .aurora-blob {
    animation-duration: 40s;
    filter: blur(100px);
  }
  
  .float-card {
    animation: none;
  }
  
  /* Reduce motion for accessibility */
  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }
}

/* Touch-friendly interactions */
@media (hover: none) {
  .tutorial-card:active {
    transform: scale(0.98);
  }
  
  .btn-magnetic:active {
    transform: scale(0.95);
  }
}


/* ==========================================================================
   KI ACADEMY SECTION - PREMIUM ANIMATIONS
   ========================================================================== */

/* Academy Card 3D Tilt Effect */
.academy-card {
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.academy-card:hover {
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(20px);
}

/* Icon Glow Animation */
@keyframes pulse-glow {
  0%, 100% { 
    transform: scale(1); 
    opacity: 0.6; 
  }
  50% { 
    transform: scale(1.15); 
    opacity: 1; 
  }
}

/* Slow Orbit Rotation */
@keyframes slow-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Connector Pulse Animation */
@keyframes pulse-dot {
  0%, 100% { 
    transform: translate(-50%, -50%) scale(1); 
    opacity: 1; 
  }
  50% { 
    transform: translate(-50%, -50%) scale(1.5); 
    opacity: 0.5; 
  }
}

/* Academy Button Hover Enhancement */
.academy-card .card-link {
  position: relative;
  overflow: hidden;
}

.academy-card .card-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.academy-card .card-link:hover::before {
  left: 100%;
}

.academy-card .card-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(88,166,255,0.4);
}

/* Academy Icon Wrapper */
.academy-icon-wrapper {
  animation: float-icon 6s ease-in-out infinite;
}

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

/* Section-specific Aurora */
#ki-academy-entry .aurora-bg {
  position: absolute;
  opacity: 0.6;
}

#ki-academy-entry .aurora-orb {
  animation: auroraDrift 20s ease-in-out infinite;
}

@keyframes auroraDrift {
  0%, 100% { 
    transform: translate(0, 0) scale(1); 
    opacity: 0.6;
  }
  33% { 
    transform: translate(30px, -20px) scale(1.1); 
    opacity: 0.8;
  }
  66% { 
    transform: translate(-20px, 30px) scale(0.9); 
    opacity: 0.5;
  }
}

/* Desktop Connector Line */
@media (min-width: 769px) {
  .academy-connector {
    display: block !important;
  }
}

/* Mobile Academy Layout */
@media (max-width: 768px) {
  .academy-gateway {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  
  .academy-card {
    margin: 0 auto;
    max-width: 400px;
  }
  
  .academy-pathway-note {
    margin-top: 32px !important;
    padding: 20px !important;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .academy-icon-wrapper,
  .icon-orbit,
  .icon-glow-bg,
  .aurora-orb {
    animation: none !important;
  }
  
  .academy-card {
    transform: none !important;
  }
}
