/* Enhanced How It Works Section Styles */

/* Advanced step card animations */
@keyframes stepReveal {
    0% {
        opacity: 0;
        transform: translateY(60px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-8px) rotate(2deg);
    }
    50% {
        transform: translateY(-4px) rotate(0deg);
    }
    75% {
        transform: translateY(-12px) rotate(-2deg);
    }
}

@keyframes connectionFlow {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4),
                    0 10px 25px -5px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 0 0 20px rgba(79, 70, 229, 0),
                    0 20px 40px -10px rgba(0, 0, 0, 0.15);
    }
}

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

@keyframes progressBar {
    0% {
        width: 0%;
        opacity: 0;
    }
    100% {
        width: 100%;
        opacity: 1;
    }
}

/* Enhanced floating elements */
.how-it-works-floating {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.how-it-works-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    border-radius: 50%;
    animation: iconFloat 6s ease-in-out infinite;
}

.how-it-works-particle:nth-child(1) {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
    animation-duration: 8s;
}

.how-it-works-particle:nth-child(2) {
    top: 60%;
    right: 15%;
    animation-delay: -2s;
    animation-duration: 6s;
}

.how-it-works-particle:nth-child(3) {
    bottom: 30%;
    left: 20%;
    animation-delay: -4s;
    animation-duration: 10s;
}

.how-it-works-particle:nth-child(4) {
    top: 40%;
    right: 25%;
    animation-delay: -1s;
    animation-duration: 7s;
}

/* Enhanced step cards */
.hiw-step-card {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 3rem 2rem 2rem;
    margin-top: 32px;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: stepReveal 0.8s ease-out;
}

.hiw-step-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #3b82f6, #8b5cf6);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.hiw-step-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.4) 50%, 
        transparent 100%);
    transition: left 0.8s ease;
}

.hiw-step-card:hover::before {
    opacity: 1;
}

.hiw-step-card:hover::after {
    left: 100%;
}

.hiw-step-card:hover {
    transform: translateY(-16px) scale(1.03);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
}

/* Enhanced step numbers */
.hiw-step-number {
    position: absolute;
    top: -20px;
    left: 2rem;
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: white;
    transition: all 0.4s ease;
    z-index: 15;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border: 3px solid white;
}

.hiw-step-number.step-1 {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

.hiw-step-number.step-2 {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.hiw-step-number.step-3 {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.hiw-step-card:hover .hiw-step-number {
    transform: scale(1.2) rotate(5deg);
    animation: numberPulse 2s ease-in-out infinite;
}

/* Enhanced step icons */
.hiw-step-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    transition: all 0.4s ease;
    display: inline-block;
    position: relative;
}

.hiw-step-icon.icon-1 {
    color: #6366f1;
}

.hiw-step-icon.icon-2 {
    color: #3b82f6;
}

.hiw-step-icon.icon-3 {
    color: #8b5cf6;
}

.hiw-step-card:hover .hiw-step-icon {
    animation: iconFloat 3s ease-in-out infinite;
    transform: scale(1.1);
}

/* Enhanced connection line */
.hiw-connection-line {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, 
        rgba(99, 102, 241, 0.2) 0%, 
        rgba(59, 130, 246, 0.4) 50%, 
        rgba(139, 92, 246, 0.2) 100%);
    transform: translateY(-50%);
    z-index: 0;
    overflow: hidden;
}

.hiw-connection-line::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 20%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(99, 102, 241, 0.8) 50%, 
        transparent 100%);
    animation: connectionFlow 3s ease-in-out infinite;
}

/* Progress indicators */
.hiw-progress-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
}

.hiw-progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e5e7eb;
    transition: all 0.3s ease;
    position: relative;
}

.hiw-progress-dot.active {
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    transform: scale(1.2);
}

.hiw-progress-dot.active::after {
    content: '';
    position: absolute;
    inset: -4px;
    border: 2px solid rgba(99, 102, 241, 0.3);
    border-radius: 50%;
    animation: pulseGlow 2s ease-in-out infinite;
}

/* Enhanced feature lists */
.hiw-feature-list {
    list-style: none;
    padding: 0;
    margin-top: 1.5rem;
}

.hiw-feature-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.3s ease;
}

.hiw-step-card:hover .hiw-feature-item {
    opacity: 1;
    transform: translateX(0);
}

.hiw-feature-item:nth-child(1) { transition-delay: 0.1s; }
.hiw-feature-item:nth-child(2) { transition-delay: 0.2s; }
.hiw-feature-item:nth-child(3) { transition-delay: 0.3s; }

.hiw-feature-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    margin-top: 0.125rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.hiw-feature-item:hover .hiw-feature-icon {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.hiw-feature-text {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
}

/* Enhanced CTA button */
.hiw-cta-container {
    text-align: center;
    margin-top: 4rem;
}

.hiw-cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
    color: white;
    font-weight: 600;
    border-radius: 16px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
}

.hiw-cta-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    transition: all 0.6s ease;
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

.hiw-cta-button:hover::before {
    width: 300px;
    height: 300px;
}

.hiw-cta-button:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.4);
}

.hiw-play-icon {
    margin-left: 0.75rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.hiw-cta-button:hover .hiw-play-icon {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Timeline enhancement */
.hiw-timeline {
    position: relative;
    padding: 2rem 0;
}

.hiw-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, 
        rgba(99, 102, 241, 0.2) 0%, 
        rgba(59, 130, 246, 0.4) 50%, 
        rgba(139, 92, 246, 0.2) 100%);
    transform: translateX(-50%);
    z-index: 0;
}

/* Responsive design */
@media (max-width: 768px) {
    .hiw-step-card {
        margin-bottom: 3rem;
        margin-top: 40px;
        padding: 2.5rem 1.5rem 1.5rem;
    }
    
    .hiw-step-number {
        left: 50%;
        top: -22px;
        transform: translateX(-50%);
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }
    
    .hiw-connection-line {
        display: none;
    }
    
    .hiw-step-icon {
        font-size: 2.5rem;
    }
    
    .hiw-timeline::before {
        left: 1rem;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .hiw-step-card,
    .hiw-step-icon,
    .hiw-step-number,
    .how-it-works-particle {
        animation: none;
        transition: none;
    }
    
    .hiw-step-card:hover {
        transform: none;
    }
    
    .hiw-connection-line::before {
        animation: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .hiw-step-card {
        background: rgba(31, 41, 55, 0.95);
        border-color: rgba(75, 85, 99, 0.3);
        color: #f9fafb;
    }
    
    .hiw-feature-text {
        color: #d1d5db;
    }
}

/* Loading states */
.hiw-loading {
    opacity: 0;
    animation: stepReveal 0.8s ease-out forwards;
}

.hiw-loading:nth-child(1) { animation-delay: 0.1s; }
.hiw-loading:nth-child(2) { animation-delay: 0.3s; }
.hiw-loading:nth-child(3) { animation-delay: 0.5s; }

/* Performance optimizations */
.hiw-step-card,
.hiw-step-number,
.hiw-step-icon {
    will-change: transform, box-shadow;
    transform: translateZ(0);
    backface-visibility: hidden;
}
