@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&display=swap');

* {
    font-family: "Inter", sans-serif;
}

/* Fondo con gradiente y partículas */
body {
    background: #191970; /* Midnight Blue */
    position: relative;
    overflow-x: hidden;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Contenedor de partículas */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

/* Partículas individuales */
.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    pointer-events: none;
    animation: floatParticle linear infinite;
}

.particle:nth-child(odd) {
    background: rgba(255, 255, 255, 0.05);
}

.particle:nth-child(3n) {
    background: rgba(102, 126, 234, 0.1);
}

.particle:nth-child(4n) {
    background: rgba(118, 75, 162, 0.08);
}

@keyframes floatParticle {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Estilos del título principal */
.title {
    font-family: "Poppins", sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin: 1rem 0;
    background: none;
    -webkit-text-fill-color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
}

/* Estilos para la línea de tiempo */
#loader {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#loader .fa-circle-notch {
    color: rgba(255, 255, 255, 0.9);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

#loader span {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.timeline-container {
    width: 100%;
    max-width: 1000px;
    margin: 1rem auto;
    padding: 0 2rem;
    position: relative;
}

.timeline-container::before,
.timeline-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30px;
    pointer-events: none;
    z-index: 10;
}



.timeline {
    position: relative;
    padding: 3rem 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 2rem;
    left: 5%;
    right: 5%;
    height: 4px;
    background: linear-gradient(to right, #95a5a6, #3498db, #e74c3c, #3498db, #2ecc71);
    border-radius: 2px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.timeline-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 160px;
}

.timeline-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 2px solid #e9ecef; /* igual grosor que en seleccionado para evitar saltos */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    position: relative;
    margin-top: 1.5rem;
    backdrop-filter: blur(10px);
    will-change: transform, box-shadow, border-color;
}

.timeline-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #ffffff 0%, #f1f3f4 100%);
}

.timeline-card::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #ffffff;
    transform: translateX(-50%);
    filter: drop-shadow(0 -2px 4px rgba(0, 0, 0, 0.1));
    z-index: 2;
}

.timeline-dot {
    position: absolute;
    top: -1rem;
    left: 50%;
    width: 16px;
    height: 16px;
    background: #3498db;
    border: 4px solid white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.timeline-dot:hover {
    transform: translate(-50%, -50%) scale(1.2);
}

.timeline-dot.past {
    background: #95a5a6;
}

.timeline-dot.current {
    background: #e74c3c;
    animation: pulse 2s infinite;
}

.timeline-dot.future {
    background: #3498db;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(231, 76, 60, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
    }
}

.timeline-date {
    font-family: "Poppins", sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.4rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.timeline-event {
    font-family: "Inter", sans-serif;
    font-size: 0.75rem;
    color: #4a5568;
    line-height: 1.5;
    text-align: center;
    margin-bottom: 0.5rem;
    font-weight: 500;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.2rem;
}

.timeline-status {
    font-family: "Poppins", sans-serif;
    display: inline-block;
    padding: 0.3rem 0.7rem;
    border-radius: 18px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    text-align: center;
    width: 100%;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.status-past {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
    box-shadow: 0 2px 8px rgba(149, 165, 166, 0.3);
}

.status-current {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.4);
    animation: currentGlow 2s ease-in-out infinite alternate;
}

.status-future {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

@keyframes currentGlow {
    0% {
        box-shadow: 0 2px 8px rgba(231, 76, 60, 0.4);
    }
    100% {
        box-shadow: 0 2px 15px rgba(231, 76, 60, 0.7);
    }
}

.timeline-card:hover .timeline-status {
    transform: translateY(-2px);
}

/* Estilos para tarjetas clickeables (futuras) */
.timeline-item.clickeable .timeline-card {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-item.clickeable .timeline-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.timeline-item.clickeable .timeline-card::after {
    content: '👆';
    position: absolute;
    top: -25px;
    right: 10px;
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.timeline-item.clickeable .timeline-card:hover::after {
    opacity: 1;
}

.timeline-item.selected .timeline-card {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(52, 152, 219, 0.4);
    border: 2px solid #3498db;
}

/* Indicador de borde del triángulo (elemento real, no pseudo) */
.timeline-card-pointer {
    position: absolute;
    top: -14px;
    left: 50%;
    width: 0;
    height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-bottom: 14px solid #3498db;
    transform: translateX(-50%);
    z-index: 1; /* debajo del triángulo blanco (::before) */
    opacity: 0;
    transition: opacity 220ms ease;
    pointer-events: none;
}

.timeline-item.selected .timeline-card-pointer {
    opacity: 1;
}

.timeline-item.selected .timeline-dot {
    background: #3498db;
    animation: selectedPulse 1.5s ease-in-out infinite;
}

@keyframes selectedPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 3px 15px rgba(52, 152, 219, 0.4);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow: 0 5px 20px rgba(52, 152, 219, 0.6);
    }
}

/* Estilos especiales para la tarjeta del medio */
.middle-item .timeline-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.middle-item .timeline-card:hover {
    transform: scale(1.15) translateY(-10px);
    box-shadow: 0 15px 50px rgba(102, 126, 234, 0.4);
}

.middle-item .timeline-card::before {
    border-bottom-color: #667eea;
}

.middle-item .timeline-date {
    color: white;
    background: linear-gradient(45deg, #ffffff, #f8f9fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 700;
}

.middle-item .timeline-event {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.middle-item .timeline-status {
    background: linear-gradient(135deg, #ffffff, #f8f9fa) !important;
    color: #667eea !important;
    font-weight: 700;
    box-shadow: 0 3px 12px rgba(255, 255, 255, 0.3);
}

.middle-item .timeline-dot {
    background: #667eea;
    width: 20px;
    height: 20px;
    border: 5px solid white;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    animation: middlePulse 2s ease-in-out infinite;
}

@keyframes middlePulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
    }
}

/* Responsive para tablets */
@media (max-width: 1024px) {
    .timeline-container {
        max-width: 100%;
        padding: 0 1.5rem;
    }

    .timeline-item {
        max-width: 140px;
    }

    .timeline-card {
        padding: 0.9rem;
    }

    .timeline-date {
        font-size: 0.8rem;
        letter-spacing: 0.6px;
    }

    .timeline-event {
        font-size: 0.7rem;
    }

    .title {
        font-size: clamp(1.6rem, 4vw, 2.4rem);
    }
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .timeline-container {
        padding: 0 0.5rem;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: visible;
    }

    .timeline-container::before,
    .timeline-container::after {
        width: 15px;
    }

    .timeline {
        padding: 2.5rem 0 1rem;
        min-width: 600px;
        justify-content: flex-start;
        gap: 1rem;
    }

    .timeline::before {
        left: 1%;
        right: 1%;
        height: 3px;
    }

    .timeline-item {
        max-width: 100px;
        flex-shrink: 0;
    }

    .middle-item .timeline-card {
        transform: scale(1.05);
    }

    .middle-item .timeline-card:hover {
        transform: scale(1.08) translateY(-8px);
    }

    .middle-item .timeline-dot {
        width: 16px;
        height: 16px;
        border-width: 4px;
    }

    .timeline-card {
        padding: 0.7rem;
        margin-top: 1rem;
    }

    .timeline-date {
        font-size: 0.7rem;
        margin-bottom: 0.25rem;
        letter-spacing: 0.5px;
    }

    .timeline-event {
        font-size: 0.65rem;
        min-height: 1.8rem;
        margin-bottom: 0.3rem;
    }

    .timeline-status {
        font-size: 0.55rem;
        padding: 0.2rem 0.5rem;
    }

    .title {
        font-size: clamp(1.4rem, 5vw, 2rem);
        margin: 0.5rem 0;
    }

    .timeline-dot {
        width: 12px;
        height: 12px;
        border-width: 2px;
    }
}

/* Optimización de partículas para móviles */
@media (max-width: 768px) {
    body {
        background-size: 300% 300%;
        animation-duration: 20s;
    }

    .particle {
        max-width: 6px;
        max-height: 6px;
    }

    @keyframes floatParticle {
        0% {
            transform: translateY(100vh) rotate(0deg) scale(0.8);
            opacity: 0;
        }
        10% {
            opacity: 0.8;
        }
        90% {
            opacity: 0.8;
        }
        100% {
            transform: translateY(-100vh) rotate(270deg) scale(0.5);
            opacity: 0;
        }
    }
}

/* Responsive para móviles muy pequeños */
@media (max-width: 480px) {
    .timeline-container {
        padding: 0 0.25rem;
    }

    body {
        animation-duration: 25s;
    }

    .particle {
        max-width: 4px;
        max-height: 4px;
    }

    .timeline {
        min-width: 550px;
        gap: 0.8rem;
    }

    .timeline-item {
        max-width: 90px;
    }

    .timeline-card {
        padding: 0.6rem;
    }

    .timeline-date {
        font-size: 0.6rem;
    }

    .timeline-event {
        font-size: 0.55rem;
        min-height: 1.6rem;
    }

    .timeline-status {
        font-size: 0.45rem;
        padding: 0.1rem 0.3rem;
    }

    .middle-item .timeline-card {
        transform: scale(1.03);
    }

    .middle-item .timeline-dot {
        width: 14px;
        height: 14px;
    }
}
