/* ============================================
   KURZ — Animations
   ============================================ */

/* ---------- Keyframes ---------- */
@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

@keyframes bounceDown {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-6px);
    }

    60% {
        transform: translateY(-3px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.92);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(30px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes heartBeat {
    0% {
        transform: scale(1);
    }

    14% {
        transform: scale(1.3);
    }

    28% {
        transform: scale(1);
    }

    42% {
        transform: scale(1.3);
    }

    70% {
        transform: scale(1);
    }
}

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

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ---------- Animation Classes ---------- */
.animate-fade-in {
    animation: fadeIn var(--duration-normal) var(--ease-smooth);
}

.animate-fade-in-up {
    animation: fadeInUp var(--duration-slow) var(--ease-out);
}

.animate-fade-in-scale {
    animation: fadeInScale var(--duration-slow) var(--ease-spring);
}

.animate-slide-in-right {
    animation: slideInRight var(--duration-slow) var(--ease-out);
}

.animate-pulse {
    animation: pulse 2s var(--ease-smooth) infinite;
}

.animate-heartbeat {
    animation: heartBeat 1s var(--ease-smooth);
}

/* ---------- Card Swipe Transitions ---------- */
.card-container {
    transition: transform var(--duration-slow) var(--ease-out);
    will-change: transform;
    /* GPU Optimization */
}

.card-container.swiping {
    transition: none;
}

.card-container.snap {
    transition: transform 350ms var(--ease-spring);
    /* Faster (was 500ms) */
}

/* Card content stagger animation */
.news-card.active .card-category-tag {
    animation: fadeInUp 400ms var(--ease-out) 100ms both;
}

.news-card.active .card-title {
    animation: fadeInUp 400ms var(--ease-out) 200ms both;
}

.news-card.active .card-summary {
    animation: fadeInUp 400ms var(--ease-out) 300ms both;
}

.news-card.active .card-meta {
    animation: fadeInUp 400ms var(--ease-out) 400ms both;
}

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

.ripple::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    width: 100px;
    height: 100px;
    margin-top: -50px;
    margin-left: -50px;
    top: 50%;
    left: 50%;
    transform: scale(0);
    opacity: 1;
    pointer-events: none;
}

.ripple:active::after {
    animation: ripple 0.6s linear;
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .card-container {
        transition: none !important;
    }
}

/* ---------- Splash Screen ---------- */
.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    transition: opacity 500ms var(--ease-smooth), visibility 500ms;
}

.splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-logo {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: var(--weight-bold);
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInScale 600ms var(--ease-spring) both;
}

.splash-subtitle {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    margin-top: var(--space-2);
    animation: fadeInUp 600ms var(--ease-out) 300ms both;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.splash-loader {
    width: 40px;
    height: 3px;
    background: var(--bg-glass);
    border-radius: var(--radius-full);
    margin-top: var(--space-8);
    overflow: hidden;
    animation: fadeIn 600ms var(--ease-out) 500ms both;
}

/* Ambient Background */
.ambient-background {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.6;
    background:
        radial-gradient(circle at 15% 50%, rgba(108, 92, 231, 0.25), transparent 40%),
        radial-gradient(circle at 85% 30%, rgba(0, 206, 201, 0.2), transparent 40%),
        radial-gradient(circle at 50% 80%, rgba(253, 121, 168, 0.15), transparent 50%);
    filter: blur(80px);
    animation: bgPulse 15s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.1);
    }
}

.splash-loader::after {
    content: '';
    display: block;
    width: 50%;
    height: 100%;
    background: var(--brand-gradient);
    border-radius: var(--radius-full);
    animation: shimmer 1s var(--ease-smooth) infinite;
}

/* Pulse animation for streak fire emoji */
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

/* Spin animation for theme toggle */
@keyframes animate-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: animate-spin 0.5s var(--ease-smooth);
}