/**
 * SantaTheme Scroll Animations
 *
 * Reusable scroll-triggered animations for pages and posts.
 * Add the appropriate class to any element to enable scroll animations.
 * Elements start hidden and animate in when they enter the viewport.
 *
 * 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 santa-shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes santa-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(205, 40, 40, 0.3); }
    50% { box-shadow: 0 0 40px rgba(205, 40, 40, 0.6); }
}

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

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

@keyframes santa-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

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

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

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

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

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

/* Base: Fade In Up (default) */
.scroll-animate {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s 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.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Scale In */
.scroll-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s 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(-40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s 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(40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s 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
   Using CSS custom properties for flexibility
   ========================================================================== */

[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; }

/* ==========================================================================
   Reusable Component Styles
   ========================================================================== */

/* Decorative Divider */
.santa-divider {
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--color-red, #cd2828), transparent);
    margin: 0 auto 50px;
    position: relative;
}

.santa-divider::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #ffd700, transparent);
    opacity: 0.5;
}

/* Glass Card Base */
.glass-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 40px 30px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(205, 40, 40, 0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.glass-card:hover {
    transform: translateY(-8px);
    border-color: rgba(205, 40, 40, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.glass-card:hover::before {
    opacity: 1;
}

/* Number Badge */
.number-badge {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--color-red, #cd2828) 0%, #8b1a1a 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: white;
    font-size: 2em;
    font-weight: 700;
    position: relative;
    box-shadow: 0 10px 30px rgba(205, 40, 40, 0.4);
    animation: santa-glow 3s ease-in-out infinite;
}

/* Feature Icon */
.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(205, 40, 40, 0.2) 0%, rgba(255, 215, 0, 0.1) 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2.5em;
    transition: all 0.3s ease;
}

.feature-icon:hover,
.glass-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 10px 30px rgba(205, 40, 40, 0.3);
}

/* Info Card */
.info-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 24px 28px;
    transition: all 0.3s ease;
}

.info-card:hover {
    background: linear-gradient(145deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.04) 100%);
    border-color: rgba(205, 40, 40, 0.3);
    transform: translateX(8px);
}

/* FAQ Item */
.faq-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 28px 32px;
    transition: all 0.3s ease;
}

.faq-card:hover {
    background: linear-gradient(145deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
    border-color: rgba(205, 40, 40, 0.2);
    transform: translateY(-4px);
}

/* CTA Box */
.cta-box {
    background: linear-gradient(135deg, rgba(205, 40, 40, 0.2) 0%, rgba(139, 26, 26, 0.1) 100%);
    border: 2px solid rgba(205, 40, 40, 0.3);
    border-radius: 24px;
    padding: 60px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

/* CTA Button with Sweep Effect */
.cta-button {
    display: inline-block;
    background: linear-gradient(135deg, var(--color-red, #cd2828) 0%, #8b1a1a 100%);
    color: white;
    padding: 18px 48px;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    font-size: 1.15em;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.cta-button:hover {
    transform: translateY(-4px);
    color: white;
}

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

/* ==========================================================================
   Color Utilities
   ========================================================================== */

.text-red { color: var(--color-red, #cd2828); }
.text-gold { color: #ffd700; }
.text-muted { color: rgba(255,255,255,0.7); }
.text-subtle { color: rgba(255,255,255,0.5); }

/* ==========================================================================
   Grid Layouts
   ========================================================================== */

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
}

@media (max-width: 768px) {
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .glass-card,
    .cta-box {
        padding: 30px 24px;
    }

    .info-card,
    .faq-card {
        padding: 20px 24px;
    }
}

/* ==========================================================================
   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-glow,
    .animate-pulse,
    .animate-float,
    .number-badge {
        animation: none;
    }
}
