/* ==========================================
   Stepper
   Shared by the content pipeline view (advertisements/content) and the campaign
   creation wizard. It lived in content.css until the wizard needed the same thing.

   Markup (see StatusStepper / wizard.js):
     .stepper > (.stepper-step[.completed|.active|.rejected|.deactivated] + .stepper-line)
     .stepper-step > .stepper-dot + .stepper-label
   ========================================== */

.stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 20px;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
}

.stepper-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 80px;
}

/* Wizard steps are navigable; the pipeline view's are not. */
.stepper-step--clickable {
    cursor: pointer;
}

.stepper-step--clickable:hover .stepper-dot {
    border-color: var(--primary-color);
}

.stepper-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: var(--dark-bg-tertiary);
    transition: all 0.3s ease;
}

.stepper-step.completed .stepper-dot {
    border-color: var(--success-color);
    background: rgba(34, 197, 94, 0.15);
    color: var(--success-color);
}

.stepper-step.active .stepper-dot {
    border-color: var(--primary-color);
    background: rgba(139, 92, 246, 0.2);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
    animation: stepperPulse 2s ease-in-out infinite;
}

/* Waiting on the person looking at the screen, not on the system — deliberately a
   different colour from 'active' so "your turn" does not read as "still working". */
.stepper-step.awaiting-you .stepper-dot {
    border-color: var(--warning-color, #f59e0b);
    background: rgba(245, 158, 11, 0.18);
    color: var(--warning-color, #f59e0b);
    animation: none;
}

.stepper-step.rejected .stepper-dot {
    border-color: var(--danger-color);
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
}

.stepper-step.deactivated .stepper-dot {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    opacity: 0.6;
}

@keyframes stepperPulse {
    0%, 100% { box-shadow: 0 0 12px rgba(139, 92, 246, 0.3); }
    50% { box-shadow: 0 0 20px rgba(139, 92, 246, 0.5); }
}

.stepper-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    white-space: nowrap;
}

.stepper-step.active .stepper-label,
.stepper-step.awaiting-you .stepper-label,
.stepper-step.completed .stepper-label {
    color: var(--text-color);
    font-weight: 600;
}

.stepper-line {
    flex: 1;
    height: 2px;
    min-width: 40px;
    background: rgba(255, 255, 255, 0.1);
    margin-bottom: 28px;
}

.stepper-line.completed {
    background: var(--success-color);
}

.stepper-alert {
    text-align: center;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-top: 12px;
}

.stepper-alert.processing {
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.stepper-alert.awaiting-you {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color, #f59e0b);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.stepper-alert.rejected {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.stepper-alert.deactivated {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 640px) {
    /* Below this width the horizontal rail stops fitting five steps; let it scroll
       rather than crushing the labels into each other. */
    .stepper {
        justify-content: flex-start;
        overflow-x: auto;
        padding: 12px;
    }
    .stepper-step {
        min-width: 62px;
    }
    .stepper-dot {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    .stepper-label {
        font-size: 0.65rem;
    }
    .stepper-line {
        min-width: 20px;
    }
}
