/* Additional animations and effects for SoK website */

/* Page transition animations */
@keyframes logo-pulse {
    0% { 
        box-shadow: 0 0 10px 2px var(--primary40);
        transform: scale(0.95);
    }
    50% { 
        box-shadow: 0 0 20px 8px var(--primary60);
        transform: scale(1.05);
    }
    100% { 
        box-shadow: 0 0 10px 2px var(--primary40);
        transform: scale(0.95);
    }
}

@keyframes logo-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes page-slide-out {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(30px); opacity: 0; }
}

@keyframes page-slide-in {
    0% { transform: translateY(-30px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* Miami Vice-inspired transitions */
@keyframes neon-flicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        opacity: 1;
        text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #ff00cc, 0 0 20px #ff00cc,
        0 0 25px #ff00cc, 0 0 30px #ff00cc, 0 0 35px #ff00cc;
    }
    20%, 22%, 24%, 55% {
        opacity: 0.4;
        text-shadow: none;
    }
}

@keyframes grid-sweep {
    0% { transform: translateZ(-100vh); }
    100% { transform: translateZ(100vh); }
}

@keyframes vhs-glitch {
    0%, 100% { transform: translate(0, 0) skew(0deg); }
    25% { transform: translate(2px, -2px) skew(1deg); }
    50% { transform: translate(-2px, 2px) skew(-1deg); }
    75% { transform: translate(1px, -1px) skew(-0.5deg); }
}

@keyframes retro-stripe {
    0% { background-position: 0 0; }
    100% { background-position: 100% 0; }
}

/* General animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

.animate-from-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-from-left.animated {
    opacity: 1;
    transform: translateX(0);
}

.animate-from-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-from-right.animated {
    opacity: 1;
    transform: translateX(0);
}

.animate-scale {
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.8s ease;
}

.animate-scale.animated {
    transform: scale(1);
    opacity: 1;
}

/* Delay utilities */
.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; }
.delay-500 { transition-delay: 0.5s; }
.delay-600 { transition-delay: 0.6s; }
.delay-700 { transition-delay: 0.7s; }
.delay-800 { transition-delay: 0.8s; }

/* Navbar animations */
nav {
    transition: background-color 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
}

nav.nav-scrolled {
    background-color: var(--bg) !important;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    padding: 0.7rem 4vw !important;
}

/* Enhanced buttons */
.primary-button {
    position: relative;
    overflow: hidden;
    background-color: var(--primary);
    color: var(--bg);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 700;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px var(--primary30);
}

.primary-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px var(--primary40);
}

.primary-button:active {
    transform: translateY(-1px);
}

.primary-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, var(--primary40), transparent);
    transform: translateX(-100%);
    transition: 0.6s;
}

.primary-button:hover::after {
    transform: translateX(100%);
}

.secondary-button {
    position: relative;
    background-color: transparent;
    color: var(--text);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 700;
    display: inline-block;
    transition: all 0.3s ease;
    border: 1px solid var(--secondary40);
}

.secondary-button:hover {
    background-color: var(--secondary40);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Hero particles background */
.hero-section {
    position: relative;
    overflow: hidden;
}

.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    background-color: var(--primary);
    border-radius: 50%;
    animation: float 20s infinite linear;
}

@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: var(--opacity, 0.6);
        transform: translateY(-15vh) rotate(36deg);
    }
    20% {
        transform: translateY(-25vh) rotate(72deg);
    }
    30% {
        transform: translateY(-35vh) rotate(108deg);
    }
    40% {
        transform: translateY(-45vh) rotate(144deg);
    }
    50% {
        transform: translateY(-55vh) rotate(180deg);
    }
    60% {
        transform: translateY(-65vh) rotate(216deg);
    }
    70% {
        transform: translateY(-75vh) rotate(252deg);
    }
    80% {
        transform: translateY(-85vh) rotate(288deg);
    }
    90% {
        transform: translateY(-95vh) rotate(324deg);
        opacity: var(--opacity, 0.6);
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Neon text effect */
.neon-text {
    color: #fff;
    text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 20px var(--primary), 0 0 30px var(--primary),
    0 0 40px var(--primary), 0 0 55px var(--primary), 0 0 75px var(--primary);
}

.neon-letter {
    display: inline-block;
    animation: neon-flicker 5s infinite alternate;
    animation-delay: calc(var(--i) * 0.1s);
}

@keyframes neon-flicker {
    0%, 19.999%, 22%, 62.999%, 64%, 64.999%, 70%, 100% {
        opacity: 1;
        text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 20px var(--primary), 0 0 30px var(--primary),
        0 0 40px var(--primary), 0 0 55px var(--primary), 0 0 75px var(--primary);
    }
    20%, 21.999%, 63%, 63.999%, 65%, 69.999% {
        opacity: 0.4;
        text-shadow: none;
    }
}

/* Enhanced card hover effects */
.enhanced-card {
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
}

.enhanced-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, var(--primary20), transparent);
    transform: translateX(-100%);
    transition: 0.6s;
}

.enhanced-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
}

.enhanced-card:hover::before {
    transform: translateX(100%);
}

/* Enhanced statistics counters */
.stat-number, .extra-stat-number {
    position: relative;
    display: inline-block;
}

.stat-number::after, .extra-stat-number::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: width 1s ease;
}

.stat-number.animated::after, .extra-stat-number.animated::after {
    width: 100%;
}

/* Glowing dots for roadmap */
.roadmap-dot {
    position: relative;
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 5px 2px var(--primary40);
    }
    50% {
        box-shadow: 0 0 15px 5px var(--primary40);
    }
    100% {
        box-shadow: 0 0 5px 2px var(--primary40);
    }
}

/* Banner animation enhancement */
.scrolling-banner {
    position: relative;
    overflow: hidden;
}

.scrolling-banner::before, .scrolling-banner::after {
    content: '';
    position: absolute;
    top: 0;
    width: 5vw;
    height: 100%;
    z-index: 1;
}

.scrolling-banner::before {
    left: 0;
    background: linear-gradient(to right, var(--primary), transparent);
}

.scrolling-banner::after {
    right: 0;
    background: linear-gradient(to left, var(--primary), transparent);
}

/* Vision section enhancements */
.vision-column {
    transition: all 0.3s ease;
}

.vision-column:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--primary30);
}

.vision-icon {
    transition: all 0.3s ease;
}

.vision-column:hover .vision-icon {
    transform: scale(1.1);
    background-color: var(--primary20);
}

/* Circle background elements */
.bg-circle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary20), transparent);
    opacity: 0.2;
    filter: blur(60px);
    z-index: 0;
}

.bg-circle.top-left {
    top: -15vh;
    left: -15vh;
    width: 40vh;
    height: 40vh;
}

.bg-circle.bottom-right {
    bottom: -15vh;
    right: -15vh;
    width: 30vh;
    height: 30vh;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .animate-on-scroll {
        transition: opacity 0.5s ease, transform 0.5s ease;
    }
    
    .particle {
        display: none;
    }
}

/* Footer-specific animations */
.footer-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.footer-animate.animated {
    opacity: 1;
    transform: translateY(0);
}

.footer-animate.delay-100 { transition-delay: 0.1s; }
.footer-animate.delay-200 { transition-delay: 0.2s; }
.footer-animate.delay-300 { transition-delay: 0.3s; }
.footer-animate.delay-400 { transition-delay: 0.4s; }
.footer-animate.delay-500 { transition-delay: 0.5s; }

/* Social link hover animations */
@keyframes social-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-3px);
    }
}

.social-link:hover {
    animation: social-bounce 0.6s ease;
}

/* Newsletter success animation */
@keyframes newsletter-success {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); background-color: var(--success); }
    100% { transform: scale(1); }
}

.newsletter-btn.success {
    animation: newsletter-success 0.3s ease;
}

/* Footer logo pulse animation */
@keyframes footer-logo-pulse {
    0%, 100% { 
        box-shadow: 0 0 20px var(--primary30);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 30px var(--primary40);
        transform: scale(1.02);
    }
}

.footer .logo-img:hover {
    animation: footer-logo-pulse 2s ease-in-out infinite;
}
