/* ============================================================================
   ESTILOS STEPPER LOADER IA - Análisis de Presupuesto
   Agregar dentro de <style> en el HTML o en un archivo CSS separado
   ============================================================================ */

/* Contenedor principal del loader */
#loader_ia_container {
    display: none;
    padding: 20px 0;
    margin-bottom: 20px;
}

/* Contenedor del progreso */
.progress-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fc 100%);
    border-radius: 16px;
    padding: 30px 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8ecf3;
}

/* Título del progreso */
.progress-title {
    text-align: center;
    color: #181c32;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 35px;
    position: relative;
}

.progress-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #009ef7, #50cd89);
    border-radius: 2px;
}

/* Contenedor del stepper */
.stepper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    padding: 20px 0;
}

/* Línea base del stepper (fondo gris) */
.stepper-line {
    position: absolute;
    top: 40px;
    left: 10%;
    right: 10%;
    height: 4px;
    background: #e4e6ef;
    border-radius: 2px;
    z-index: 0;
    overflow: hidden;
}

/* Línea de progreso animada (azul/verde) */
.stepper-line-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #009ef7, #50cd89);
    border-radius: 2px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

/* Efecto de brillo en la línea de progreso */
.stepper-line-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.4),
            transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Cada paso individual */
.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
    max-width: 120px;
}

/* Icono del paso */
.step-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #e4e6ef;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Número del paso */
.step-number {
    font-size: 18px;
    font-weight: 700;
    color: #a1a5b7;
    transition: all 0.3s ease;
}

/* Checkmark (oculto por defecto) */
.checkmark {
    display: none;
    font-size: 20px;
    color: white;
    font-weight: bold;
}

/* Etiqueta del paso */
.step-label {
    font-size: 13px;
    color: #7e8299;
    text-align: center;
    line-height: 1.4;
    font-weight: 500;
    transition: all 0.3s ease;
}

/* ============================================================================
   ESTADOS DE LOS PASOS
   ============================================================================ */

/* Estado: Paso Activo */
.step.active .step-icon {
    background: linear-gradient(135deg, #009ef7, #0095e8);
    box-shadow: 0 0 0 6px rgba(0, 158, 247, 0.2), 0 4px 15px rgba(0, 158, 247, 0.4);
    animation: pulseActive 2s ease-in-out infinite;
    transform: scale(1.1);
}

.step.active .step-number {
    color: white;
}

.step.active .step-label {
    color: #009ef7;
    font-weight: 600;
}

@keyframes pulseActive {

    0%,
    100% {
        box-shadow: 0 0 0 6px rgba(0, 158, 247, 0.2), 0 4px 15px rgba(0, 158, 247, 0.4);
    }

    50% {
        box-shadow: 0 0 0 12px rgba(0, 158, 247, 0.1), 0 4px 20px rgba(0, 158, 247, 0.3);
    }
}

/* Estado: Paso Completado */
.step.completed .step-icon {
    background: linear-gradient(135deg, #50cd89, #47be7d);
    box-shadow: 0 4px 12px rgba(80, 205, 137, 0.4);
    transform: scale(1);
}

.step.completed .step-number {
    display: none;
}

.step.completed .checkmark {
    display: block;
    animation: checkmarkPop 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.step.completed .step-label {
    color: #50cd89;
    font-weight: 600;
}

@keyframes checkmarkPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Estado: Paso Pendiente (por defecto) */
.step.pending .step-icon {
    background: #e4e6ef;
}

.step.pending .step-number {
    color: #a1a5b7;
}

.step.pending .step-label {
    color: #7e8299;
}

/* ============================================================================
   ANIMACIONES ADICIONALES
   ============================================================================ */

/* Efecto de onda en el paso activo */
.step.active .step-icon::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 2px solid #009ef7;
    animation: ripple 1.5s ease-out infinite;
    opacity: 0;
}

@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

/* Transición suave al completar */
.step {
    transition: transform 0.3s ease;
}

.step.completed {
    transform: translateY(-2px);
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 992px) {
    .progress-container {
        padding: 25px 20px;
    }

    .stepper-line {
        left: 5%;
        right: 5%;
    }

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

    .step-number {
        font-size: 16px;
    }

    .step-label {
        font-size: 11px;
    }

    .progress-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .stepper {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        padding-left: 30px;
    }

    .stepper-line {
        width: 4px;
        height: calc(100% - 60px);
        top: 30px;
        left: 52px;
        right: auto;
    }

    .stepper-line-progress {
        width: 100% !important;
        height: 0%;
        transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .step {
        flex-direction: row;
        max-width: 100%;
        gap: 15px;
    }

    .step-icon {
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .step-label {
        text-align: left;
    }

    .progress-container {
        padding: 20px 15px;
    }
}

@media (max-width: 576px) {
    .progress-title {
        font-size: 1.1rem;
        margin-bottom: 25px;
    }

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

    .step-number {
        font-size: 14px;
    }

    .checkmark {
        font-size: 16px;
    }

    .step-label {
        font-size: 12px;
    }
}

/* ============================================================================
   DARK MODE (Opcional)
   ============================================================================ */

@media (prefers-color-scheme: dark) {
    .progress-container {
        background: linear-gradient(135deg, #1e1e2d 0%, #151521 100%);
        border-color: #2b2b40;
    }

    .progress-title {
        color: #ffffff;
    }

    .stepper-line {
        background: #2b2b40;
    }

    .step-icon {
        background: #2b2b40;
    }

    .step-number {
        color: #565674;
    }

    .step-label {
        color: #565674;
    }

    .step.active .step-label,
    .step.completed .step-label {
        color: inherit;
    }
}