﻿body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f4f4;
    color: #333;
    line-height: 1.6;
}

h1 {
    text-align: center;
    margin-bottom: 50px;
}

#timeline-container {
    position: relative;
    width: 90%;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 0;
}

    #timeline-container::before {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        left: 50%;
        width: 4px;
        background-color: #a39036;
        transform: translateX(-50%);
    }

.timeline-event {
    position: relative;
    width: 50%;
    margin-bottom: 50px;
    cursor: pointer;
    box-sizing: border-box; /* <<< THIS IS THE FIX */
}

    .timeline-event:nth-child(odd) {
        left: 0;
        padding-right: 40px;
        text-align: right;
    }

        .timeline-event:nth-child(odd):hover {
            background: linear-gradient( to left, rgba(163, 144, 54, 0.8) 10%, rgba(163, 144, 54, 0.2) 70%, transparent 100% );
        }

    .timeline-event:nth-child(even) {
        left: 50%;
        padding-left: 40px;
    }

    .timeline-event:nth-child(even):hover {
        background: linear-gradient( to right, rgba(163, 144, 54, 0.8) 10%, rgba(163, 144, 54, 0.2) 70%, transparent 100% );
    }

    .timeline-event::after {
        content: '';
        position: absolute;
        top: 20px;
        width: 12px;
        height: 12px;
        background-color: #fff;
        border: 4px solid #a39036;
        border-radius: 50%;
        z-index: 1;
        /* Total width of dot is 12px + 4px border + 4px border = 20px. Half is 10px. */
    }

    .timeline-event:nth-child(odd)::after {
        right: -10px; /* Positioned relative to the 50% width box-edge */
    }

    .timeline-event:nth-child(even)::after {
        left: -10px; /* Positioned relative to the 50% width box-edge */
    }

.event-date {
    font-size: 1.2em;
    font-weight: bold;
    color: #a39036;
}

.event-title {
    font-size: 1.5em;
    margin-top: 5px;
}

/* Container remains full screen */
#popup-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    justify-content: flex-end; /* align popup to the right */
    align-items: stretch;
}

    /* Hidden state */
    #popup-container.hidden {
        display: none;
    }

/* Popup content that slides in */
#popup-content {
    position: relative;
    background-color: #fff;
    padding: 40px;
    width: 500px;
    max-width: 100%;
    overflow-y: auto;
    max-height: 100%;
    box-shadow: -2px 0 15px rgba(0,0,0,0.3);
    transform: translateX(100%);
    transition: transform 0.5s ease;
}

/* Active popup (slid in) */
#popup-container.show #popup-content {
    transform: translateX(0);
}

#close-popup {
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

    #close-popup:hover {
        color: #333;
    }

#popup-body h2 {
    margin-top: 0;
    color: #a39036;
}

#popup-body ul {
    list-style-type: disc;
    padding-left: 20px;
}

#popup-body img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin-top: 15px;
}

.divHighlight {
    padding: 0 5%;
    color: black;
    background-color: #FFE082;
    border: 1px solid black;
    position: relative;
}

.titleHighlight {
    text-align: center;
    font-size: 22px;
}

.hrHighlight {
    width: 92%;
    border-top: 1px solid black;
    margin-left: 8%;
    border-bottom:unset!important;
}

.active-event:nth-child(odd) {
    background: linear-gradient( to left, rgba(163, 144, 54, 0.8) 10%, rgba(163, 144, 54, 0.2) 80%, transparent 100% );
}

.active-event:nth-child(even) {
    background: linear-gradient( to right, rgba(163, 144, 54, 0.8) 10%, rgba(163, 144, 54, 0.2) 80%, transparent 100% );
}

.active-event.event-date {
    color: green;
}

.active-event.event-title {
    color: green;
}

.timeline-event {
    transition: background-color 0.3s ease, color 0.3s ease;
    cursor: pointer;
}
