#history-timeline.timeline-container {
    max-width: 1200px; /* Increased for more spacious layout */
    margin: 0 auto;
    padding: 20px 10px; /* Reduced side padding for more edge-to-edge content */
    font-family: 'Arial', sans-serif;
    background: var(--color-one);
}

.timeline {
    position: relative;
    margin: 0 auto;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 8px; /* Slightly thicker for visibility */
    background: var(--color-two);
    left: 50%;
    margin-left: -4px;
    border-radius: 4px;
}

.timeline-item {
    padding: 10px 20px; /* Reduced padding for more content space */
    position: relative;
    width: 48%; /* Slightly narrower to fit comfortably */
    box-sizing: border-box;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-item.left {
    left: 0;
}

.timeline-item.right {
    left: 52%; /* Adjusted for balance */
}

.timeline-item::before {
    content: '';
    position: absolute;
    width: 24px; /* Larger marker for visual impact */
    height: 24px;
    background: var(--color-four);
    border-radius: 50%;
    top: 20px;
    z-index: 1;
    border: 2px solid var(--color-one);
}

.timeline-item.left::before {
    right: -12px;
}

.timeline-item.right::before {
    left: -12px;
}

.timeline-content {
    padding: 20px;
    background: var(--color-one);
    border-radius: 16px; /* Larger border radius for softer look */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* Subtle shadow with --color-three */
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--color-three);
}

.timeline-content:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.timeline-content h3 {
    margin: 0 0 12px;
    color: var(--color-two);
    font-size: 1.6em; /* Slightly larger for readability */
    position: relative;
    cursor: pointer;
}

.timeline-content p {
    margin: 0 0 12px;
    color: var(--color-two);
    font-size: 1em;
    line-height: 1.5; /* Improved readability */
}

.timeline-content a {
    color: var(--color-four);
    text-decoration: none;
    font-weight: bold;
}

.timeline-content a:hover {
    text-decoration: underline;
}

.belligerents {
    font-size: 0.85em; /* Slightly smaller for hierarchy */
    color: var(--color-two);
    opacity: 0.8;
    margin-top: 12px;
}

.commanders-popup {
    position: absolute;
    top: -10px;
    left: 100%;
    background: var(--color-two);
    color: var(--color-one);
    padding: 12px;
    border-radius: 12px; /* Larger radius for consistency */
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    z-index: 10;
    display: none;
    width: 220px;
    transform: translateY(-50%);
}

.timeline-content h3:hover .commanders-popup {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .timeline::before {
        left: 30px; /* Moved slightly right for better alignment */
    }
    .timeline-item {
        width: 100%; /* Full width for more space */
        padding: 10px 20px 10px 60px; /* Adjusted padding for edge-to-edge feel */
    }
    .timeline-item.left,
    .timeline-item.right {
        left: 0;
    }
    .timeline-item::before {
        left: 18px;
    }
    .timeline-content {
        border-radius: 12px; /* Slightly smaller but still rounded */
        margin-right: 10px; /* Prevent overflow */
    }
    .commanders-popup {
        left: 0;
        top: 100%;
        width: 90%; /* Wider popup on mobile */
        margin-top: 10px;
    }
}