/**
 * LeprechaunTheme Scroll Animations - Light Theme
 *
 * Reusable scroll-triggered animations for pages and posts.
 * Modern light theme with emerald green and gold accents.
 *
 * Usage:
 *   - Add class "scroll-animate" for basic fade-in-up
 *   - Add class "scroll-fade" for simple fade
 *   - Add class "scroll-scale" for scale-in effect
 *   - Add class "scroll-slide-left" for slide from left
 *   - Add class "scroll-slide-right" for slide from right
 *   - Add data-delay="0.1" to add delay (in seconds)
 *   - Add data-stagger="true" to parent to auto-stagger children
 */

/* ==========================================================================
   Keyframe Animations
   ========================================================================== */

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes glow-green {
    0%, 100% { box-shadow: 0 0 20px rgba(13, 242, 89, 0.3); }
    50% { box-shadow: 0 0 40px rgba(13, 242, 89, 0.5); }
}

@keyframes glow-gold {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.3); }
    50% { box-shadow: 0 0 40px rgba(255, 215, 0, 0.5); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ==========================================================================
   Animation Utility Classes (Always Active)
   ========================================================================== */

.animate-shimmer {
    background: linear-gradient(135deg, #ffffff 0%, var(--color-gold, #FFD700) 50%, #ffffff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
    background-size: 200% auto;
}

.animate-shimmer-green {
    background: linear-gradient(135deg, var(--color-primary, #0df259) 0%, var(--color-gold, #FFD700) 50%, var(--color-primary, #0df259) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
    background-size: 200% auto;
}

.animate-glow {
    animation: glow-green 3s ease-in-out infinite;
}

.animate-glow-gold {
    animation: glow-gold 3s ease-in-out infinite;
}

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

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

/* ==========================================================================
   Scroll-Triggered Animations - Base States
   ========================================================================== */

/* Base: Fade In Up (default) */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-animate.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Simple Fade */
.scroll-fade {
    opacity: 0;
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-fade.is-visible {
    opacity: 1;
}

/* Scale In */
.scroll-scale {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-scale.is-visible {
    opacity: 1;
    transform: scale(1);
}

/* Slide from Left */
.scroll-slide-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-slide-left.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Slide from Right */
.scroll-slide-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-slide-right.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Divider Scale Effect */
.scroll-divider {
    opacity: 0;
    transform: scaleX(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-divider.is-visible {
    opacity: 1;
    transform: scaleX(1);
}

/* ==========================================================================
   Staggered Delays
   ========================================================================== */

[data-delay="0.1"] { transition-delay: 0.1s !important; }
[data-delay="0.2"] { transition-delay: 0.2s !important; }
[data-delay="0.3"] { transition-delay: 0.3s !important; }
[data-delay="0.4"] { transition-delay: 0.4s !important; }
[data-delay="0.5"] { transition-delay: 0.5s !important; }
[data-delay="0.6"] { transition-delay: 0.6s !important; }
[data-delay="0.7"] { transition-delay: 0.7s !important; }
[data-delay="0.8"] { transition-delay: 0.8s !important; }

/* Child stagger delays (when parent has data-stagger) */
[data-stagger] > *:nth-child(1) { transition-delay: 0.1s; }
[data-stagger] > *:nth-child(2) { transition-delay: 0.2s; }
[data-stagger] > *:nth-child(3) { transition-delay: 0.3s; }
[data-stagger] > *:nth-child(4) { transition-delay: 0.4s; }
[data-stagger] > *:nth-child(5) { transition-delay: 0.5s; }
[data-stagger] > *:nth-child(6) { transition-delay: 0.6s; }

/* ==========================================================================
   Page-Specific Styles - Light Theme
   ========================================================================== */

/* How It Works Page Container */
.hiw-page {
    color: var(--color-text-dark, #111813);
    padding: 60px 20px;
    position: relative;
    overflow: hidden;
}

.hiw-container {
    max-width: var(--container-max, 1280px);
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.hiw-page h1,
.hiw-page h2,
.hiw-page h3,
.hiw-page h4 {
    color: var(--color-text-dark, #111813);
}

.hiw-green {
    color: var(--color-primary, #0df259);
}

.hiw-gold {
    color: var(--color-gold-dark, #DAA520);
}

.hiw-section {
    margin-bottom: 80px;
}

/* Section Title Styles */
.section-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 16px;
    font-weight: 400;
    text-align: center;
}

.section-subtitle {
    text-align: center;
    color: var(--color-text-medium, #4a5548);
    margin-bottom: 40px;
    font-size: 1.05rem;
}

/* ==========================================================================
   CTA Button - Light Theme
   ========================================================================== */

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--color-primary, #0df259);
    color: var(--color-text-dark, #111813);
    padding: 1rem 2rem;
    border-radius: var(--radius-full, 9999px);
    font-weight: 700;
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(13, 242, 89, 0.3);
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.cta-button:hover {
    transform: translateY(-2px);
    color: var(--color-text-dark, #111813);
    box-shadow: 0 0 30px rgba(13, 242, 89, 0.5);
}

.cta-button:hover::before {
    left: 100%;
}

/* Gold variant CTA */
.cta-button.gold {
    background: linear-gradient(135deg, var(--color-gold, #FFD700) 0%, var(--color-gold-dark, #DAA520) 100%);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.cta-button.gold:hover {
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

/* ==========================================================================
   Lucky Badge - Light Theme
   ========================================================================== */

.lucky-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(13, 242, 89, 0.1);
    border: 1px solid rgba(13, 242, 89, 0.3);
    padding: 8px 16px;
    border-radius: var(--radius-full, 9999px);
    font-size: 0.9rem;
    color: var(--color-primary-dark, #0bc248);
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
    .hiw-page {
        padding: 40px 16px;
    }

    .hiw-section {
        margin-bottom: 60px;
    }
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .scroll-animate,
    .scroll-fade,
    .scroll-scale,
    .scroll-slide-left,
    .scroll-slide-right,
    .scroll-divider {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .animate-shimmer,
    .animate-shimmer-green,
    .animate-glow,
    .animate-glow-gold,
    .animate-pulse,
    .animate-float {
        animation: none;
    }
}
