:root {
    --default-header-color: #4CAF50; /* Verde principal para el header global */
    --default-nav-color: #44BBAA; /* Verde azulado para la navegación por defecto */
    --light-bg: #f8f8f8;
    --card-bg: #ffffff;
    --border-color: #ddd;
    --text-color: #333;
}

body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--light-bg);
    color: var(--text-color);
    line-height: 1.6;
}

header {
    background-color: var(--default-header-color);
    color: white;
    padding: 20px 0;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

header h1 {
    margin: 0;
    font-size: 2.8em;
    font-weight: bold;
}

header p {
    margin: 5px 0 0;
    font-size: 1.2em;
    opacity: 0.9;
}

.timeline-wrapper {
    max-width: 1000px;
    margin: 0px auto;
    padding: 20px;
    background-color: #fcfcfc;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    position: relative;
}

.timeline-navigation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background-color: #F8F4E8; /* Fondo suave para la navegación */
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    transition: background-color 0.3s ease; /* Transición para el fondo si cambia */
}

.nav-button {
    background-color: var(--default-nav-color); /* Color por defecto, JS lo cambiará */
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.nav-button:hover {
    filter: brightness(1.1); /* Ligero brillo al pasar el ratón */
    transform: translateY(-2px);
}

.nav-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.current-period-info {
    text-align: center;
}

.current-period-info h2 {
    color: var(--default-nav-color); /* Color por defecto, JS lo cambiará */
    font-size: 2em;
    margin: 0;
    transition: color 0.3s ease;
}

.current-period-info p {
    font-size: 1.1em;
    color: #777;
    margin: 5px 0 0;
}

.timeline-container {
    display: flex;
    overflow: hidden;
    position: relative;
    min-height: 450px;
}

.timeline-item {
    display: none;
    flex-shrink: 0;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    transition: opacity 0.5s ease-in-out;
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

.timeline-item.active {
    display: flex;
    opacity: 1;
    position: relative;
}

.timeline-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    width: calc(33% - 20px); /* 3 tarjetas por fila */
    box-sizing: border-box;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 250px; /* Ajustada para el nuevo diseño */
}

.timeline-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

.timeline-card .card-header {
    display: flex;
    flex-direction: column; /* Icono arriba del título */
    align-items: flex-start; /* Alineación a la izquierda */
    margin-bottom: 10px;
}

.timeline-card .icon {
    font-size: 2.5em; /* Icono más grande */
    color: #4CAF50; /* Color por defecto, se sobrescribe con JS en active */
    margin-bottom: 5px; /* Espacio entre icono y título */
}

.timeline-card h3 {
    margin: 0;
    font-size: 1.3em;
    color: #4CAF50; /* Color por defecto, se sobrescribe con JS en active */
    line-height: 1.3; /* Espacio de línea para títulos largos */
}

.timeline-card p {
    font-size: 1em;
    color: #555;
    margin-top: 5px; /* Espacio entre la descripción y la fecha/ubicación */
    margin-bottom: 10px; /* Espacio entre la descripción y la fecha/ubicación */
    flex-grow: 1; /* Permite que el párrafo ocupe espacio extra */
}

.timeline-card .card-date {
    font-size: 0.95em;
    color: #666;
    font-weight: bold;
    margin-top: auto; /* Empuja la fecha hacia abajo */
    padding-top: 10px; /* Pequeño padding para separar del texto */
}

.timeline-card .card-location {
    font-size: 0.9em;
    color: #888;
    display: flex;
    align-items: center;
    margin-top: 5px; /* Espacio entre fecha y ubicación */
}

.timeline-card .card-location i {
    margin-right: 5px;
    color: #999;
}

/* Estilo específico para la tarjeta de literatura contemporánea */
.timeline-card.full-width-card {
    width: 90%;
    margin: 0 auto;
    padding: 30px;
    text-align: center;
    min-height: auto; /* Restablecer altura mínima para contenido flexible */
}

.timeline-card.full-width-card h3 {
    font-size: 1.8em;
    color: var(--current-nav-color); /* Usar el color del periodo activo */
}

.quote-section {
    background-color: #e2f0e2;
    border-left: 5px solid #28a745;
    padding: 20px;
    margin: 25px auto;
    font-style: italic;
    color: #555;
    border-radius: 4px;
    max-width: 80%;
}

.quote-section h4 {
    margin-top: 0;
    color: #28a745;
    font-size: 1.1em;
}

.quote-section blockquote p {
    font-size: 1.2em;
    line-height: 1.8;
}

.quote-section cite {
    display: block;
    text-align: right;
    margin-top: 15px;
    color: #777;
    font-style: normal;
    font-weight: bold;
    font-size: 1.1em;
}

.quote-author-info {
    font-size: 0.9em;
    color: #666;
    margin-top: 15px;
    text-align: center;
}

.timeline-card.full-width-card img {
    max-width: 40%;
    height: auto;
    border-radius: 8px;
    margin-top: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.timeline-dots-navigation {
    text-align: center;
    margin-top: 30px;
    padding-top: 10px;
    border-top: 1px dashed #eee;
}

.dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin: 0 8px;
    background-color: #ccc;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.dot.active {
    background-color: var(--default-nav-color); /* Color por defecto, JS lo cambiará */
    transform: scale(1.2);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.3); /* Color de sombra dinámico en JS */
}

.dot:hover {
    background-color: #999;
}


footer {
    text-align: center;
    padding: 25px;
    margin-top: 40px;
    background-color: #333;
    color: white;
    font-size: 0.9em;
    border-radius: 0 0 8px 8px;
}

/* Media Queries para responsividad */
@media (max-width: 900px) {
    .timeline-card {
        width: calc(50% - 20px); /* 2 tarjetas por fila */
    }
    .timeline-card.full-width-card {
        width: 95%;
    }
}

@media (max-width: 600px) {
    .timeline-navigation-header {
        flex-direction: column;
        gap: 15px;
    }
    .nav-button {
        width: 100%; /* Botones de navegación al 100% de ancho */
        margin: 0;
    }
    .timeline-card {
        width: 100%; /* 1 tarjeta por fila */
    }
    header h1 {
        font-size: 2em;
    }
    .current-period-info h2 {
        font-size: 1.5em;
    }
    .timeline-card.full-width-card img {
        max-width: 60%;
    }
}