/**
 * Estilos para TimeLine Eventos
 * 
 * Incluye:
 * - Timeline horizontal responsive
 * - Animaciones CSS para la línea activa
 * - Estilos para puntos y contenido
 * - Diseño adaptable a diferentes tamaños de pantalla
 */

/* Importar fuente Inter de Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ============================================
   CONTENEDOR PRINCIPAL DEL TIMELINE
   ============================================ */

.timeline-eventos {
    width: 100%;
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    position: relative;
    font-family: 'Inter', Arial, sans-serif;
}

/* ============================================
   LÍNEA DEL TIMELINE
   ============================================ */

.timeline-line {
    position: relative;
    height: 4px;
    background-color: var(--timeline-inactive-line-color, #cccccc);
    border-radius: 2px;
    margin: 20px 0 40px 0;
    overflow: hidden;
}

/* Línea de progreso animada */
.timeline-line-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background-color: var(--timeline-active-line-color, #ff6600);
    border-radius: 2px;
    transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1;
}

/* ============================================
    PUNTOS DEL TIMELINE
   ============================================ */

.timeline-points {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -53px;
    margin-bottom: 20px;
    z-index: 2;
}

.timeline-point {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease;
}

/* Círculo del punto */
.timeline-point::before {
    content: '';
    width: 20px;
    height: 20px;
    background-color: var(--timeline-inactive-point-color, #cccccc);
    border: 3px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 3;
}

/* Estado hover del punto */
.timeline-point:hover {
    transform: translateY(-3px);
}

.timeline-point:hover::before {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Punto activo */
.timeline-point.active::before {
    background-color: var(--timeline-active-point-color, #ff6600);
    transform: scale(1.2);
    box-shadow: 0 4px 16px rgba(255, 102, 0, 0.4);
}

/* Puntos completados (ya pasados) */
.timeline-point.completed::before {
    background-color: var(--timeline-active-point-color, #ff6600);
    transform: scale(1.0);
    box-shadow: 0 2px 12px rgba(255, 102, 0, 0.3);
}

/* Año del evento */
.timeline-year {
    position: absolute;
    top: -45px;
    white-space: nowrap;
    font-family: 'Inter', Arial, sans-serif;
    font-weight: 600;
    font-size: 20px;
    color: #333;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    transition: color 0.3s ease, transform 0.3s ease;
}

.timeline-point:hover .timeline-year {
    color: var(--timeline-active-point-color, #ff6600);
    transform: translateY(-2px);
}

.timeline-point.active .timeline-year {
    color: var(--timeline-active-point-color, #ff6600);
    font-weight: 900;
}

.timeline-point.completed .timeline-year {
    color: var(--timeline-active-point-color, #ff6600);
    font-weight: 600;
}

/* ============================================
   CONTENIDO DEL EVENTO
   ============================================ */

.timeline-content {
    margin-top: 40px;
    min-height: 200px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.timeline-content.show {
    opacity: 1;
    transform: translateY(0);
}

/* Mostrar contenido inmediatamente si está marcado como show desde el inicio */
.timeline-content.show:not(.loading) {
    opacity: 1;
    transform: translateY(0);
}

.timeline-event-display {
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 30px;
    background: #ffffff;
    border-radius: 12px;
    width: 70%;
    margin: 0 auto;
}

/* Imagen del evento */
.timeline-event-image {
    flex-shrink: 0;
    max-width: 150px;
    min-width: 80px;
}

.timeline-event-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.timeline-event-image img:hover {
    transform: scale(1.05);
}

/* Placeholder cuando no hay imagen */
.timeline-event-image:empty {
    display: none;
}

/* Ajustar el contenido cuando no hay imagen */
.timeline-event-display:not(:has(.timeline-event-image)) .timeline-event-text {
    flex: 1;
    margin-left: 0;
}

/* Texto del evento */
.timeline-event-text {
    flex: 1;
    line-height: 1.6;
    color: #333;
}

.timeline-event-text p {
    margin: 0;
    font-size: 25px; /*var(--timeline-font-size, 25px);*/
    font-family: 'Inter', var(--timeline-font-family, 'Arial, sans-serif');
    font-weight: 400;
}

/* Estado inicial (placeholder) */
.timeline-event-placeholder {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 60px 20px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablets */
@media (max-width: 768px) {
    .timeline-eventos {
        padding: 15px;
        margin: 20px auto;
    }
    
    .timeline-line {
        margin: 50px 0 30px 0;
    }
    
    .timeline-points {
        margin-top: -28px;
    }
    
    .timeline-point::before {
        width: 16px;
        height: 16px;
        border-width: 2px;
    }
    
    .timeline-year {
        top: -40px;
        font-size: 14px;
    }
    
    .timeline-event-display {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }
    
    .timeline-event-image {
        max-width: 120px;
        align-self: center;
    }
    
    .timeline-event-text p {
        font-size: calc(var(--timeline-font-size, 25) * 0.8px);
    }

    .timeline-event-text p {
    text-align: center;
    }

    .timeline-points {
    margin-top: -28px !important;
    }

    .timeline-event-display {
    width: 95%;
}
}

/* Móviles */
@media (max-width: 480px) {
    .timeline-eventos {
        padding: 10px;
    }
    
    .timeline-line {
        margin: 40px 0 20px 0;
        height: 3px;
    }
    
    .timeline-points {
        margin-top: -25px;
        flex-wrap: wrap;
        gap: 10px 0;
    }
    
    .timeline-point {
        flex: 1;
        min-width: 60px;
    }
    
    .timeline-point::before {
        width: 14px;
        height: 14px;
        border-width: 2px;
    }
    
    .timeline-year {
        top: -35px;
        font-size: 12px;
    }
    
    .timeline-event-display {
        padding: 15px;
        gap: 15px;
    }
    
    .timeline-event-image {
        max-width: 100px;
    }
    
    .timeline-event-text p {
        font-size: calc(var(--timeline-font-size, 25) * 0.7px);
        line-height: 1.5;
    }
}

/* Pantallas muy pequeñas */
@media (max-width: 320px) {
    .timeline-point::before {
        width: 12px;
        height: 12px;
    }
    
    .timeline-year {
        font-size: 11px;
        top: -30px;
    }
    
    .timeline-event-text p {
        font-size: calc(var(--timeline-font-size, 25) * 0.6px);
    }
}

/* ============================================
   ANIMACIONES ADICIONALES
   ============================================ */

/* Entrada suave del timeline */
.timeline-eventos {
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animación de entrada para el contenido por defecto */
.timeline-content.show {
    animation: fadeInContent 1s ease-out 0.3s both;
}

@keyframes fadeInContent {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pulso sutil en puntos inactivos */
.timeline-point:not(.active)::before {
    animation: subtlePulse 3s infinite;
}

@keyframes subtlePulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Animación de click en punto */
.timeline-point.clicked {
    animation: clickEffect 0.3s ease;
}

@keyframes clickEffect {
    0% {
        transform: translateY(-3px) scale(1);
    }
    50% {
        transform: translateY(-3px) scale(0.95);
    }
    100% {
        transform: translateY(-3px) scale(1);
    }
}

/* ============================================
   ESTADOS DE CARGA
   ============================================ */

.timeline-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.timeline-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-top: 2px solid var(--timeline-active-point-color, #ff6600);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   ACCESIBILIDAD
   ============================================ */

/* Focus para navegación por teclado - Sin outline visible */
.timeline-point:focus {
    outline: none;
}

/* Reducir animaciones para usuarios con preferencias de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
    .timeline-line-progress,
    .timeline-point,
    .timeline-point::before,
    .timeline-year,
    .timeline-content,
    .timeline-event-image img {
        transition: none;
    }
    
    .timeline-point:not(.active)::before {
        animation: none;
    }
    
    .timeline-eventos {
        animation: none;
    }
}

/* ============================================
   UTILIDADES
   ============================================ */

/* Ocultar elementos cuando no hay JavaScript */
.no-js .timeline-content {
    opacity: 1;
    transform: none;
}

.no-js .timeline-event-display {
    display: block;
}

/* Print styles */
@media print {
    .timeline-eventos {
        break-inside: avoid;
    }
    
    .timeline-point::before {
        background-color: #333 !important;
        box-shadow: none;
    }
    
    .timeline-line-progress,
    .timeline-line {
        background-color: #333 !important;
    }
}