﻿/* =======================================================
   TIMELINE "GREEN TO RED" EDITION - CSS
   ======================================================= */

.timeline-container {
    position: relative;
    padding: 80px 0;
    max-width: 1200px;
    margin: 0 auto;
    /* Importante para que las chispas no tapen el contenido */
    z-index: 2;
}

/* --- LÍNEA DE PODER (VERDE -> ROJO) --- */
.timeline-track {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    z-index: 10;
}

.timeline-line-bg {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #334155; /* Gris oscuro para contraste */
    border-radius: 4px;
    left: 50%;
    transform: translateX(-50%);
}

/* Barra de Progreso: De Verde Matrix a Rojo Alerta */
.timeline-line-progress {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 0%;
    /* Gradiente: 70% Verde, termina en Rojo */
    background: linear-gradient(180deg, #10b981 0%, #10b981 60%, #ff0055 100%);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
    z-index: 2;
    border-radius: 4px;
    transition: height 0.1s linear;
}

/* --- BURBUJAS TOAST --- */
.timeline-bubble {
    position: absolute;
    left: 50px;
    background: rgba(15, 23, 42, 0.95);
    color: #fff;
    padding: 12px 25px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 800;
    font-family: 'Manrope', sans-serif;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-30px) scale(0.8);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 20;
    pointer-events: none;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

    .timeline-bubble::before {
        content: '';
        position: absolute;
        left: -8px;
        top: 50%;
        transform: translateY(-50%);
        border-top: 8px solid transparent;
        border-bottom: 8px solid transparent;
    }

    .timeline-bubble.active {
        opacity: 1;
        visibility: visible;
        transform: translateX(0) scale(1);
    }

/* --- HOTSPOTS --- */
.line-hotspot {
    position: absolute;
    width: 40px;
    height: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    cursor: crosshair;
    display: flex;
    justify-content: center;
    align-items: center;
}

    .line-hotspot:hover .hotspot-core {
        transform: scale(1.8);
        background: #fff;
        box-shadow: 0 0 20px #fff;
    }

.hotspot-core {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 0 15px currentColor;
    background: currentColor; /* Hereda el color definido inline */
}

/* --- ESTILOS DE COLOR (CLASES HELPER) --- */

/* 1. ESTILO VERDE (Steps 1-3) */
.style-green .glass-card {
    border-bottom: 4px solid #10b981;
}

.style-green .text-gradient {
    background: linear-gradient(90deg, #064e3b, #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.style-green .timeline-dot {
    border-color: #10b981;
    color: #10b981;
}
/* Estado Activo Verde */
.timeline-row.active.style-green .timeline-dot {
    background: #10b981;
    color: #fff;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.6);
    transform: scale(1.15);
}

.timeline-row.active.style-green .glass-card {
    box-shadow: 0 15px 50px rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
}
/* Burbuja Verde */
.bubble-green {
    border-left: 5px solid #10b981;
}

    .bubble-green::before {
        border-right: 8px solid #10b981;
    }


/* 2. ESTILO ROJO (Step 4) */
.style-red .glass-card {
    border-bottom: 4px solid #ff0055;
}

.style-red .text-gradient {
    background: linear-gradient(90deg, #881337, #ff0055);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.style-red .timeline-dot {
    border-color: #ff0055;
    color: #ff0055;
}
/* Estado Activo Rojo */
.timeline-row.active.style-red .timeline-dot {
    background: #ff0055;
    color: #fff;
    box-shadow: 0 0 40px rgba(255, 0, 85, 0.8);
    transform: scale(1.2);
    animation: shakeIcon 3s infinite; /* Solo el rojo vibra */
}

.timeline-row.active.style-red .glass-card {
    box-shadow: 0 15px 50px rgba(255, 0, 85, 0.2);
    border-color: rgba(255, 0, 85, 0.5);
}
/* Burbuja Roja (Lado Izquierdo) */
.bubble-red {
    border-right: 5px solid #ff0055;
    border-left: 1px solid rgba(255,0,85,0.3);
    left: auto;
    right: 50px;
    text-align: right;
}

    .bubble-red::before {
        left: auto;
        right: -8px;
        border-right: none;
        border-left: 8px solid #ff0055;
    }

/* Animación Vibración */
@keyframes shakeIcon {
    0%, 100% {
        transform: scale(1.2) rotate(0deg);
    }

    10% {
        transform: scale(1.2) rotate(-5deg);
    }

    20% {
        transform: scale(1.2) rotate(5deg);
    }

    30% {
        transform: scale(1.2) rotate(-5deg);
    }

    40% {
        transform: scale(1.2) rotate(0deg);
    }
}

/* --- ESTRUCTURA BASE --- */
.timeline-row {
    display: flex;
    align-items: center;
    margin-bottom: 100px;
    opacity: 0.3;
    filter: blur(2px);
    transform: scale(0.95);
    transition: all 0.5s ease-out;
}

    .timeline-row.active {
        opacity: 1;
        filter: blur(0);
        transform: scale(1);
    }

.timeline-content, .timeline-empty {
    width: 45%;
    padding: 0 50px;
}

.glass-card {
    background: #fff;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: 1px solid #f1f5f9;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s;
}

    .glass-card:hover {
        transform: translateY(-5px);
    }

.step-number-bg {
    position: absolute;
    top: -20px;
    right: -10px;
    font-size: 6rem;
    font-weight: 900;
    color: rgba(0,0,0,0.03);
    font-family: 'Orbitron', sans-serif;
    pointer-events: none;
}

.timeline-dot-wrapper {
    width: 10%;
    display: flex;
    justify-content: center;
    z-index: 5;
    position: relative;
}

.timeline-dot {
    width: 70px;
    height: 70px;
    background: #fff;
    border: 4px solid #e2e8f0;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    color: #cbd5e1;
    transition: all 0.4s;
    position: relative;
    z-index: 2;
}

/* RESPONSIVE */
@media (max-width: 991px) {
    .timeline-track {
        left: 30px;
        width: 40px;
    }

    .timeline-line-bg, .timeline-line-progress, .line-hotspot {
        left: 50%;
        transform: translateX(-50%);
    }

    .timeline-bubble {
        left: 50px !important;
        text-align: left !important;
        border-left: 5px solid #10b981 !important;
        border-right: none !important;
    }

        .timeline-bubble::before {
            left: -8px !important;
            right: auto !important;
            border-right: 8px solid #10b981 !important;
            border-left: none !important;
        }

    .timeline-row {
        flex-direction: column;
        margin-bottom: 70px;
        align-items: flex-start;
    }

    .timeline-content {
        width: 100%;
        padding-left: 80px;
        padding-right: 15px;
    }

    .timeline-empty {
        display: none;
    }

    .timeline-dot-wrapper {
        width: auto;
        position: absolute;
        left: 30px;
        top: 0;
        transform: translateX(-50%);
    }

    /* Ajuste para la burbuja roja en móvil */
    .bubble-red {
        border-left: 5px solid #ff0055 !important;
        border-right: none !important;
    }

        .bubble-red::before {
            border-right: 8px solid #ff0055 !important;
            border-left: none !important;
        }
}
