/* ============================================================
   TechGiveaway - Animations & Micro-interactions
   ============================================================ */

/* Hero glow animation */
@keyframes heroGlow {

    0%,
    100% {
        transform: rotate(0deg);
    }

    50% {
        transform: rotate(180deg);
    }
}

/* CTA Pulse */
@keyframes pulse {
    0% {
        box-shadow: 0 0 30px rgba(245, 158, 11, 0.4), 0 4px 15px rgba(0, 0, 0, 0.2);
    }

    50% {
        box-shadow: 0 0 50px rgba(245, 158, 11, 0.6), 0 4px 15px rgba(0, 0, 0, 0.2);
    }

    100% {
        box-shadow: 0 0 30px rgba(245, 158, 11, 0.4), 0 4px 15px rgba(0, 0, 0, 0.2);
    }
}

.hero__cta {
    animation: pulse 2.5s ease-in-out infinite;
}

/* Countdown number flip */
@keyframes countFlip {
    0% {
        transform: scaleY(1);
    }

    50% {
        transform: scaleY(0.8);
    }

    100% {
        transform: scaleY(1);
    }
}

.countdown__number.flip {
    animation: countFlip 0.3s ease-out;
}

/* Badge shimmer */
@keyframes shimmer {
    0% {
        background-position: -200% center;
    }

    100% {
        background-position: 200% center;
    }
}

.badge {
    background-size: 200% auto;
    animation: shimmer 3s linear infinite;
}

/* Fade in on scroll */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

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

.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Content sections + Phone cards section: always visible, never affected by animate-on-scroll */
.content-sections,
.content-sections *,
.phones-section,
.phones-section * {
    opacity: 1 !important;
    visibility: visible !important;
}
.content-sections .animate-on-scroll,
.phones-section .animate-on-scroll {
    opacity: 1 !important;
}

/* Phone card hover glow - do not block clicks on CTA */
.phone-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    opacity: 0;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
    transition: opacity 0.3s;
    pointer-events: none;
}

.phone-card:hover::after {
    opacity: 1;
}

/* CTA button ripple */
.phone-card__cta {
    position: relative;
    overflow: hidden;
}

.phone-card__cta::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: -100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.phone-card__cta:hover::after {
    left: 100%;
}

/* Trust badge hover */
.trust-badge {
    transition: transform 0.2s, background 0.2s;
}

.trust-badge:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.25);
}

/* Loading spinner */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Smooth link transitions */
.footer-links a,
.nav-menu a {
    transition: color 0.2s, background 0.2s;
}

/* Cookie banner slide up */
@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.cookie-banner {
    animation: slideUp 0.5s ease-out;
}

/* Subscribe success checkmark */
@keyframes checkBounce {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

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

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {

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

    html {
        scroll-behavior: auto;
    }
}