/* ========================================
   VITOP - Premium Animations
   Advanced motion design & micro-interactions
======================================== */

/* ========================================
   1. SCROLL REVEAL ANIMATIONS
======================================== */

/* Base Animation Classes */
[data-aos] {
    opacity: 0;
    transition-property: opacity, transform;
}

[data-aos].aos-animate {
    opacity: 1;
}

/* Fade Animations */
[data-aos="fade-up"] {
    transform: translateY(60px);
}

[data-aos="fade-up"].aos-animate {
    transform: translateY(0);
}

[data-aos="fade-down"] {
    transform: translateY(-60px);
}

[data-aos="fade-down"].aos-animate {
    transform: translateY(0);
}

[data-aos="fade-left"] {
    transform: translateX(60px);
}

[data-aos="fade-left"].aos-animate {
    transform: translateX(0);
}

[data-aos="fade-right"] {
    transform: translateX(-60px);
}

[data-aos="fade-right"].aos-animate {
    transform: translateX(0);
}

/* Zoom Animations */
[data-aos="zoom-in"] {
    transform: scale(0.8);
}

[data-aos="zoom-in"].aos-animate {
    transform: scale(1);
}

[data-aos="zoom-out"] {
    transform: scale(1.2);
}

[data-aos="zoom-out"].aos-animate {
    transform: scale(1);
}

/* Flip Animations */
[data-aos="flip-up"] {
    transform: perspective(2500px) rotateX(-100deg);
}

[data-aos="flip-up"].aos-animate {
    transform: perspective(2500px) rotateX(0);
}

[data-aos="flip-left"] {
    transform: perspective(2500px) rotateY(-100deg);
}

[data-aos="flip-left"].aos-animate {
    transform: perspective(2500px) rotateY(0);
}

/* Slide Animations */
[data-aos="slide-up"] {
    transform: translateY(100%);
}

[data-aos="slide-up"].aos-animate {
    transform: translateY(0);
}

/* ========================================
   2. TEXT REVEAL ANIMATIONS
======================================== */

/* Split Text Animation */
.split-text {
    overflow: hidden;
}

.split-text .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
    animation: charReveal 0.6s ease forwards;
}

@keyframes charReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typewriter Effect */
.typewriter {
    overflow: hidden;
    border-right: 3px solid var(--primary-500);
    white-space: nowrap;
    animation: typing 3.5s 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-500);
    }
}

/* Gradient Text Animation */
.animated-gradient-text {
    background: linear-gradient(90deg,
            var(--primary-500),
            var(--secondary-500),
            var(--accent-gold),
            var(--primary-500));
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientFlow 4s ease infinite;
}

@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ========================================
   3. HOVER MICRO-INTERACTIONS
======================================== */

/* Magnetic Hover Effect */
.magnetic-hover {
    transition: transform 0.3s cubic-bezier(0.33, 1, 0.68, 1);
}

/* Elastic Button */
.btn-elastic {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-elastic:hover {
    transform: scale(1.05);
}

.btn-elastic:active {
    transform: scale(0.95);
}

/* Ripple Effect */
.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, var(--primary-300) 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform 0.5s, opacity 1s;
}

.ripple-effect:active::after {
    transform: scale(0, 0);
    opacity: 0.3;
    transition: 0s;
}

/* Glow Effect on Hover */
.glow-hover {
    transition: box-shadow 0.3s ease;
}

.glow-hover:hover {
    box-shadow:
        0 0 20px rgba(13, 148, 136, 0.3),
        0 0 40px rgba(13, 148, 136, 0.2),
        0 0 60px rgba(13, 148, 136, 0.1);
}

/* Shine Effect */
.shine-effect {
    position: relative;
    overflow: hidden;
}

.shine-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.4),
            transparent);
    transform: skewX(-25deg);
    transition: left 0.5s ease;
}

.shine-effect:hover::before {
    left: 150%;
}

/* ========================================
   4. CARD ANIMATIONS
======================================== */

/* 3D Tilt Effect */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.tilt-card:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

.tilt-card .tilt-content {
    transform: translateZ(30px);
    transition: transform 0.3s ease;
}

/* Card Lift */
.card-lift {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.4s ease;
}

.card-lift:hover {
    transform: translateY(-12px);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 15px 20px rgba(0, 0, 0, 0.05);
}

/* Card Border Gradient Animation */
.border-gradient {
    position: relative;
    background: white;
    border-radius: var(--radius-xl);
}

.border-gradient::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--radius-xl) + 2px);
    background: linear-gradient(135deg,
            var(--primary-500),
            var(--secondary-500),
            var(--accent-gold));
    background-size: 200% 200%;
    z-index: -1;
    animation: borderRotate 3s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.border-gradient:hover::before {
    opacity: 1;
}

@keyframes borderRotate {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ========================================
   5. LOADING ANIMATIONS
======================================== */

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg,
            var(--neutral-200) 25%,
            var(--neutral-100) 50%,
            var(--neutral-200) 75%);
    background-size: 200% 100%;
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

@keyframes skeletonPulse {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Pulse Effect */
.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Bounce */
.bounce {
    animation: bounce 1s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(-25%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }

    50% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

/* ========================================
   6. BACKGROUND ANIMATIONS
======================================== */

/* Animated Gradient Background */
.animated-bg {
    background: linear-gradient(-45deg,
            var(--primary-50),
            var(--secondary-50),
            var(--neutral-50),
            var(--primary-100));
    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%;
    }
}

/* Floating Particles */
.particles-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.4;
    animation: particleFloat linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.4;
    }

    90% {
        opacity: 0.4;
    }

    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Morphing Blob */
.blob {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    animation: blobMorph 8s ease-in-out infinite;
}

@keyframes blobMorph {

    0%,
    100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }

    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

/* ========================================
   7. SCROLL PROGRESS INDICATOR
======================================== */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-500), var(--secondary-500));
    z-index: 9999;
    transition: width 0.1s ease-out;
}

/* ========================================
   8. STAGGER ANIMATIONS
======================================== */

.stagger-container>* {
    opacity: 0;
    transform: translateY(30px);
}

.stagger-container.animated>*:nth-child(1) {
    animation: staggerIn 0.5s ease forwards 0.1s;
}

.stagger-container.animated>*:nth-child(2) {
    animation: staggerIn 0.5s ease forwards 0.2s;
}

.stagger-container.animated>*:nth-child(3) {
    animation: staggerIn 0.5s ease forwards 0.3s;
}

.stagger-container.animated>*:nth-child(4) {
    animation: staggerIn 0.5s ease forwards 0.4s;
}

.stagger-container.animated>*:nth-child(5) {
    animation: staggerIn 0.5s ease forwards 0.5s;
}

.stagger-container.animated>*:nth-child(6) {
    animation: staggerIn 0.5s ease forwards 0.6s;
}

@keyframes staggerIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   9. COUNTER ANIMATION
======================================== */

.counter-animate {
    display: inline-block;
    animation: counterPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes counterPop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

/* ========================================
   10. TOOLTIP ANIMATIONS
======================================== */

.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    padding: 8px 12px;
    background: var(--neutral-900);
    color: white;
    font-size: 12px;
    border-radius: var(--radius-md);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

/* ========================================
   11. IMAGE REVEAL ANIMATIONS
======================================== */

.image-reveal {
    position: relative;
    overflow: hidden;
}

.image-reveal::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--primary-500);
    transform-origin: right;
    animation: imageReveal 1s ease forwards;
}

@keyframes imageReveal {
    to {
        transform: scaleX(0);
    }
}

.image-reveal img {
    transform: scale(1.2);
    animation: imageZoom 1s ease forwards;
}

@keyframes imageZoom {
    to {
        transform: scale(1);
    }
}

/* ========================================
   12. CURSOR EFFECTS
======================================== */

.custom-cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-500);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.15s ease, background 0.15s ease;
    mix-blend-mode: difference;
}

.custom-cursor.hover {
    transform: scale(2);
    background: var(--primary-500);
}

/* ========================================
   13. PAGE TRANSITIONS
======================================== */

.page-transition {
    animation: pageIn 0.5s ease forwards;
}

@keyframes pageIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   14. MARQUEE ANIMATION
======================================== */

.marquee-container {
    overflow: hidden;
}

.marquee-track {
    display: flex;
    animation: marquee 30s linear infinite;
}

.marquee-track:hover {
    animation-play-state: paused;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* ========================================
   15. ENHANCED PRELOADER
======================================== */

/* DNA Helix Loader */
.dna-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.dna-loader span {
    width: 10px;
    height: 10px;
    background: var(--primary-400);
    border-radius: 50%;
    animation: dnaRotate 1.5s ease-in-out infinite;
}

.dna-loader span:nth-child(1) {
    animation-delay: 0s;
}

.dna-loader span:nth-child(2) {
    animation-delay: 0.2s;
}

.dna-loader span:nth-child(3) {
    animation-delay: 0.4s;
}

.dna-loader span:nth-child(4) {
    animation-delay: 0.6s;
}

.dna-loader span:nth-child(5) {
    animation-delay: 0.8s;
}

@keyframes dnaRotate {

    0%,
    100% {
        transform: translateY(-15px);
        background: var(--primary-300);
    }

    50% {
        transform: translateY(15px);
        background: var(--secondary-500);
    }
}

/* ========================================
   16. SCROLL INDICATOR
======================================== */

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.scroll-indicator span {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--neutral-500);
}

.scroll-indicator-mouse {
    width: 26px;
    height: 40px;
    border: 2px solid var(--primary-400);
    border-radius: 13px;
    position: relative;
}

.scroll-indicator-mouse::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: var(--primary-500);
    border-radius: 2px;
    animation: scrollMouse 1.5s ease-in-out infinite;
}

@keyframes scrollMouse {

    0%,
    100% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }

    100% {
        transform: translateX(-50%) translateY(12px);
        opacity: 0;
    }
}

/* ========================================
   17. NOTIFICATION ANIMATIONS
======================================== */

.notification-enter {
    animation: notifyIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.notification-exit {
    animation: notifyOut 0.3s ease forwards;
}

@keyframes notifyIn {
    from {
        opacity: 0;
        transform: translateX(100px) scale(0.8);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes notifyOut {
    to {
        opacity: 0;
        transform: translateX(100px) scale(0.8);
    }
}

/* ========================================
   18. REDUCED MOTION
======================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}