/* ==========================================================================
   Looponia - How It Works Section
   3-step process with alternating layout
   ========================================================================== */

/* -------------------------------------------------------------------------
   Section Container
   ------------------------------------------------------------------------- */
.how-it-works {
    position: relative;
    overflow: hidden;
}

.how-it-works::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle,
            rgba(129, 166, 132, 0.08) 0%,
            transparent 70%);
    pointer-events: none;
}

/* -------------------------------------------------------------------------
   Steps Container
   ------------------------------------------------------------------------- */
.how-steps {
    display: flex;
    flex-direction: column;
    gap: var(--space-16);
    margin-top: var(--space-12);
    position: relative;
}

/* Connecting line */
.how-steps::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 80px;
    bottom: 80px;
    width: 2px;
    background: linear-gradient(180deg,
            var(--primary) 0%,
            var(--wellness-sage) 50%,
            var(--wellness-mint) 100%);
    opacity: 0.3;
    transform: translateX(-50%);
}

@media (max-width: 1023px) {
    .how-steps::before {
        left: 24px;
        transform: none;
    }
}

/* -------------------------------------------------------------------------
   Single Step
   ------------------------------------------------------------------------- */
.how-step {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-8);
    align-items: center;
    position: relative;
}

@media (min-width: 1024px) {
    .how-step {
        grid-template-columns: 1fr auto 1fr;
        gap: var(--space-12);
    }

    .how-step-reverse {
        direction: rtl;
    }

    .how-step-reverse>* {
        direction: ltr;
    }

    .how-step-reverse .how-step-content {
        text-align: right;
    }
}

/* -------------------------------------------------------------------------
   Step Number
   ------------------------------------------------------------------------- */
.how-step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: var(--text-on-primary);
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    border-radius: var(--radius-full);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.4);
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

@media (max-width: 1023px) {
    .how-step-number {
        position: absolute;
        left: 0;
        top: 0;
    }
}

/* Step number color variants */
.how-step:nth-child(1) .how-step-number {
    background: var(--wellness-sage);
    box-shadow: 0 0 30px rgba(129, 166, 132, 0.4);
}

.how-step:nth-child(2) .how-step-number {
    background: var(--wellness-lavender);
    box-shadow: 0 0 30px rgba(155, 143, 185, 0.4);
}

.how-step:nth-child(3) .how-step-number {
    background: var(--wellness-mint);
    box-shadow: 0 0 30px rgba(144, 201, 171, 0.4);
}

/* -------------------------------------------------------------------------
   Step Content
   ------------------------------------------------------------------------- */
.how-step-content {
    max-width: 400px;
}

@media (max-width: 1023px) {
    .how-step-content {
        padding-left: calc(48px + var(--space-6));
        max-width: 100%;
    }
}

.how-step-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-4);
    line-height: var(--leading-tight);
}

.how-step-description {
    font-size: var(--text-base);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
}

/* -------------------------------------------------------------------------
   Step Visual (placeholder for screenshot)
   ------------------------------------------------------------------------- */
.how-step-visual {
    position: relative;
    width: 100%;
    max-width: 450px;
    aspect-ratio: 4 / 3;
    background: var(--bg-card);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

@media (max-width: 1023px) {
    .how-step-visual {
        margin-left: calc(48px + var(--space-6));
        margin-top: var(--space-4);
    }
}

.how-step-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Placeholder gradient when no image */
.how-step-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            var(--bg-tertiary) 0%,
            var(--bg-secondary) 50%,
            var(--bg-tertiary) 100%);
    z-index: -1;
}

/* Decorative glow */
.how-step-visual::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: var(--gradient-serenity);
    border-radius: var(--radius-2xl);
    opacity: 0;
    z-index: -2;
    transition: opacity var(--transition-base);
}

.how-step:hover .how-step-visual::after {
    opacity: 0.3;
}

/* Visual color variants */
.how-step:nth-child(1) .how-step-visual::after {
    background: var(--gradient-nature);
}

.how-step:nth-child(2) .how-step-visual::after {
    background: var(--gradient-twilight);
}

.how-step:nth-child(3) .how-step-visual::after {
    background: var(--gradient-serenity);
}

/* -------------------------------------------------------------------------
   Responsive Layout
   ------------------------------------------------------------------------- */
@media (max-width: 639px) {
    .how-steps {
        gap: var(--space-12);
    }

    .how-step-number {
        width: 40px;
        height: 40px;
        font-size: var(--text-lg);
    }

    .how-step-content {
        padding-left: calc(40px + var(--space-4));
    }

    .how-step-visual {
        margin-left: calc(40px + var(--space-4));
        aspect-ratio: 16 / 10;
    }

    .how-step-title {
        font-size: var(--text-xl);
    }

    .how-steps::before {
        left: 20px;
    }
}

/* -------------------------------------------------------------------------
   Animation
   ------------------------------------------------------------------------- */
.how-step {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.how-step.reveal-active {
    opacity: 1;
    transform: translateY(0);
}

.how-step:nth-child(1) {
    transition-delay: 0.1s;
}

.how-step:nth-child(2) {
    transition-delay: 0.2s;
}

.how-step:nth-child(3) {
    transition-delay: 0.3s;
}