/**
 * Animations for KUSD Theme
 */

/* Floating Elements Animation */
@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
    100% {
        transform: translateY(0) rotate(0deg);
    }
}

.floating-element {
    position: fixed;
    z-index: -1;
    opacity: 0.05;
    pointer-events: none;
    animation: float 15s ease-in-out infinite;
}

.floating-element.circle {
    border-radius: 50%;
    background-color: var(--color-accent);
}

.floating-element.square {
    background-color: var(--color-accent);
}

.floating-element.triangle {
    width: 0 !important;
    height: 0 !important;
    border-left: 25px solid transparent;
    border-right: 25px solid transparent;
    border-bottom: 50px solid var(--color-accent);
    background-color: transparent;
}

.floating-element.hexagon {
    background-color: transparent;
    width: 0 !important;
    height: 0 !important;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    border-bottom: 20px solid var(--color-accent);
    position: relative;
}

.floating-element.hexagon:after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    border-top: 20px solid var(--color-accent);
    top: 20px;
    left: -30px;
}

/* Glow Pulse Animation */
@keyframes glowPulse {
    0% {
        box-shadow: 0 0 5px rgba(0, 255, 65, 0.5), 0 0 10px rgba(0, 255, 65, 0.3);
    }
    50% {
        box-shadow: 0 0 15px rgba(0, 255, 65, 0.8), 0 0 20px rgba(0, 255, 65, 0.5);
    }
    100% {
        box-shadow: 0 0 5px rgba(0, 255, 65, 0.5), 0 0 10px rgba(0, 255, 65, 0.3);
    }
}

.glow-pulse {
    animation: glowPulse 2s infinite;
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 1s ease-in-out;
}

/* Slide Up Animation */
@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-up {
    animation: slideUp 0.8s ease-out;
}

/* Card Animation */
@keyframes cardReveal {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.card.animated {
    animation: cardReveal 0.6s ease-out forwards;
}

.card {
    opacity: 0;
}

/* Typing Cursor Animation */
@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

.typing-cursor {
    display: inline-block;
    width: 3px;
    height: 1em;
    background-color: var(--color-accent);
    margin-left: 5px;
    vertical-align: text-bottom;
    animation: blink 1s step-end infinite;
}

/* Progress Bar Animation */
@keyframes progressFill {
    from {
        width: 0;
    }
}

.progress-bar .progress {
    animation: progressFill 1.5s ease-out forwards;
}

/* Glitch Effect */
@keyframes glitch {
    0% {
        transform: translate(0);
    }
    20% {
        transform: translate(-3px, 3px);
    }
    40% {
        transform: translate(-3px, -3px);
    }
    60% {
        transform: translate(3px, 3px);
    }
    80% {
        transform: translate(3px, -3px);
    }
    100% {
        transform: translate(0);
    }
}

.glitch {
    position: relative;
}

.glitch:hover {
    animation: glitch 0.3s cubic-bezier(.25, .46, .45, .94) both infinite;
    color: var(--color-accent);
}

/* Button Hover Animation */
@keyframes buttonGlow {
    0% {
        box-shadow: 0 0 5px rgba(0, 255, 65, 0.5);
    }
    100% {
        box-shadow: 0 0 20px rgba(0, 255, 65, 0.8);
    }
}

.btn-primary:hover,
.btn-secondary:hover {
    animation: buttonGlow 0.3s forwards;
}

/* Logo Animation */
@keyframes logoGlow {
    0% {
        filter: drop-shadow(0 0 2px rgba(0, 255, 65, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 10px rgba(0, 255, 65, 0.8));
    }
    100% {
        filter: drop-shadow(0 0 2px rgba(0, 255, 65, 0.5));
    }
}

.custom-logo {
    animation: logoGlow 4s infinite;
}