/* --- Global Styles --- */
body {
    font-family: 'Inter', sans-serif;
    background-color: #0f172a;
    color: #e2e8f0;
    margin: 0;
    padding: 2rem 0;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    text-align: center;
    color: #f8fafc;
    margin-bottom: 2rem;
    font-weight: 700;
}

/* --- Timeline Container --- */
.timeline-container {
    width: 90%;
    max-width: 800px;
    padding: 0 1rem;
    position: relative;
}

/* Vertical line for the timeline */
.timeline-container::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background-color: #334155;
    transform: translateX(-50%);
    z-index: -1;
}

/* --- Timeline Events --- */
.timeline-event {
    display: flex;
    position: relative;
    margin-bottom: 3rem;
    opacity: 0; /* Initially hidden */
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.timeline-event.visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-event:nth-child(even) {
    flex-direction: row-reverse;
}

/* --- Event Date --- */
.timeline-event-date {
    flex-basis: 50%;
    text-align: right;
    padding-right: 2rem;
    font-size: 0.9rem;
    color: #94a3b8;
    position: sticky;
    top: 5rem;
    height: fit-content;
    align-self: flex-start;
}

.timeline-event:nth-child(even) .timeline-event-date {
    text-align: left;
    padding-right: 0;
    padding-left: 2rem;
}

/* --- Event Content --- */
.timeline-event-content {
    flex-basis: 50%;
    padding: 1.5rem;
    background-color: #1e293b;
    border-radius: 0.75rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid #334155;
    cursor: pointer;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.timeline-event-content:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.timeline-event-content h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #cbd5e1;
}

.timeline-event-content p {
    margin: 0;
    font-size: 0.95rem;
    color: #a0aec0;
}

/* --- Modal Styles --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    background-color: #1e293b;
    padding: 2.5rem;
    border-radius: 1rem;
    max-width: 90%;
    width: 500px;
    position: relative;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    border: 1px solid #334155;
    transform: scale(0.95);
    transition: transform 0.3s ease-in-out;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-close-button {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.5rem;
    color: #e2e8f0;
    cursor: pointer;
    transition: color 0.2s ease-in-out;
}

.modal-close-button:hover {
    color: #ef4444;
}

#modalTitle {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 1rem;
    color: #cbd5e1;
}

#modalDescription {
    color: #a0aec0;
    margin-bottom: 1.5rem;
}

/* New styles for multiple links */
.modal-links-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.modal-links-container a {
    color: #60a5fa;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease-in-out;
}

.modal-links-container a:hover {
    color: #3b82f6;
    text-decoration: underline;
}


/* --- Footer --- */
footer {
    font-size: 0.8rem;
    color: #64748b;
    padding: 2rem;
}

.copyleft {
    display: inline-block;
    transform: rotate(180deg);
}

/* --- Responsive Design --- */
@media (max-width: 600px) {
    .timeline-container::before {
        left: 1rem;
    }

    .timeline-event,
    .timeline-event:nth-child(even) {
        flex-direction: column;
        text-align: left;
    }

    .timeline-event-date {
        text-align: left;
        padding: 0 0 1rem 1.5rem;
        position: static;
    }

    .timeline-event:nth-child(even) .timeline-event-date {
        padding: 0 0 1rem 1.5rem;
    }

    .timeline-event-content {
        margin-left: 1rem;
    }
}
