/**
 * animations.css — Visual transitions for xtheme
 */

/* ── 1. SCROLL-TRIGGERED FADE-IN ─────────────────────────────────────────── */

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(60px);
    }

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

.animate-ready {
    opacity: 0;
}

.animate-visible {
    animation: slideUpFade 0.8s cubic-bezier(0.25, 0.8, 0.25, 1) forwards !important;
}

/* 
   Fix for dark blocks: don't fade the full block (which causes a white/grey flash over the light body background).
   Instead, keep the background solid and animate the inner content.
*/
.block-paragraph--black.animate-ready {
    opacity: 1 !important;
}

.block-paragraph--black.animate-visible {
    animation: none !important;
}

.block-paragraph--black.animate-ready>* {
    opacity: 0;
}

.block-paragraph--black.animate-visible>* {
    animation: slideUpFade 0.8s cubic-bezier(0.25, 0.8, 0.25, 1) forwards !important;
}

/* Slide in from the left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-150px);
    }

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

.animate-ready-left {
    opacity: 0;
}

.animate-visible-left {
    animation: slideInLeft 1s cubic-bezier(0.25, 0.8, 0.25, 1) forwards !important;
}

/* ── 2. FOOTER MARQUEE (Removed) ─────────────────────────────────────────── */

/* ── 3. BACK-TO-TOP BUTTON ───────────────────────────────────────────────── */

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid rgba(255, 193, 0, 0.7);
    background: rgba(18, 18, 18, 0.88);
    color: #ffc100;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
    backdrop-filter: blur(6px);
    line-height: 1;
}

.back-to-top--visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:hover {
    background: #ffc100;
    color: #111;
    border-color: #ffc100;
}

@media (max-width: 700px) {
    .back-to-top {
        bottom: 18px;
        right: 18px;
        width: 40px;
        height: 40px;
        font-size: 17px;
    }
}

/* ── 4. CTA PULSE ────────────────────────────────────────────────────────── */

/* Pulse for yellow buttons (yellow glow on dark background) */
@keyframes ctaPulseYellow {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 193, 0, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(255, 193, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 0, 0);
    }
}

/* Pulse for dark buttons (weak dark shadow on yellow background) */
@keyframes ctaPulseDarkWeak {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.3);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(0, 0, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
    }
}

/* Default to yellow pulse (for yellow buttons like in modals and footer) */
.cta-pulse {
    animation: ctaPulseYellow 3s ease-in-out infinite !important;
}

/* Override with weak dark pulse for dark buttons (hero section) */
.form-button--dark.cta-pulse {
    animation: ctaPulseDarkWeak 3s ease-in-out infinite !important;
}

/* Ensure the circular Telegram icon in the header always gets a perfectly round pulse */
.social-links__link--telegram {
    animation: ctaPulseDarkWeak 3s ease-in-out infinite !important;
    border-radius: 50%;
}

/* Ensure parents don't clip the pulse shadow */
.ui-dialog,
.ui-dialog-content,
.form,
.form-item,
.paragraph,
.layout__header,
.layout__header-inner,
.page-header__second-row,
.page-header__social-links,
.social-links,
.social-links__link {
    overflow: visible !important;
}

/* ── 5. GLOBAL LINK TRANSITIONS ──────────────────────────────────────────── */

a {
    transition: color 0.2s ease, opacity 0.2s ease;
}

/* ── 6. FIRE GLOW EFFECT FOR BIG LOGO ──────────────────────────────────────── */

@keyframes logoFireGlow {

    0%,
    100% {
        filter: drop-shadow(0 -2px 6px rgba(255, 193, 0, 0.6)) drop-shadow(0 -4px 12px rgba(255, 150, 0, 0.4));
    }

    20% {
        filter: drop-shadow(0 -5px 10px rgba(255, 210, 0, 0.75)) drop-shadow(0 -10px 20px rgba(255, 160, 0, 0.5));
    }

    40% {
        filter: drop-shadow(0 -3px 8px rgba(255, 193, 0, 0.6)) drop-shadow(0 -7px 15px rgba(255, 150, 0, 0.45));
    }

    60% {
        filter: drop-shadow(0 -8px 15px rgba(255, 230, 0, 0.8)) drop-shadow(0 -15px 30px rgba(255, 170, 0, 0.55));
    }

    80% {
        filter: drop-shadow(0 -5px 12px rgba(255, 200, 0, 0.7)) drop-shadow(0 -10px 20px rgba(255, 160, 0, 0.45));
    }
}

.text-image-paragraph__image-image[src*="logo-big-white.svg"] {
    animation: logoFireGlow 4s infinite linear;
    will-change: filter;
}