/**
 * WealthFromAI Design Enhancements
 * Advanced animations, effects, and visual upgrades
 *
 * @package WealthFromAI
 * @version 1.1.0
 */

/* ===========================
   1. HERO SECTION ENHANCEMENTS
   =========================== */

/* Hero container with animated background */
.wfai-hero {
    position: relative;
    overflow: hidden;
    min-height: 90vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #0A0F14 0%, #0D2137 50%, #0A0F14 100%);
}

/* Animated gradient orbs */
.wfai-hero::before,
.wfai-hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float-orb 20s ease-in-out infinite;
    pointer-events: none;
}

.wfai-hero::before {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 212, 170, 0.3) 0%, transparent 70%);
    top: -200px;
    right: -100px;
    animation-delay: 0s;
}

.wfai-hero::after {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(201, 169, 98, 0.2) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    animation-delay: -10s;
}

@keyframes float-orb {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -30px) scale(1.1);
    }
    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }
    75% {
        transform: translate(20px, 30px) scale(1.05);
    }
}

/* Animated text gradient for headlines */
.wfai-gradient-text {
    background: linear-gradient(
        135deg,
        #F9FAFB 0%,
        #00D4AA 25%,
        #F9FAFB 50%,
        #C9A962 75%,
        #F9FAFB 100%
    );
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 8s ease infinite;
}

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

/* Static gradient text (no animation) */
.wfai-gradient-text-static {
    background: linear-gradient(135deg, #00D4AA 0%, #C9A962 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hero content parallax wrapper */
.wfai-hero-content {
    position: relative;
    z-index: 2;
}

/* Animated down arrow */
.wfai-scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--wfai-text-muted);
    font-size: var(--wfai-text-sm);
    animation: bounce-subtle 2s ease-in-out infinite;
    cursor: pointer;
    transition: color 0.3s ease;
}

.wfai-scroll-indicator:hover {
    color: var(--wfai-secondary);
}

.wfai-scroll-indicator svg {
    width: 24px;
    height: 24px;
}

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

/* ===========================
   2. ANIMATED STATS COUNTER
   =========================== */

.wfai-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--wfai-space-6);
}

.wfai-stat-card {
    position: relative;
    background: var(--wfai-glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--wfai-glass-border);
    border-radius: var(--wfai-radius-xl);
    padding: var(--wfai-space-8);
    text-align: center;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.wfai-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--wfai-secondary), var(--wfai-accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.wfai-stat-card:hover {
    border-color: rgba(0, 212, 170, 0.3);
    transform: translateY(-8px);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(0, 212, 170, 0.1);
}

.wfai-stat-card:hover::before {
    transform: scaleX(1);
}

.wfai-stat-number {
    font-family: var(--wfai-font-data);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1;
    color: var(--wfai-secondary);
    margin-bottom: var(--wfai-space-2);
}

.wfai-stat-number.gold {
    color: var(--wfai-accent);
}

.wfai-stat-number .suffix {
    font-size: 0.6em;
    opacity: 0.8;
}

.wfai-stat-label {
    font-size: var(--wfai-text-sm);
    color: var(--wfai-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Counter animation state */
.wfai-stat-number[data-count] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.wfai-stat-number[data-count].counted {
    opacity: 1;
    transform: translateY(0);
}

/* ===========================
   3. FLOATING PARTICLES BACKGROUND
   =========================== */

.wfai-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.wfai-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--wfai-secondary);
    border-radius: 50%;
    opacity: 0.3;
    animation: particle-float linear infinite;
}

.wfai-particle:nth-child(odd) {
    background: var(--wfai-accent);
}

.wfai-particle:nth-child(1) { left: 10%; animation-duration: 25s; animation-delay: 0s; width: 3px; height: 3px; }
.wfai-particle:nth-child(2) { left: 20%; animation-duration: 20s; animation-delay: -5s; width: 5px; height: 5px; }
.wfai-particle:nth-child(3) { left: 30%; animation-duration: 28s; animation-delay: -10s; width: 4px; height: 4px; }
.wfai-particle:nth-child(4) { left: 40%; animation-duration: 22s; animation-delay: -15s; width: 6px; height: 6px; }
.wfai-particle:nth-child(5) { left: 50%; animation-duration: 30s; animation-delay: -2s; width: 3px; height: 3px; }
.wfai-particle:nth-child(6) { left: 60%; animation-duration: 24s; animation-delay: -8s; width: 5px; height: 5px; }
.wfai-particle:nth-child(7) { left: 70%; animation-duration: 26s; animation-delay: -12s; width: 4px; height: 4px; }
.wfai-particle:nth-child(8) { left: 80%; animation-duration: 21s; animation-delay: -18s; width: 6px; height: 6px; }
.wfai-particle:nth-child(9) { left: 90%; animation-duration: 27s; animation-delay: -4s; width: 3px; height: 3px; }
.wfai-particle:nth-child(10) { left: 15%; animation-duration: 23s; animation-delay: -7s; width: 5px; height: 5px; }
.wfai-particle:nth-child(11) { left: 35%; animation-duration: 29s; animation-delay: -14s; width: 4px; height: 4px; }
.wfai-particle:nth-child(12) { left: 55%; animation-duration: 19s; animation-delay: -20s; width: 6px; height: 6px; }
.wfai-particle:nth-child(13) { left: 75%; animation-duration: 31s; animation-delay: -3s; width: 3px; height: 3px; }
.wfai-particle:nth-child(14) { left: 85%; animation-duration: 25s; animation-delay: -11s; width: 5px; height: 5px; }
.wfai-particle:nth-child(15) { left: 5%; animation-duration: 28s; animation-delay: -16s; width: 4px; height: 4px; }

@keyframes particle-float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-100px) rotate(720deg);
        opacity: 0;
    }
}

/* Glow orbs that float slowly */
.wfai-glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
    animation: orb-drift 30s ease-in-out infinite;
}

.wfai-glow-orb-1 {
    width: 300px;
    height: 300px;
    background: rgba(0, 212, 170, 0.15);
    top: 20%;
    right: 10%;
}

.wfai-glow-orb-2 {
    width: 250px;
    height: 250px;
    background: rgba(201, 169, 98, 0.1);
    bottom: 30%;
    left: 5%;
    animation-delay: -15s;
}

.wfai-glow-orb-3 {
    width: 200px;
    height: 200px;
    background: rgba(0, 212, 170, 0.1);
    top: 60%;
    right: 30%;
    animation-delay: -7s;
}

@keyframes orb-drift {
    0%, 100% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(50px, -30px);
    }
    50% {
        transform: translate(-30px, 50px);
    }
    75% {
        transform: translate(30px, 30px);
    }
}

/* ===========================
   4. ENHANCED CTA SECTIONS
   =========================== */

.wfai-cta-section {
    position: relative;
    padding: var(--wfai-space-16) 0;
    overflow: hidden;
}

.wfai-cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(13, 33, 55, 0.95) 0%,
        rgba(10, 15, 20, 0.98) 100%
    );
    z-index: 0;
}

/* Animated gradient border card */
.wfai-cta-card {
    position: relative;
    background: var(--wfai-card);
    border-radius: var(--wfai-radius-2xl);
    padding: var(--wfai-space-12);
    text-align: center;
    overflow: hidden;
    z-index: 1;
}

.wfai-cta-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--wfai-radius-2xl);
    padding: 2px;
    background: linear-gradient(
        135deg,
        var(--wfai-secondary) 0%,
        var(--wfai-accent) 50%,
        var(--wfai-secondary) 100%
    );
    background-size: 200% 200%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: gradient-rotate 4s linear infinite;
    pointer-events: none;
}

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

/* Pulsing CTA button */
.wfai-btn-pulse {
    position: relative;
    animation: none;
}

.wfai-btn-pulse::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    background: inherit;
    opacity: 0;
    z-index: -1;
    animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 0.4;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* Glowing button on hover */
.wfai-btn-glow {
    transition: all 0.3s ease;
}

.wfai-btn-glow:hover {
    box-shadow:
        0 0 20px rgba(0, 212, 170, 0.5),
        0 0 40px rgba(0, 212, 170, 0.3),
        0 0 60px rgba(0, 212, 170, 0.1);
}

.wfai-btn-glow.gold:hover {
    box-shadow:
        0 0 20px rgba(201, 169, 98, 0.5),
        0 0 40px rgba(201, 169, 98, 0.3),
        0 0 60px rgba(201, 169, 98, 0.1);
}

/* ===========================
   5. SCROLL-TRIGGERED ANIMATIONS
   =========================== */

/* Base states for animated elements */
[data-animate] {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate="fade-up"] {
    transform: translateY(40px);
}

[data-animate="fade-down"] {
    transform: translateY(-40px);
}

[data-animate="fade-left"] {
    transform: translateX(40px);
}

[data-animate="fade-right"] {
    transform: translateX(-40px);
}

[data-animate="zoom-in"] {
    transform: scale(0.9);
}

[data-animate="zoom-out"] {
    transform: scale(1.1);
}

[data-animate="flip-up"] {
    transform: perspective(1000px) rotateX(10deg);
    transform-origin: bottom;
}

/* Animated state */
[data-animate].animated {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1) rotateX(0);
}

/* Staggered delays for lists */
[data-animate-delay="100"] { transition-delay: 0.1s; }
[data-animate-delay="200"] { transition-delay: 0.2s; }
[data-animate-delay="300"] { transition-delay: 0.3s; }
[data-animate-delay="400"] { transition-delay: 0.4s; }
[data-animate-delay="500"] { transition-delay: 0.5s; }
[data-animate-delay="600"] { transition-delay: 0.6s; }
[data-animate-delay="700"] { transition-delay: 0.7s; }
[data-animate-delay="800"] { transition-delay: 0.8s; }

/* Container for staggered children */
.wfai-stagger-container [data-animate] {
    transition-delay: calc(var(--stagger-index, 0) * 0.1s);
}

/* ===========================
   6. BLOG CARD HOVER EFFECTS
   =========================== */

/* 3D Tilt Card */
.wfai-card-tilt {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.wfai-card-tilt:hover {
    transform: perspective(1000px) rotateX(var(--rotate-x, 0deg)) rotateY(var(--rotate-y, 0deg));
}

.wfai-card-tilt .card-content {
    transform: translateZ(30px);
    transition: transform 0.3s ease;
}

/* Enhanced post card */
.wfai-post-card-enhanced {
    position: relative;
    background: var(--wfai-card);
    border: 1px solid var(--wfai-border);
    border-radius: var(--wfai-radius-xl);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.wfai-post-card-enhanced::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 212, 170, 0.1) 0%,
        transparent 50%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 1;
}

.wfai-post-card-enhanced:hover {
    border-color: rgba(0, 212, 170, 0.3);
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(0, 212, 170, 0.1);
}

.wfai-post-card-enhanced:hover::before {
    opacity: 1;
}

/* Image container with overlay */
.wfai-post-card-enhanced .card-image {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.wfai-post-card-enhanced .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.wfai-post-card-enhanced:hover .card-image img {
    transform: scale(1.1);
}

.wfai-post-card-enhanced .card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(10, 15, 20, 0.8) 0%,
        transparent 50%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
}

.wfai-post-card-enhanced:hover .card-image::after {
    opacity: 1;
}

/* Category badge float effect */
.wfai-post-card-enhanced .card-category {
    position: absolute;
    top: var(--wfai-space-4);
    left: var(--wfai-space-4);
    z-index: 2;
    transition: transform 0.3s ease;
}

.wfai-post-card-enhanced:hover .card-category {
    transform: translateY(-4px);
}

/* Read more arrow animation */
.wfai-read-more {
    display: inline-flex;
    align-items: center;
    gap: var(--wfai-space-2);
    color: var(--wfai-secondary);
    font-weight: var(--wfai-font-semibold);
    transition: all 0.3s ease;
}

.wfai-read-more svg,
.wfai-read-more .arrow {
    transition: transform 0.3s ease;
}

.wfai-read-more:hover {
    gap: var(--wfai-space-3);
}

.wfai-read-more:hover svg,
.wfai-read-more:hover .arrow {
    transform: translateX(4px);
}

/* ===========================
   7. ADDITIONAL MICRO-INTERACTIONS
   =========================== */

/* Link underline animation */
.wfai-link-animated {
    position: relative;
    text-decoration: none;
}

.wfai-link-animated::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--wfai-secondary);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.wfai-link-animated:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Icon hover spin */
.wfai-icon-spin {
    transition: transform 0.4s ease;
}

.wfai-icon-spin:hover {
    transform: rotate(360deg);
}

/* Magnetic button effect (requires JS) */
.wfai-btn-magnetic {
    transition: transform 0.2s ease;
}

/* Shimmer loading effect */
.wfai-shimmer {
    position: relative;
    overflow: hidden;
}

.wfai-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* ===========================
   8. SECTION DIVIDERS
   =========================== */

.wfai-section-divider {
    position: relative;
    height: 1px;
    background: var(--wfai-border);
    margin: var(--wfai-space-16) 0;
    overflow: visible;
}

.wfai-section-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--wfai-secondary) 50%,
        transparent 100%
    );
}

.wfai-section-divider.gold::before {
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--wfai-accent) 50%,
        transparent 100%
    );
}

/* Diamond divider */
.wfai-section-divider-diamond {
    position: relative;
    height: 20px;
    margin: var(--wfai-space-16) 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wfai-section-divider-diamond::before,
.wfai-section-divider-diamond::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--wfai-border) 100%
    );
}

.wfai-section-divider-diamond::after {
    background: linear-gradient(
        90deg,
        var(--wfai-border) 0%,
        transparent 100%
    );
}

.wfai-section-divider-diamond span {
    width: 12px;
    height: 12px;
    background: var(--wfai-secondary);
    transform: rotate(45deg);
    margin: 0 var(--wfai-space-4);
    flex-shrink: 0;
}

/* ===========================
   9. RESPONSIVE ADJUSTMENTS
   =========================== */

@media (max-width: 767px) {
    .wfai-hero {
        min-height: 80vh;
    }

    .wfai-hero::before,
    .wfai-hero::after {
        filter: blur(60px);
    }

    .wfai-hero::before {
        width: 300px;
        height: 300px;
    }

    .wfai-hero::after {
        width: 200px;
        height: 200px;
    }

    .wfai-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--wfai-space-4);
    }

    .wfai-stat-card {
        padding: var(--wfai-space-6);
    }

    .wfai-stat-number {
        font-size: 2rem;
    }

    .wfai-cta-card {
        padding: var(--wfai-space-8);
    }

    .wfai-glow-orb {
        display: none;
    }

    .wfai-particle {
        opacity: 0.2;
    }

    /* Reduce animations on mobile for performance */
    [data-animate] {
        transition-duration: 0.4s;
    }

    .wfai-post-card-enhanced:hover {
        transform: translateY(-4px);
    }
}

@media (max-width: 480px) {
    .wfai-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    [data-animate] {
        opacity: 1;
        transform: none;
    }
}
