/* ============================================
   How It Works Section - Zencia.AI
   Exact Match to Visual Design
   ============================================ */

/* ===== HOW IT WORKS SECTION CONTAINER ===== */
.how-it-works-section {
    position: relative;
    min-height: 100vh;
    background: linear-gradient(135deg, #0a0e13 0%, #1a1a1a 100%);
    overflow: hidden;
    padding: 120px 0 80px;
}

/* Animated gradient overlay */
.how-it-works-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 80%, rgba(0, 217, 213, 0.06) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(0, 139, 139, 0.06) 0%, transparent 50%);
    animation: gradientShift 25s ease-in-out infinite;
    z-index: 1;
    pointer-events: none;
}

@keyframes gradientShift {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(30px, -20px) scale(1.05);
        opacity: 0.8;
    }
}

.how-it-works-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 10;
}

/* ===== SECTION HEADER ===== */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
    animation: fadeInUp 1s ease-out;
}

.section-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-teal);
    color: var(--white);
    border-radius: 25px;
    padding: 0.6rem 1.2rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    transition: all var(--transition-base);
    box-shadow: 0 5px 20px rgba(0, 217, 213, 0.3);
}

.section-badge:hover {
    background: var(--accent-turquoise);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 217, 213, 0.4);
}

.section-badge i {
    font-size: 1rem;
}

.section-title {
    font-size: clamp(2.2rem, 4vw, 3.5rem);
    font-weight: 900;
    color: var(--white);
    margin-bottom: 1rem;
    line-height: 1.2;
    letter-spacing: -1px;
}

.highlight-text {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-teal) 0%, #9c40ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: glow 3s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.3);
    }
}

/* ===== TIMELINE CONTAINER ===== */
.works-timeline {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4rem;
    max-width: 1000px;
    margin: 0 auto;
}

/* Central timeline line */
.works-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 3px;
    height: 100%;
    background: linear-gradient(
        180deg,
        transparent 0%,
        var(--primary-teal) 10%,
        var(--primary-teal) 90%,
        transparent 100%
    );
    transform: translateX(-50%);
    z-index: 1;
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(0, 217, 213, 0.5);
}

/* ===== TIMELINE STEPS ===== */
.timeline-step {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 4rem;
    opacity: 0;
    transform: translateY(50px);
    animation: slideInUp 0.8s ease forwards;
}

.timeline-step:nth-child(1) { animation-delay: 0.2s; }
.timeline-step:nth-child(2) { animation-delay: 0.4s; }
.timeline-step:nth-child(3) { animation-delay: 0.6s; }
.timeline-step:nth-child(4) { animation-delay: 0.8s; }

@keyframes slideInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Default layout - odd steps (1, 3) - content on left, image on right */
.timeline-step:nth-child(odd) {
    justify-content: flex-start;
}

.timeline-step:nth-child(odd) .step-content {
    width: 45%;
    margin-right: 5%;
}

.timeline-step:nth-child(odd) .step-visual {
    width: 45%;
    margin-left: 5%;
}

/* Even steps (2, 4) - content on right, image on left */
.timeline-step:nth-child(even) {
    justify-content: flex-end;
    flex-direction: row-reverse;
}

.timeline-step:nth-child(even) .step-content {
    width: 45%;
    margin-left: 5%;
    text-align: right;
}

.timeline-step:nth-child(even) .step-visual {
    width: 45%;
    margin-right: 5%;
}

.timeline-step:nth-child(even) .step-icon {
    margin-left: auto;
}

/* ===== STEP NUMBER ===== */
.step-number {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    width: 50px;
    height: 50px;
    background: #1a1a1a;
    border: 3px solid var(--primary-teal);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary-teal);
    transition: all var(--transition-base);
    box-shadow: 
        0 0 0 0 rgba(0, 217, 213, 0.4),
        0 5px 20px rgba(0, 217, 213, 0.3);
    animation: pulse 3s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 
            0 0 0 0 rgba(0, 217, 213, 0.4),
            0 5px 20px rgba(0, 217, 213, 0.3);
    }
    50% {
        box-shadow: 
            0 0 0 10px rgba(0, 217, 213, 0),
            0 5px 20px rgba(0, 217, 213, 0.4);
    }
}

.timeline-step:hover .step-number {
    transform: scale(1.1);
    background: var(--primary-teal);
    color: var(--white);
    border-color: var(--accent-turquoise);
}

/* ===== STEP CONTENT ===== */
.step-content {
    padding: 2rem;
    background: rgba(0, 217, 213, 0.03);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(0, 217, 213, 0.1);
    border-radius: 15px;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.step-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 217, 213, 0.08), transparent);
    transition: left 0.6s ease;
    pointer-events: none;
}

.step-content:hover::before {
    left: 100%;
}

.step-content:hover {
    background: rgba(0, 217, 213, 0.08);
    border-color: rgba(0, 217, 213, 0.3);
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 217, 213, 0.2);
}

/* ===== STEP ICON ===== */
.step-icon {
    width: 50px;
    height: 50px;
    background: rgba(0, 217, 213, 0.1);
    border: 1px solid rgba(0, 217, 213, 0.3);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.2rem;
    transition: all var(--transition-base);
}

.step-icon i {
    font-size: 1.4rem;
    color: var(--primary-teal);
    transition: all var(--transition-base);
}

.step-content:hover .step-icon {
    transform: scale(1.1) rotate(5deg);
    background: rgba(0, 217, 213, 0.2);
    border-color: rgba(0, 217, 213, 0.5);
}

.step-content:hover .step-icon i {
    color: var(--accent-turquoise);
}

/* ===== STEP TEXT ===== */
.step-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.8rem;
    line-height: 1.3;
    transition: color var(--transition-base);
}

.step-content p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin: 0;
    font-weight: 400;
    transition: color var(--transition-base);
}

.step-content:hover h3 {
    color: var(--accent-turquoise);
}

.step-content:hover p {
    color: rgba(255, 255, 255, 0.9);
}

/* ===== STEP VISUAL ===== */
.step-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.step-image {
    width: 100%;
    max-width: 280px;
    height: auto;
    border-radius: 12px;
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.4),
        0 5px 15px rgba(0, 217, 213, 0.2);
    border: 1px solid rgba(0, 217, 213, 0.2);
    transition: all var(--transition-base);
    filter: brightness(0.95) contrast(1.1);
}

.step-image:hover {
    transform: scale(1.05);
    border-color: rgba(0, 217, 213, 0.4);
    filter: brightness(1.05) contrast(1.2);
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.5),
        0 10px 25px rgba(0, 217, 213, 0.3);
}

/* ===== SCROLL REVEAL ANIMATIONS ===== */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-reveal.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.scroll-reveal[data-delay="0"] { transition-delay: 0s; }
.scroll-reveal[data-delay="200"] { transition-delay: 0.2s; }
.scroll-reveal[data-delay="400"] { transition-delay: 0.4s; }
.scroll-reveal[data-delay="600"] { transition-delay: 0.6s; }

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .timeline-step:nth-child(odd) .step-content,
    .timeline-step:nth-child(even) .step-content {
        width: 42%;
    }
    
    .timeline-step:nth-child(odd) .step-visual,
    .timeline-step:nth-child(even) .step-visual {
        width: 42%;
    }
}

@media (max-width: 768px) {
    .how-it-works-section {
        padding: 80px 0 60px;
    }

    /* Stack layout for mobile */
    .works-timeline::before {
        left: 30px;
        transform: none;
    }

    .timeline-step,
    .timeline-step:nth-child(even) {
        flex-direction: column;
        align-items: flex-start;
        margin-left: 60px;
    }

    .timeline-step:nth-child(odd) .step-content,
    .timeline-step:nth-child(even) .step-content {
        width: 100%;
        margin: 0 0 1rem 0;
        text-align: left;
    }

    .timeline-step:nth-child(odd) .step-visual,
    .timeline-step:nth-child(even) .step-visual {
        width: 100%;
        margin: 0;
    }

    .timeline-step:nth-child(even) .step-icon {
        margin-left: 0;
    }

    .step-number {
        position: absolute;
        left: -55px;
        top: 20px;
        transform: none;
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .step-content {
        padding: 1.5rem;
    }

    .step-image {
        max-width: 200px;
    }

    .section-header {
        margin-bottom: 3rem;
    }

    .works-timeline {
        gap: 2.5rem;
    }
}

@media (max-width: 480px) {
    .how-it-works-section .container {
        padding: 0 1rem;
    }

    .timeline-step {
        gap: 1rem;
    }

    .step-number {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .step-content {
        padding: 1.2rem;
    }

    .step-content h3 {
        font-size: 1.1rem;
    }

    .step-content p {
        font-size: 0.9rem;
    }

    .step-icon {
        width: 40px;
        height: 40px;
    }

    .step-icon i {
        font-size: 1.2rem;
    }

    .step-image {
        max-width: 180px;
    }

    .section-badge {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }
}

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

.step-content:focus-within {
    outline: 2px solid var(--primary-teal);
    outline-offset: 4px;
}

/* ===== ENHANCED VISUAL EFFECTS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Timeline connector dots - removed for cleaner layout */