h2 {
    text-align: center;
    padding: 2rem 0;
    font-size: 2rem;
}

.timeline {
    position: relative;
    width: 80%;
    margin: 0 auto;
    padding: 2rem 0;
}

/* Central Line */
.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: #ccc;
}

/* Timeline Item */
.timeline-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    background: #ccc;
    border-radius: 50%;
    z-index: 1;
}

/* Year Label */
.timeline-year {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: var(--background-color, #111);
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border-radius: 5px;
    font-weight: bold;
    z-index: 2;
    color: white;
}

/* Card Content */
.timeline-card {
    background: #222;
    border: 1px solid var(--text-color, #444);
    padding: 1rem;
    border-radius: 1rem;
    width: 20%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.timeline-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    color: var(--accent-color, #f5c542);
}

.timeline-card p {
    margin: 0;
    font-size: 0.9rem;
    color: #fff;
}

.timeline-icon {
    font-size: 2rem;
    color: var(--text-color, #f5c542);
    margin-right: 1rem;
}

/* Positioning for Cards */
.left-card {
    text-align: right;
    margin-right: auto; /* Pushes the card to the left */
}

.right-card {
    text-align: left;
    margin-left: auto; /* Pushes the card to the right */
}

/* Mobile Styles */
@media only screen and (max-width: 767px) {
    .timeline {
        width: 90%;
        padding: 1rem 0;
    }

    .timeline-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-bottom: 2rem;
    }

    .timeline-item::before {
        left: 50%;
        transform: translateX(-50%);
    }

    /* Keep the year centered above the line */
    .timeline-year {
        position: relative;
        left: 50%;
        transform: translateX(-50%);
        margin: 1rem 0;
        display: inline-block;
    }

    .timeline-card {
        width: 100%; /* Cards now take full width on mobile */
        margin: 1rem 0; /* Space between stacked cards */
        text-align: left;
    }

    .timeline-icon {
        margin: 0 auto 1rem; /* Center the icon */
    }

    .left-card, .right-card {
        margin: 0; /* Remove extra spacing, center them */
        text-align: left; /* Center card text */
    }
}
