/*
 * Phishing Detector Pro - Animations
 * Advanced CSS animations and transitions
 */

/* ========== ENTRANCE ANIMATIONS ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate3d(0, -40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translate3d(-40px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translate3d(40px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale3d(0.3, 0.3, 0.3);
    }
    to {
        opacity: 1;
        transform: scale3d(1, 1, 1);
    }
}

@keyframes slideInUp {
    from {
        transform: translate3d(0, 100%, 0);
    }
    to {
        transform: translate3d(0, 0, 0);
    }
}

/* ========== FLOATING ANIMATIONS ========== */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes floatRotate {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-15px) rotate(5deg);
    }
}

/* ========== PULSE ANIMATIONS ========== */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(139, 92, 246, 0.6);
    }
}

@keyframes ripple {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* ========== SPIN ANIMATIONS ========== */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

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

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

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

/* ========== BOUNCE ANIMATIONS ========== */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-30px);
    }
    60% {
        transform: translateY(-15px);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ========== WAVE ANIMATIONS ========== */
@keyframes wave {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-10deg);
    }
    75% {
        transform: rotate(10deg);
    }
}

/* ========== BLINK ANIMATIONS ========== */
@keyframes blink {
    0%, 50%, 100% {
        opacity: 1;
    }
    25%, 75% {
        opacity: 0;
    }
}

@keyframes blurIn {
    from {
        opacity: 0;
        filter: blur(10px);
    }
    to {
        opacity: 1;
        filter: blur(0);
    }
}

/* ========== PROGRESS ANIMATIONS ========== */
@keyframes progressBar {
    from {
        width: 0;
    }
    to {
        width: var(--progress-width, 100%);
    }
}

@keyframes loadingDots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%, 100% {
        content: '...';
    }
}

/* ========== CIRCLE PROGRESS ========== */
@keyframes circleProgress {
    from {
        stroke-dashoffset: 100;
    }
    to {
        stroke-dashoffset: var(--circle-progress, 0);
    }
}

/* ========== CARD HOVER EFFECTS ========== */
.card-hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.card-hover-scale {
    transition: transform 0.3s ease;
}

.card-hover-scale:hover {
    transform: scale(1.02);
}

.card-hover-glow {
    transition: box-shadow 0.3s ease;
}

.card-hover-glow:hover {
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
}

/* ========== BUTTON ANIMATIONS ========== */
.btn-animate {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-animate::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.5s ease;
}

.btn-animate:hover::before {
    left: 100%;
}

.btn-animate:active {
    transform: scale(0.98);
}

/* ========== ICON ANIMATIONS ========== */
.icon-hover-rotate {
    transition: transform 0.3s ease;
}

.icon-hover-rotate:hover {
    transform: rotate(360deg);
}

.icon-hover-scale {
    transition: transform 0.3s ease;
}

.icon-hover-scale:hover {
    transform: scale(1.2);
}

/* ========== LIST ANIMATIONS ========== */
.list-item-animate {
    opacity: 0;
    animation: fadeInUp 0.4s ease forwards;
}

.list-item-animate:nth-child(1) { animation-delay: 0.05s; }
.list-item-animate:nth-child(2) { animation-delay: 0.1s; }
.list-item-animate:nth-child(3) { animation-delay: 0.15s; }
.list-item-animate:nth-child(4) { animation-delay: 0.2s; }
.list-item-animate:nth-child(5) { animation-delay: 0.25s; }
.list-item-animate:nth-child(6) { animation-delay: 0.3s; }
.list-item-animate:nth-child(7) { animation-delay: 0.35s; }
.list-item-animate:nth-child(8) { animation-delay: 0.4s; }

/* ========== STAGGERED ANIMATIONS ========== */
.stagger-fade-in > * {
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

.stagger-fade-in > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-fade-in > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-fade-in > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-fade-in > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-fade-in > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-fade-in > *:nth-child(6) { animation-delay: 0.6s; }

.stagger-zoom-in > * {
    opacity: 0;
    animation: zoomIn 0.4s ease forwards;
}

.stagger-zoom-in > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-zoom-in > *:nth-child(2) { animation-delay: 0.15s; }
.stagger-zoom-in > *:nth-child(3) { animation-delay: 0.2s; }
.stagger-zoom-in > *:nth-child(4) { animation-delay: 0.25s; }
.stagger-zoom-in > *:nth-child(5) { animation-delay: 0.3s; }
.stagger-zoom-in > *:nth-child(6) { animation-delay: 0.35s; }

/* ========== SCAN RESULT ANIMATIONS ========== */
.result-reveal {
    animation: resultReveal 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes resultReveal {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.confidence-fill {
    animation: confidenceFill 1.5s ease-out forwards;
}

@keyframes confidenceFill {
    from {
        width: 0;
    }
}

/* ========== SKELETON LOADING ========== */
.skeleton-pulse {
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

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

.skeleton-wave {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: skeletonWave 1.5s infinite;
}

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

/* ========== SCANNER ANIMATION ========== */
.scanner-line {
    position: absolute;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #3b82f6, transparent);
    animation: scannerLine 2s ease-in-out infinite;
}

@keyframes scannerLine {
    0%, 100% {
        top: 0;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        top: 100%;
        opacity: 0;
    }
}

/* ========== CHECKMARK ANIMATION ========== */
.checkmark-draw {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: checkmarkDraw 0.5s ease forwards 0.3s;
}

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

/* ========== CROSS ANIMATION ========== */
.cross-draw {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: crossDraw 0.5s ease forwards 0.3s;
}

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

/* ========== PROGRESS CIRCLE ========== */
.progress-circle {
    transform: rotate(-90deg);
}

.progress-circle-fill {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: progressCircleFill 1s ease-out forwards;
}

@keyframes progressCircleFill {
    to {
        stroke-dashoffset: var(--circle-offset, 0);
    }
}

/* ========== WIGGLE ========== */
.wiggle {
    animation: wiggle 0.5s ease-in-out infinite;
}

@keyframes wiggle {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-3deg);
    }
    75% {
        transform: rotate(3deg);
    }
}

/* ========== DANCE ========== */
.dance {
    animation: dance 0.5s ease-in-out;
}

@keyframes dance {
    0%, 100% {
        transform: rotate(0deg) scale(1);
    }
    25% {
        transform: rotate(-10deg) scale(1.1);
    }
    50% {
        transform: rotate(10deg) scale(0.9);
    }
    75% {
        transform: rotate(-5deg) scale(1.05);
    }
}

/* ========== REVEAL ON SCROLL ========== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

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

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.6s ease;
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.6s ease;
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

/* ========== PARALLAX FLOAT ========== */
.parallax-float {
    animation: parallaxFloat 6s ease-in-out infinite;
}

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

/* ========== UTILITY ANIMATION CLASSES ========== */
.animate-fade-in { animation: fadeInUp 0.5s ease forwards; }
.animate-fade-down { animation: fadeInDown 0.5s ease forwards; }
.animate-fade-left { animation: fadeInLeft 0.5s ease forwards; }
.animate-fade-right { animation: fadeInRight 0.5s ease forwards; }
.animate-zoom { animation: zoomIn 0.5s ease forwards; }
.animate-bounce { animation: bounce 0.6s ease forwards; }
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-spin { animation: spin 1s linear infinite; }
.animate-shake { animation: shake 0.5s ease; }
.animate-wiggle { animation: wiggle 0.5s ease-in-out infinite; }
.animate-blink { animation: blink 1s infinite; }
.animate-blur { animation: blurIn 0.5s ease forwards; }

/* Animation delays */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }

/* Duration utilities */
.duration-fast { animation-duration: 0.2s; }
.duration-normal { animation-duration: 0.4s; }
.duration-slow { animation-duration: 0.6s; }
.duration-slower { animation-duration: 1s; }

/* Pause on hover */
.pause-animation:hover * {
    animation-play-state: paused;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@keyframes auroraGlow {
  0%, 100% { 
    background-position: 0% 50%;
    filter: blur(40px);
  }
  50% { 
    background-position: 100% 50%;
    filter: blur(60px);
  }
}

.aurora-bg {
  background: linear-gradient(-45deg, #6366F1, #06B6D4, #EC4899, #8B5CF6);
  background-size: 400% 400%;
  animation: auroraGlow 15s ease infinite;
}

.glass-card-hover {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.glass-card-hover:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.15), 0 0 0 1px rgba(99, 102, 241, 0.1);
}
