/* Color Variables */
:root {
    --teal-dark: #0a979e;
    --teal-light: #47d1ae;
}

.main-timeline {
    position: relative;
    padding: 40px 0;
}

/* The Vertical Line */
.main-timeline::before {
    content: "";
    position: absolute;
    width: 2px;
    background: var(--teal-light);
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.timeline-item {
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 60px;
}

/* Zig-Zag Logic */
.timeline-item:nth-child(even) {
    flex-direction: row-reverse;
}

.timeline-date,
.timeline-content {
    width: 50%;
    padding: 0 50px;
    position: relative;
}

.timeline-item:nth-child(even) .timeline-content {
    text-align: right;
}

/* The Double Rectangle (The "Design") */
.date-outer {
    width: 140px;
    height: 80px;
    margin: auto;
    position: relative;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.date-outer::before,
.date-outer::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid;
    border-radius: 15px;
    /* Your original design style */
    transition: all 0.3s ease;
}

/* Offset Borders */
.date-outer::before {
    border-color: var(--teal-dark);
    left: -6px;
    top: -6px;
}

.date-outer::after {
    border-color: var(--teal-light);
    left: 6px;
    top: 6px;
}

/* Interactive Hover */
.timeline-item:hover .date-outer::before {
    left: 6px;
    top: 6px;
}

.timeline-item:hover .date-outer::after {
    left: -6px;
    top: -6px;
}

.year {
    font-weight: 700;
    color: var(--teal-dark);
    font-size: 1.2rem;
}

/* Content Styles */
.timeline-content .title {
    font-weight: 700;
    margin-bottom: 10px;
}

/* Connector Horizontal Line */
.timeline-date::before {
    content: "";
    position: absolute;
    height: 2px;
    background: var(--teal-light);
    width: calc(50% - 70px);
    top: 50%;
    z-index: 1;
}

.timeline-item:nth-child(odd) .timeline-date::before {
    right: 0;
}

.timeline-item:nth-child(even) .timeline-date::before {
    left: 0;
}

/* Mobile Support */
@media (max-width: 768px) {
    .main-timeline::before {
        left: 20px;
    }

    .timeline-item,
    .timeline-item:nth-child(even) {
        flex-direction: column;
        align-items: flex-start;
    }

    .timeline-date,
    .timeline-content {
        width: 100%;
        padding-left: 60px;
        text-align: left !important;
    }

    .date-outer {
        margin: 0 0 20px 0;
        width: 110px;
        height: 60px;
    }

    .timeline-date::before {
        display: none;
    }
}