﻿/* ========================================= */
/* Archivo: wwwroot/css/stepper.css - VERSIÓN AVANZADA CON ANIMACIONES */
/* ========================================= */

.stepper-container {
    margin: 2rem 0;
}

.stepper-nav {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: relative;
    padding: 0 20px; /* Espaciado para que las líneas no se corten */
}

.stepper-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
    max-width: 200px;
    min-height: 80px;
}

/* Línea de fondo continua */
.stepper-nav::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 10%;
    right: 10%;
    height: 4px;
    background-color: #e9ecef;
    z-index: 0;
    border-radius: 2px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.stepper-circle {
    width: 45px !important;
    height: 45px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: 3px solid #dee2e6 !important;
    background-color: white !important;
    color: #6c757d !important;
    margin-bottom: 12px !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    position: relative !important;
    z-index: 3 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12) !important;
    transform: scale(1) !important;
}

    .stepper-circle:hover {
        transform: scale(1.05) !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.18) !important;
    }

.stepper-item.active .stepper-circle {
    background: linear-gradient(135deg, #0d6efd 0%, #0056b3 100%) !important;
    border-color: #0d6efd !important;
    color: white !important;
    box-shadow: 0 6px 16px rgba(13, 110, 253, 0.4) !important;
    transform: scale(1.1) !important;
    animation: pulse 2s infinite !important;
}

.stepper-item.completed .stepper-circle {
    background: linear-gradient(135deg, #198754 0%, #146c43 100%) !important;
    border-color: #198754 !important;
    color: white !important;
    box-shadow: 0 6px 16px rgba(25, 135, 84, 0.4) !important;
    transform: scale(1.05) !important;
}

.stepper-item.error .stepper-circle {
    background: linear-gradient(135deg, #dc3545 0%, #b02a37 100%) !important;
    border-color: #dc3545 !important;
    color: white !important;
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.4) !important;
    transform: scale(1.05) !important;
    animation: shake 0.5s ease-in-out !important;
}

.stepper-label {
    text-align: center;
    font-size: 0.9rem;
    height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    transition: all 0.3s ease !important;
}

.stepper-title {
    font-weight: 500;
    color: #495057;
    line-height: 1.2;
    margin-bottom: 2px;
    transition: all 0.3s ease !important;
}

.stepper-item.active .stepper-title {
    color: #0d6efd !important;
    font-weight: 600 !important;
    transform: translateY(-2px) !important;
}

.stepper-item.completed .stepper-title {
    color: #198754 !important;
    font-weight: 600 !important;
}

.stepper-optional {
    font-size: 0.75rem;
    color: #6c757d;
    height: 16px;
    line-height: 1;
    margin-top: 2px;
    transition: all 0.3s ease !important;
}

.stepper-item.active .stepper-optional {
    color: #0d6efd !important;
    transform: translateY(-1px) !important;
}

/* Líneas individuales para cada segmento */
.stepper-line {
    position: absolute;
    top: 20px;
    left: 60%; /* Comienza después del círculo */
    width: 80%; /* Hasta el siguiente círculo */
    height: 4px;
    background-color: #e9ecef; /* Gris por defecto */
    z-index: 1;
    border-radius: 2px;
    transition: background-color 0.5s ease;
}

/* El último paso no tiene línea */
.stepper-item:last-child .stepper-line {
    display: none;
}

/* Clases específicas para cada estado de línea */
.stepper-line.line-completed {
    background-color: #198754; /* Verde: pasos completados */
}

.stepper-line.line-active {
    background-color: #0d6efd; /* Azul: línea hacia el paso actual */
}

.stepper-line.line-pending {
    background-color: #e9ecef; /* Gris: líneas futuras */
}

/* Línea de fondo continua - SOLO DESKTOP */
.stepper-nav::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 10%;
    right: 10%;
    height: 4px;
    background-color: #e9ecef;
    z-index: 0;
    border-radius: 2px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.stepper-content {
    min-height: 400px;
    padding: 1rem 0;
    animation: fadeInUp 0.5s ease-out;
}

/* Animaciones */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 6px 16px rgba(13, 110, 253, 0.4);
    }

    50% {
        box-shadow: 0 6px 20px rgba(13, 110, 253, 0.6);
    }
}

@keyframes shake {
    0%, 100% {
        transform: scale(1.05) translateX(0);
    }

    25% {
        transform: scale(1.05) translateX(-2px);
    }

    75% {
        transform: scale(1.05) translateX(2px);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Efectos adicionales */
.stepper-circle .bi {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Indicador de carga en pasos */
.stepper-item.loading .stepper-circle {
    background: conic-gradient(from 0deg, #0d6efd, #20c997, #0d6efd) !important;
    animation: rotate 1s linear infinite !important;
}

@keyframes rotate {
    from {
        transform: rotate(0deg) scale(1.1);
    }

    to {
        transform: rotate(360deg) scale(1.1);
    }
}

/* Responsive Design - MÓVIL CON GRID LAYOUT */
@media (max-width: 768px) {
    .stepper-container {
        margin: 1rem 0;
    }

    .stepper-nav {
        display: grid !important;
        grid-template-columns: 60px 1fr !important; /* Columna fija para círculos, resto para texto */
        gap: 0 !important;
        padding: 0 1rem !important;
        align-items: start !important;
    }

        /* OCULTAR línea de fondo */
        .stepper-nav::before {
            display: none !important;
        }

    .stepper-item {
        display: contents !important; /* Los hijos van directamente al grid */
    }

    /* Columna de círculos - siempre alineados */
    .stepper-circle {
        grid-column: 1 !important; /* Primera columna */
        width: 40px !important;
        height: 40px !important;
        margin: 15px 10px !important; /* Margen vertical consistente */
        justify-self: center !important; /* Centrado horizontal en su columna */
        align-self: start !important; /* Alineado desde arriba */
        position: relative !important;
        z-index: 2 !important;
        font-size: 0.9rem !important;
    }

    /* Columna de texto */
    .stepper-label {
        grid-column: 2 !important; /* Segunda columna */
        padding: 15px 0 !important; /* Mismo padding vertical que círculos */
        margin: 0 !important;
        text-align: left !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        min-height: 70px !important; /* Altura consistente */
    }

    .stepper-title {
        font-size: 1rem !important;
        margin: 5px 0 2px 0 !important;
        font-weight: 600 !important;
        line-height: 1.2 !important;
    }

    .stepper-optional {
        font-size: 0.75rem !important;
        margin: 0 !important;
        opacity: 0.8 !important;
        line-height: 1.1 !important;
    }

    /* OCULTAR líneas horizontales */
    .stepper-line {
        display: none !important;
    }

    /* Líneas verticales entre círculos */
    .stepper-circle:not(:last-of-type)::after {
        content: '' !important;
        position: absolute !important;
        left: 50% !important;
        top: 50px !important; /* Desde abajo del círculo */
        width: 2px !important;
        height: 25px !important; /* Hasta el siguiente círculo */
        background-color: #e9ecef !important;
        transform: translateX(-50%) !important;
        z-index: 1 !important;
    }

    /* Estados de círculos y líneas */
    .stepper-item.completed .stepper-circle::after {
        background-color: #198754 !important;
    }

    .stepper-item.active .stepper-circle::after {
        background-color: #0d6efd !important;
    }

    /* Fondos para texto según estado */
    .stepper-item.active .stepper-label {
        background-color: rgba(13, 110, 253, 0.08) !important;
        border-left: 4px solid #0d6efd !important;
        padding-left: 16px !important;
        border-radius: 0 8px 8px 0 !important;
    }

    .stepper-item.completed .stepper-label {
        background-color: rgba(25, 135, 84, 0.08) !important;
        border-left: 4px solid #198754 !important;
        padding-left: 16px !important;
        border-radius: 0 8px 8px 0 !important;
    }

    .stepper-item.error .stepper-label {
        background-color: rgba(220, 53, 69, 0.08) !important;
        border-left: 4px solid #dc3545 !important;
        padding-left: 16px !important;
        border-radius: 0 8px 8px 0 !important;
    }

    .stepper-content {
        animation: fadeIn 0.3s ease-out;
        padding: 0.5rem 0;
        min-height: 300px;
        grid-column: 1 / -1 !important; /* Ocupar todas las columnas */
    }

    
}
