/**
 * AIQENTA Animations & Effects
 * Version: 1.0.0
 * 
 * Enthält alle Custom CSS Animationen und Effekte
 * für die AIQENTA Website.
 */

/* ========================================
   GLOBAL SETTINGS
   ======================================== */

/* Smooth Font Rendering */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* iOS Tap Highlight entfernen */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* ========================================
   1. HERO PAGE LOAD ANIMATIONS
   ======================================== */

/* Basis Animation */
@keyframes heroFadeIn {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero Headline */
.hero-headline {
    opacity: 0;
    transform: translateY(40px);
    animation: heroFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

/* Hero Essence Text */
.hero-essence {
    opacity: 0;
    transform: translateY(40px);
    animation: heroFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
}

/* Hero Cards */
.perspective-card-1 {
    opacity: 0;
    transform: translateY(40px);
    animation: heroFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.6s forwards;
}

.perspective-card-2 {
    opacity: 0;
    transform: translateY(40px);
    animation: heroFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.75s forwards;
}

/* Generic Fade In Class */
.hero-fade-in {
    opacity: 0;
    transform: translateY(40px);
    animation: heroFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-fade-in:nth-child(1) { animation-delay: 0.2s; }
.hero-fade-in:nth-child(2) { animation-delay: 0.4s; }
.hero-fade-in:nth-child(3) { animation-delay: 0.6s; }
.hero-fade-in:nth-child(4) { animation-delay: 0.8s; }

/* ========================================
   2. SCROLL REVEAL ANIMATIONS
   ======================================== */

/* Element startet unsichtbar */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(80px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Wenn sichtbar (wird via JS hinzugefügt) */
.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger für mehrere Elemente */
.reveal-on-scroll:nth-child(1) { transition-delay: 0s; }
.reveal-on-scroll:nth-child(2) { transition-delay: 0.15s; }
.reveal-on-scroll:nth-child(3) { transition-delay: 0.3s; }
.reveal-on-scroll:nth-child(4) { transition-delay: 0.45s; }
.reveal-on-scroll:nth-child(5) { transition-delay: 0.6s; }

/* ========================================
   3. MORPHING BLOBS (Background)
   ======================================== */

.blob-background {
    position: relative;
    overflow: hidden;
}

/* Blob 1 (oben links) */
.blob-background::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    top: -200px;
    left: -200px;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    background: radial-gradient(
        circle,
        rgba(255, 107, 53, 0.15) 0%,
        transparent 70%
    );
    filter: blur(60px);
    animation: morphBlob1 20s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}

/* Blob 2 (unten rechts) */
.blob-background::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    bottom: -200px;
    right: -200px;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    background: radial-gradient(
        circle,
        rgba(0, 212, 170, 0.12) 0%,
        transparent 70%
    );
    filter: blur(60px);
    animation: morphBlob2 25s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}

/* Content muss über Blobs sein */
.blob-background > * {
    position: relative;
    z-index: 1;
}

/* Blob 1 Animation */
@keyframes morphBlob1 {
    0%, 100% {
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    25% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
        transform: translate(50px, 50px) rotate(90deg) scale(1.1);
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
        transform: translate(0, 100px) rotate(180deg) scale(1);
    }
    75% {
        border-radius: 60% 40% 30% 70% / 40% 70% 60% 30%;
        transform: translate(-50px, 50px) rotate(270deg) scale(1.1);
    }
}

/* Blob 2 Animation */
@keyframes morphBlob2 {
    0%, 100% {
        border-radius: 30% 70% 70% 30% / 30% 50% 50% 70%;
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    33% {
        border-radius: 70% 30% 50% 50% / 30% 70% 30% 70%;
        transform: translate(-50px, -50px) rotate(120deg) scale(1.1);
    }
    66% {
        border-radius: 50% 50% 30% 70% / 70% 30% 70% 30%;
        transform: translate(50px, -50px) rotate(240deg) scale(0.9);
    }
}

/* ========================================
   4. LIQUID BUTTON EFFECT
   ======================================== */

.liquid-button {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #FF6B35, #FF8A5C);
    border-radius: 50px;
    padding: 18px 40px;
    border: none;
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: inline-block;
}

/* Liquid Effekt */
.liquid-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    z-index: 0;
}

/* Hover State */
.liquid-button:hover::before {
    width: 400px;
    height: 400px;
}

.liquid-button:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(255, 107, 53, 0.4);
}

/* Text über Effekt */
.liquid-button * {
    position: relative;
    z-index: 1;
}

/* Active State (Touch) */
.liquid-button:active {
    transform: scale(0.96);
}

/* ========================================
   5. GRADIENT TEXT ANIMATION
   ======================================== */

.animated-gradient-text {
    background: linear-gradient(
        90deg,
        #FF6B35 0%,
        #FFB347 25%,
        #00D4AA 50%,
        #FFB347 75%,
        #FF6B35 100%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientMove 8s ease infinite;
}

@keyframes gradientMove {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Schneller bei Hover */
.animated-gradient-text:hover {
    animation-duration: 2s;
}

/* ========================================
   6. CARD HOVER EFFECTS
   ======================================== */

.perspective-card {
    position: relative;
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1),
                box-shadow 0.3s ease;
}

.perspective-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* ========================================
   7. MOBILE OPTIMIZATIONS
   ======================================== */

@media (max-width: 768px) {
    /* Touch-freundliche Größen */
    .liquid-button,
    .perspective-cta {
        min-height: 48px;
        min-width: 48px;
        padding: 16px 32px;
        font-size: 16px;
    }
    
    /* Headlines anpassen */
    .hero-headline {
        font-size: clamp(32px, 8vw, 48px);
    }
    
    /* Blobs kleiner */
    .blob-background::before,
    .blob-background::after {
        width: 400px;
        height: 400px;
    }
    
    /* Schnellere Animationen */
    .reveal-on-scroll {
        transition-duration: 0.6s;
    }
}

/* Touch Feedback */
.liquid-button:active,
.perspective-cta:active,
.perspective-card:active {
    transform: scale(0.96);
    transition: transform 0.1s;
}

/* Safe Area für Notch */
.hero-section,
.et_pb_section {
    padding-top: max(80px, env(safe-area-inset-top));
    padding-bottom: max(80px, env(safe-area-inset-bottom));
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
}

/* Mobile Viewport Fix */
.hero-section {
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic Viewport Height */
}

/* ========================================
   8. ACCESSIBILITY
   ======================================== */

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Focus Styles */
.liquid-button:focus-visible,
a:focus-visible,
button:focus-visible {
    outline: 3px solid #FF6B35;
    outline-offset: 4px;
}

/* ========================================
   9. UTILITY CLASSES
   ======================================== */

/* Smooth transitions */
.smooth-transition {
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

/* No select (für UI Elemente) */
.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* GPU Acceleration */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

/* Hide visually but keep for screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ========================================
   10. PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* Content Visibility für Off-Screen */
.lazy-section {
    content-visibility: auto;
    contain-intrinsic-size: 0 500px;
}

/* Optimize will-change */
.hero-headline,
.perspective-card {
    will-change: transform, opacity;
}

/* Nach Animation will-change entfernen */
.animation-complete {
    will-change: auto;
}