/* Animations.css - Contains all animation related styles */

/* Preloader Animation */
@keyframes fadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; visibility: hidden; }
}

/* Glitch Animation */
@keyframes glitch {
    0% { text-shadow: 0.05em 0 0 var(--primary), -0.05em -0.025em 0 var(--secondary), -0.025em 0.05em 0 var(--accent); }
    14% { text-shadow: 0.05em 0 0 var(--primary), -0.05em -0.025em 0 var(--secondary), -0.025em 0.05em 0 var(--accent); }
    15% { text-shadow: -0.05em -0.025em 0 var(--primary), 0.025em 0.025em 0 var(--secondary), -0.05em -0.05em 0 var(--accent); }
    49% { text-shadow: -0.05em -0.025em 0 var(--primary), 0.025em 0.025em 0 var(--secondary), -0.05em -0.05em 0 var(--accent); }
    50% { text-shadow: 0.025em 0.05em 0 var(--primary), 0.05em 0 0 var(--secondary), 0 -0.05em 0 var(--accent); }
    99% { text-shadow: 0.025em 0.05em 0 var(--primary), 0.05em 0 0 var(--secondary), 0 -0.05em 0 var(--accent); }
    100% { text-shadow: 0.05em 0 0 var(--primary), -0.05em -0.025em 0 var(--secondary), -0.025em 0.05em 0 var(--accent); }
}

/* Hover Animations for Feature Cards */
.feature-card:hover .card-icon {
    animation: pulse-icon 1s infinite alternate;
}

@keyframes pulse-icon {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); box-shadow: 0 0 15px rgba(255, 255, 255, 0.3); }
}

/* Phone animations in device showcase */
.devices-container:hover .phone-inner {
    animation-play-state: paused;
}

.devices-container:hover .tablet-inner {
    animation-play-state: paused;
}

/* Scroll Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Section Transitions */
.section-transition-in {
    animation: sectionTransitionIn 0.8s forwards;
}

@keyframes sectionTransitionIn {
    0% { opacity: 0; transform: translateY(50px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Typing Animation */
.typing {
    border-right: 2px solid var(--primary);
    white-space: nowrap;
    overflow: hidden;
    animation: typing 4s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--primary); }
}

/* Button Hover Animation */
.btn:hover::before {
    animation: ripple 0.6s linear forwards;
}

@keyframes ripple {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

/* Pulse Animation for call-to-action buttons */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Highlight Animation for featured elements */
.highlight {
    position: relative;
    overflow: hidden;
}

.highlight::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(30deg);
    animation: highlight 3s infinite;
}

@keyframes highlight {
    0% { transform: rotate(30deg) translateX(-100%); }
    100% { transform: rotate(30deg) translateX(100%); }
}

/* Gradient hover animation */
.gradient-hover {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.gradient-hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gradient-hover:hover::before {
    opacity: 1;
}

/* Card Flip Animation */
.flip-card {
    perspective: 1000px;
}

.flip-card-inner {
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* Floating Animation for Devices */
@keyframes floating {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

/* Text reveal animation */
.text-reveal {
    position: relative;
}

.text-reveal span {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    animation: revealText 0.5s forwards;
}

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

/* Rotating animation for loading states */
.rotate {
    animation: rotating 2s linear infinite;
}

@keyframes rotating {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Background gradient animation */
.bg-animate {
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Neon glow effect */
.neon-glow {
    box-shadow: 0 0 5px var(--primary),
                0 0 10px var(--primary),
                0 0 15px var(--primary);
    animation: neonGlow 1.5s ease-in-out infinite alternate;
}

@keyframes neonGlow {
    from { box-shadow: 0 0 5px var(--primary), 0 0 10px var(--primary), 0 0 15px var(--primary); }
    to { box-shadow: 0 0 10px var(--primary), 0 0 20px var(--primary), 0 0 30px var(--primary); }
}

/* Device switching animation */
.device-switch-enter {
    opacity: 0;
    transform: translateX(100px);
}

.device-switch-enter-active {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.5s, transform 0.5s;
}

.device-switch-exit {
    opacity: 1;
    transform: translateX(0);
}

.device-switch-exit-active {
    opacity: 0;
    transform: translateX(-100px);
    transition: opacity 0.5s, transform 0.5s;
}

/* Morphing shape animation */
.morphing-shape {
    animation: morphing 10s infinite;
}

@keyframes morphing {
    0% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
    25% { border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%; }
    50% { border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%; }
    75% { border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%; }
    100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
}

/* Counter animation */
.counter-animate {
    animation: countUp 3s forwards;
}

@keyframes countUp {
    from { content: "0"; }
    to { content: attr(data-count); }
}

/* Blinking cursor animation */
.cursor-blink {
    width: 3px;
    height: 24px;
    background-color: var(--primary);
    display: inline-block;
    margin-left: 4px;
    animation: cursorBlink 1s infinite;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Skew animation */
.skew-hover:hover {
    animation: skew 0.5s alternate;
}

@keyframes skew {
    0% { transform: skew(0deg, 0deg); }
    25% { transform: skew(5deg, 0deg); }
    75% { transform: skew(-5deg, 0deg); }
    100% { transform: skew(0deg, 0deg); }
}

/* 3D rotation on hover */
.rotate3d {
    transition: transform 0.7s ease;
    transform-style: preserve-3d;
}

.rotate3d:hover {
    transform: rotate3d(1, 1, 0, 15deg);
}

/* Shake animation for alerts */
.shake {
    animation: shake 0.82s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Caret animation for forms */
.caret-animation {
    position: relative;
}

.caret-animation::after {
    content: "";
    position: absolute;
    right: -12px;
    top: 0;
    height: 100%;
    width: 2px;
    background-color: var(--primary);
    animation: caretBlink 1s infinite;
}

@keyframes caretBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Number counter animation */
.number-counter {
    counter-reset: count 0;
    animation: counter 2s linear forwards;
}

@keyframes counter {
    to {
        counter-increment: count attr(data-count);
    }
}

.number-counter::after {
    content: counter(count);
}