/* =============================================
   Auto Data Intellect - Animations
   ============================================= */

/* Typewriter Effect */
.typewriter {
    border-right: 2px solid var(--accent);
    animation: blink 0.75s step-end infinite;
}

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

/* Fade Animations */
.fade-up,
.fade-left,
.fade-right {
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-up {
    transform: translateY(40px);
}

.fade-left {
    transform: translateX(-40px);
}

.fade-right {
    transform: translateX(40px);
}

.fade-up.visible,
.fade-left.visible,
.fade-right.visible {
    opacity: 1;
    transform: translate(0);
}

/* Reveal Text Animation */
.reveal-text {
    position: relative;
    overflow: hidden;
}

.reveal-text::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    animation: revealText 1.2s ease forwards;
}

@keyframes revealText {
    0% { transform: translateX(0); }
    100% { transform: translateX(101%); }
}

/* Gradient Border Animation */
.animated-border {
    position: relative;
    background: linear-gradient(var(--bg-primary), var(--bg-primary)) padding-box,
                linear-gradient(90deg, var(--accent), #b8e2ff, var(--accent)) border-box;
    border: 2px solid transparent;
    background-size: 200% 100%;
    animation: gradientBorder 3s linear infinite;
}

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

/* Pulse Animation */
.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Float Animation */
.float {
    animation: float 6s ease-in-out infinite;
}

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

/* Glow Animation */
.glow {
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 20px rgba(137, 207, 240, 0.2);
    }
    to {
        box-shadow: 0 0 40px rgba(137, 207, 240, 0.4);
    }
}

/* Shimmer Effect */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Spin Animation */
.spin {
    animation: spin 8s linear infinite;
}

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

/* Scale In Animation */
.scale-in {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Stagger Animation */
.stagger-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Line Draw Animation */
.line-draw {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: lineDraw 2s ease forwards;
}

@keyframes lineDraw {
    to { stroke-dashoffset: 0; }
}

/* Bounce Animation */
.bounce {
    animation: bounce 2s ease infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
    60% { transform: translateY(-10px); }
}

/* Shake Animation */
.shake {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 50%;
    left: 50%;
    pointer-events: none;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 60%);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.6s ease, opacity 0.6s ease;
}

.ripple:active::after {
    transform: translate(-50%, -50%) scale(2);
    opacity: 1;
    transition: transform 0s, opacity 0s;
}

/* Morphing Background */
.morph-bg {
    background-size: 400% 400%;
    animation: morphBg 15s ease infinite;
}

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

/* Text Gradient Animation */
.animated-gradient-text {
    background: linear-gradient(90deg, var(--accent), #b8e2ff, var(--accent));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textGradient 3s linear infinite;
}

@keyframes textGradient {
    to { background-position: 200% center; }
}

/* Particle Float Animation */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0.5;
    animation: particleFloat 10s linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.5;
    }
    90% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Counter Animation */
.counter-animate {
    display: inline-block;
}

/* Loading Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Hover Lift */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Button Hover Effect */
.btn-hover-effect {
    position: relative;
    overflow: hidden;
}

.btn-hover-effect::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-effect:hover::before {
    width: 300px;
    height: 300px;
}

/* Image Hover Zoom */
.img-zoom {
    overflow: hidden;
}

.img-zoom img {
    transition: transform 0.5s ease;
}

.img-zoom:hover img {
    transform: scale(1.1);
}

/* Underline Animation */
.underline-animate {
    position: relative;
}

.underline-animate::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.underline-animate:hover::after {
    width: 100%;
}

/* Card Tilt Effect (3D) */
.card-tilt {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.card-tilt:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(-5deg);
}

/* Delayed Animations */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }
.delay-600 { animation-delay: 600ms; }
.delay-700 { animation-delay: 700ms; }
.delay-800 { animation-delay: 800ms; }
.delay-900 { animation-delay: 900ms; }
.delay-1000 { animation-delay: 1000ms; }

/* Page Transition */
.page-transition {
    animation: pageIn 0.5s ease;
}

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

/* Smooth Fade Transition */
.fade-transition {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.fade-transition.fade-out {
    opacity: 0;
}
