/* Fade In Animation */
@keyframes fadeIn {
    0% { 
        opacity: 0; 
        transform: translateY(10px) scale(0.9);
        filter: blur(20px);
        transform-origin: center center;
    }
    50% {
        opacity: 1;
        transform: translateY(-2px) scale(1.006);
        filter: blur(0);
    }
    75% { 
        opacity: 1; 
        transform: translateY(1px) scale(0.995);
        filter: blur(1px);
        transform-origin: center center;
    }
    100% { 
        opacity: 1; 
        transform: translateY(0) scale(1);
        filter: blur(0);
        transform-origin: center center;
    }
}

/* Pulse Animation */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

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

/* Float Animation */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* Apply Animations */
.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
    opacity: 0;
    animation-delay: var(--delay, 0s);
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-bounce {
    animation: bounce 1s infinite;
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

/* Staggered Animation for Cards */
.knowledge-card {
    opacity: 0;
    animation: fadeIn 1.2s ease-out forwards;
}

.knowledge-card:nth-child(1) { animation-delay: 0.1s; }
.knowledge-card:nth-child(2) { animation-delay: 0.2s; }
.knowledge-card:nth-child(3) { animation-delay: 0.3s; }
.knowledge-card:nth-child(4) { animation-delay: 0.4s; }
.knowledge-card:nth-child(5) { animation-delay: 0.5s; }
.knowledge-card:nth-child(6) { animation-delay: 0.6s; }
.knowledge-card:nth-child(7) { animation-delay: 0.7s; }
.knowledge-card:nth-child(8) { animation-delay: 0.8s; }

/* Hover Effects */
.knowledge-card:hover .knowledge-title {
    color: var(--primary-color);
    transition: var(--transition);
}

/* Button Hover Effect */
button:hover, .category-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Ultra-Visible Loading Animation */
@keyframes spin {
    0% { 
        transform: translate(-50%, -50%) rotate(0deg);
        border-top-color: #ff3366;
        border-right-color: #00ffcc;
        border-bottom-color: #ffcc00;
        border-left-color: #ff3366;
    }
    25% {
        border-top-color: #00ffcc;
        border-right-color: #ff3366;
        border-bottom-color: #ff3366;
        border-left-color: #ffcc00;
    }
    50% {
        border-top-color: #ffcc00;
        border-right-color: #ff3366;
        border-bottom-color: #00ffcc;
        border-left-color: #ff3366;
    }
    75% {
        border-top-color: #00ffcc;
        border-right-color: #ffcc00;
        border-bottom-color: #ff3366;
        border-left-color: #00ffcc;
    }
    100% { 
        transform: translate(-50%, -50%) rotate(360deg);
        border-top-color: #ff3366;
        border-right-color: #00ffcc;
        border-bottom-color: #ffcc00;
        border-left-color: #ff3366;
    }
}

@keyframes pulse {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
        filter: drop-shadow(0 0 15px rgba(255, 51, 102, 0.7));
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.2);
        filter: drop-shadow(0 0 30px rgba(0, 255, 204, 0.9));
    }
}

@keyframes backgroundPulse {
    0%, 100% {
        background-color: rgba(0, 0, 0, 0.7);
    }
    50% {
        background-color: rgba(0, 0, 0, 0.8);
    }
}

.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: backgroundPulse 2s ease-in-out infinite;
}

.loading::before {
    content: '';
    position: relative;
    width: 100px;
    height: 100px;
    border: 10px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: #ff3366;
    border-right-color: #00ffcc;
    border-bottom-color: #ffcc00;
    border-left-color: #ff3366;
    animation: 
        spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite,
        pulse 1.5s ease-in-out infinite;
    z-index: 10000;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    margin: 0 auto;
    display: block;
}

.loading::after {
    content: 'Lädt...';
    position: relative;
    display: block;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
    margin-top: 30px;
    animation: pulse 1.5s ease-in-out infinite;
    z-index: 10001;
    text-align: center;
}

/* Ripple Effect */
@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple {
    position: relative;
    overflow: hidden;
}

.ripple:after {
    content: '';
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, #fff 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform .5s, opacity 1s;
}

.ripple:active:after {
    transform: scale(0, 0);
    opacity: .3;
    transition: 0s;
}
