/* ==========================================================================
   OptimusCall - Scroll Animations
   Apple-inspired reveal animations
   ========================================================================== */

/* ==========================================================================
   Base Animation Classes
   ========================================================================== */

/* Fade In */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Fade In Left */
.fade-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Fade In Right */
.fade-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Scale In */
.scale-in {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* ==========================================================================
   Delay Classes
   ========================================================================== */

.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; }

/* ==========================================================================
   Stagger Animation for Grid Items
   ========================================================================== */

.feature-card,
.inbound-card,
.step,
.benefit {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                background 0.3s ease,
                border-color 0.3s ease,
                box-shadow 0.3s ease;
}

.feature-card.visible,
.inbound-card.visible,
.step.visible,
.benefit.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Parallax Effects
   ========================================================================== */

.parallax-slow {
    will-change: transform;
}

.parallax-medium {
    will-change: transform;
}

.parallax-fast {
    will-change: transform;
}

/* ==========================================================================
   Hero Animations
   ========================================================================== */

.hero-badge {
    animation: slideDown 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

.hero-title {
    animation: slideUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.4s;
    opacity: 0;
}

.hero-subtitle {
    animation: slideUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.6s;
    opacity: 0;
}

.hero-cta {
    animation: slideUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.8s;
    opacity: 0;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Glow Animation
   ========================================================================== */

@keyframes glow {
    0%, 100% {
        opacity: 0.5;
        filter: blur(40px);
    }
    50% {
        opacity: 0.8;
        filter: blur(60px);
    }
}

.dashboard-glow,
.showcase-image-glow {
    animation: glow 4s ease-in-out infinite;
}

/* ==========================================================================
   Floating Animation
   ========================================================================== */

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

.floating {
    animation: float 6s ease-in-out infinite;
}

/* ==========================================================================
   Particle Animation
   ========================================================================== */

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(0, 212, 170, 0.5);
    border-radius: 50%;
    animation: particleFloat 20s linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) translateX(0) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(100px) scale(1);
        opacity: 0;
    }
}

/* ==========================================================================
   Button Hover Effects
   ========================================================================== */

.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

/* ==========================================================================
   Card Hover Effects
   ========================================================================== */

.feature-card::before,
.inbound-card::before,
.audience-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(0, 212, 170, 0) 0%, rgba(0, 212, 170, 0.3) 50%, rgba(0, 212, 170, 0) 100%);
    -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 ease;
}

.feature-card:hover::before,
.inbound-card:hover::before,
.audience-card:hover::before {
    opacity: 1;
}

/* ==========================================================================
   Text Reveal Animation
   ========================================================================== */

.text-reveal {
    position: relative;
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    transform: translateY(100%);
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.text-reveal.visible span {
    transform: translateY(0);
}

/* ==========================================================================
   Image Reveal Animation
   ========================================================================== */

.image-reveal {
    position: relative;
    overflow: hidden;
}

.image-reveal::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--bg-dark);
    transform: scaleX(1);
    transform-origin: right;
    transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.image-reveal.visible::after {
    transform: scaleX(0);
}

/* ==========================================================================
   Counter Animation
   ========================================================================== */

.counter {
    display: inline-block;
}

.counter-value {
    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Progress Bar Animation
   ========================================================================== */

.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.progress-bar.visible .progress-bar-fill {
    transform: scaleX(1);
}

/* ==========================================================================
   Magnetic Effect (for buttons)
   ========================================================================== */

.magnetic {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Smooth Scroll Behavior
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Disable animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Skeleton Loading
   ========================================================================== */

.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

/* ==========================================================================
   Cursor Effects
   ========================================================================== */

.cursor-pointer {
    cursor: pointer;
}

.cursor-none {
    cursor: none;
}

/* Custom cursor (optional - can be enabled via JS) */
.custom-cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: transform 0.15s ease, width 0.15s ease, height 0.15s ease;
}

.custom-cursor.hover {
    width: 40px;
    height: 40px;
    background: rgba(0, 212, 170, 0.1);
}

/* ==========================================================================
   Page Transition
   ========================================================================== */

.page-transition {
    position: fixed;
    inset: 0;
    background: var(--bg-dark);
    z-index: 9999;
    transform: scaleY(0);
    transform-origin: bottom;
}

.page-transition.active {
    animation: pageTransition 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pageTransition {
    0% {
        transform: scaleY(0);
        transform-origin: bottom;
    }
    50% {
        transform: scaleY(1);
        transform-origin: bottom;
    }
    51% {
        transform-origin: top;
    }
    100% {
        transform: scaleY(0);
        transform-origin: top;
    }
}
