/**
 * Features Page Styles
 * Custom animations and styles for the public /features product page
 */

/* ============================================================================
   HERO SECTION - Animated Gradient Background
   ============================================================================ */

.hero-gradient {
    background: linear-gradient(135deg,
        #0f172a 0%,
        #1e3a5f 25%,
        #1e293b 50%,
        #1e3a5f 75%,
        #0f172a 100%);
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
}

.dark .hero-gradient {
    background: linear-gradient(135deg,
        #020617 0%,
        #0c1929 25%,
        #0f172a 50%,
        #0c1929 75%,
        #020617 100%);
    background-size: 400% 400%;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Mesh overlay for hero */
.hero-mesh {
    background-image:
        radial-gradient(at 40% 20%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 80% 0%, rgba(6, 182, 212, 0.1) 0px, transparent 50%),
        radial-gradient(at 0% 50%, rgba(139, 92, 246, 0.1) 0px, transparent 50%),
        radial-gradient(at 80% 50%, rgba(59, 130, 246, 0.1) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(6, 182, 212, 0.1) 0px, transparent 50%);
}

/* ============================================================================
   FLOATING ANIMATIONS
   ============================================================================ */

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

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

/* ============================================================================
   PULSE GLOW ANIMATIONS
   ============================================================================ */

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 5px currentColor;
        opacity: 1;
    }
    50% {
        box-shadow: 0 0 20px currentColor, 0 0 30px currentColor;
        opacity: 0.8;
    }
}

/* Live indicator dot */
.live-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse-glow 2s ease-in-out infinite;
    color: #22c55e;
}

/* ============================================================================
   FEATURE CARDS
   ============================================================================ */

.feature-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border-color: rgba(59, 130, 246, 0.3);
}

.dark .feature-card {
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(255, 255, 255, 0.05);
}

.dark .feature-card:hover {
    border-color: rgba(59, 130, 246, 0.4);
}

/* Light mode feature cards */
:root:not(.dark) .feature-card {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.1);
}

:root:not(.dark) .feature-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* ============================================================================
   GRADIENT TEXT
   ============================================================================ */

.gradient-text {
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 50%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================================================
   SECTION DIVIDERS
   ============================================================================ */

.section-divider {
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(59, 130, 246, 0.3) 20%,
        rgba(59, 130, 246, 0.5) 50%,
        rgba(59, 130, 246, 0.3) 80%,
        transparent 100%);
}

/* ============================================================================
   STEP INDICATORS
   ============================================================================ */

.step-number {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

/* ============================================================================
   CTA BUTTON STYLES
   ============================================================================ */

.cta-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #1d4ed8 100%);
    color: white;
    font-weight: 700;
    font-size: 1.125rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.cta-primary:active {
    transform: translateY(0);
}

/* ============================================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================================ */

@media (max-width: 768px) {
    .feature-card {
        padding: 1.5rem;
    }
}

/* ============================================================================
   SCROLL ANIMATION SYSTEM
   ============================================================================ */

/* Base state for animated elements */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    /* Hint browser to optimize for upcoming animation - prevents CLS */
    will-change: opacity, transform;
}

/* Animated state when in view */
.scroll-animate.animate-in {
    opacity: 1;
    transform: translateY(0);
    /* Remove will-change after animation completes to free GPU memory */
    will-change: auto;
}

/* Staggered animation delays for child elements */
.scroll-animate-stagger > *:nth-child(1) { transition-delay: 0ms; }
.scroll-animate-stagger > *:nth-child(2) { transition-delay: 100ms; }
.scroll-animate-stagger > *:nth-child(3) { transition-delay: 200ms; }
.scroll-animate-stagger > *:nth-child(4) { transition-delay: 300ms; }

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .hero-gradient,
    .animate-float,
    .live-dot {
        animation: none;
    }

    .scroll-animate,
    .scroll-animate.animate-in,
    .feature-card:hover,
    .cta-primary,
    .cta-primary:hover {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ============================================================================
   SECURITY BADGES
   ============================================================================ */

.security-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 9999px;
    color: #22c55e;
    font-size: 0.875rem;
    font-weight: 500;
}

.dark .security-badge {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
}

/* ============================================================================
   ICON CONTAINERS
   ============================================================================ */

.icon-container {
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
}

.icon-container svg {
    width: 1.75rem;
    height: 1.75rem;
    color: #3b82f6;
}

.dark .icon-container svg {
    color: #60a5fa;
}
