/* ===================================
   TEDXOZ - ANIMATIONS
   Apple-style Scroll & Cinematic Effects
   =================================== */

/* ===================================
   KEYFRAME ANIMATIONS
   =================================== */

@keyframes scroll {
    0% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateX(-50%) translateY(20px);
        opacity: 0;
    }
}

@keyframes scan {
    0% {
        top: 0;
    }
    50% {
        top: 100%;
    }
    100% {
        top: 0;
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.85);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* ===================================
   SCROLL REVEAL CLASSES
   =================================== */

.scroll-reveal {
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-reveal.visible {
    opacity: 1;
}

/* Fade Up */
.fade-up {
    transform: translateY(40px);
}

.fade-up.visible {
    transform: translateY(0);
}

/* Slide Right */
.slide-right {
    transform: translateX(-40px);
}

.slide-right.visible {
    transform: translateX(0);
}

/* Slide Left */
.slide-left {
    transform: translateX(40px);
}

.slide-left.visible {
    transform: translateX(0);
}

/* Zoom In */
.zoom-in {
    transform: scale(0.9);
}

.zoom-in.visible {
    transform: scale(1);
}

/* Scale Up */
.scale-up {
    transform: scale(0.85);
}

.scale-up.visible {
    transform: scale(1);
}

/* ===================================
   ANIMATION DELAYS
   =================================== */

.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

.delay-3 {
    transition-delay: 0.3s;
}

.delay-4 {
    transition-delay: 0.4s;
}

.delay-5 {
    transition-delay: 0.5s;
}

/* ===================================
   HERO ANIMATIONS
   =================================== */

.animate-fade-up {
    animation: fadeUp 1s ease-out forwards;
}

.animate-fade-up.delay-1 {
    animation-delay: 0.2s;
    opacity: 0;
}

.animate-fade-up.delay-2 {
    animation-delay: 0.4s;
    opacity: 0;
}

/* ===================================
   PARALLAX EFFECTS
   =================================== */

.parallax-slow {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.parallax-medium {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.parallax-fast {
    transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================
   HOVER EFFECTS
   =================================== */

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 40px rgba(0, 102, 255, 0.4);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* ===================================
   GLASS MORPHISM EFFECTS
   =================================== */

.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: all 0.3s ease;
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 48px 0 rgba(0, 0, 0, 0.45);
}

/* ===================================
   LOADING ANIMATIONS
   =================================== */

.shimmer-effect {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* ===================================
   GRADIENT ANIMATIONS
   =================================== */

.gradient-animate {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* ===================================
   TEXT EFFECTS
   =================================== */

.text-glitch {
    position: relative;
}

.text-glitch::before,
.text-glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.text-glitch::before {
    animation: glitch-1 2s infinite;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
    transform: translateX(-2px);
    opacity: 0.8;
}

.text-glitch::after {
    animation: glitch-2 2s infinite;
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
    transform: translateX(2px);
    opacity: 0.8;
}

@keyframes glitch-1 {
    0%, 100% {
        transform: translateX(0);
    }
    20% {
        transform: translateX(-2px);
    }
    40% {
        transform: translateX(2px);
    }
}

@keyframes glitch-2 {
    0%, 100% {
        transform: translateX(0);
    }
    20% {
        transform: translateX(2px);
    }
    40% {
        transform: translateX(-2px);
    }
}

/* ===================================
   BUTTON ANIMATIONS
   =================================== */

.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-ripple:active::after {
    width: 300px;
    height: 300px;
}

/* ===================================
   SCROLL INDICATOR
   =================================== */

.scroll-indicator {
    animation: float 3s ease-in-out infinite;
}

/* ===================================
   DEVICE ANIMATIONS
   =================================== */

.device-mockup {
    animation: float 6s ease-in-out infinite;
}

.phone-mockup {
    animation: float 5s ease-in-out infinite;
}

/* ===================================
   RESPONSIVE ANIMATIONS
   =================================== */

@media (max-width: 768px) {
    /* Reduce animation complexity on mobile */
    .scroll-reveal {
        transition-duration: 0.5s;
    }
    
    .parallax-slow,
    .parallax-medium,
    .parallax-fast {
        transition: none;
        transform: none !important;
    }
    
    .device-mockup,
    .phone-mockup {
        animation: none;
    }
}

/* ===================================
   PREFERS 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;
    }
}

/* ===================================
   LOADING STATE
   =================================== */

.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(4px);
}

/* ===================================
   SUCCESS STATE
   =================================== */

@keyframes successPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 217, 255, 0.7);
    }
    50% {
        box-shadow: 0 0 0 20px rgba(0, 217, 255, 0);
    }
}

.success-state {
    animation: successPulse 1s ease-out;
}

/* ===================================
   PAGE TRANSITIONS
   =================================== */

.page-transition {
    animation: fadeIn 0.5s ease-out;
}

/* ===================================
   CUSTOM CURSOR EFFECTS (Optional)
   =================================== */

.cursor-trail {
    pointer-events: none;
    position: fixed;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 9999;
}

.cursor-trail.active {
    opacity: 0.5;
    animation: cursorPulse 1s ease-out;
}

@keyframes cursorPulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(3);
        opacity: 0;
    }
}
