/* Timeline Horizontal Container */
.timeline-horizontal-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 60px 0;
    overflow: hidden;
}

/* Navigation Buttons */
.timeline-nav-btn {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.timeline-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.timeline-nav-btn:not(:disabled):hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Timeline Wrapper */
.timeline-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
    height: 600px;
    display: flex;
    align-items: center;
}

/* Timeline Line - Horizontal in the center */
.timeline-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    transform: translateY(-50%);
    z-index: 1;
    pointer-events: none;
}

/* Timeline Track - Contains all items */
.timeline-track {
    display: flex;
    gap: 80px;
    position: relative;
    transition: left 0.5s ease;
    left: 0;
    padding: 0;
    margin: 0;

    /*
      IMPORTANT:
      Each .timeline-item must have the same height as the wrapper so that
      the connector's top/bottom offsets (e.g. 300px) are calculated against
      a stable reference.
      If the item height collapses to the card content, the icons/dots drift
      away from the center line (the issue seen in the screenshot).
    */
    height: 100%;
    align-items: stretch;
}

/* Timeline Item - Each event */
.timeline-item {
    position: relative;
    flex-shrink: 0;
    width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;

    /* Make every item as tall as the wrapper to keep the connector centered */
    height: 100%;
}

/* Items that go ABOVE the line */
.timeline-item-top {
    justify-content: flex-end;
    padding-bottom: 300px; /* Space for card below */
}

/* Items that go BELOW the line */
.timeline-item-bottom {
    justify-content: flex-start;
    padding-top: 300px; /* Space for card above */
}

/* Timeline Card */
.timeline-card {
    width: 100%;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

/* Card positioning */
.timeline-item-top .timeline-card {
    margin-bottom: 80px;
}

.timeline-item-bottom .timeline-card {
    margin-top: 80px;
}

.timeline-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

/* Timeline Image */
.timeline-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.timeline-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.timeline-card:hover .timeline-image img {
    transform: scale(1.05);
}

/* Timeline Card Content */
.timeline-card-content {
    padding: 20px;
}

/* Timeline Date */
.timeline-date {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Timeline Title */
.timeline-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

/* Timeline Content */
.timeline-content {
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

.timeline-content p {
    margin: 0 0 10px 0;
}

.timeline-content p:last-child {
    margin-bottom: 0;
}

/* Timeline Connector - Icon + Dot centered on line */
.timeline-connector {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 5;
}

/* Make connector appear at line level for both top and bottom */
.timeline-item-top .timeline-connector {
    top: auto;
    bottom: 300px;
    transform: translate(-50%, 50%);
}

.timeline-item-bottom .timeline-connector {
    top: 300px;
    transform: translate(-50%, -50%);
}

/* Timeline Dot */
.timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 3px solid;
    z-index: 3;
    transition: transform 0.3s ease;
    background: inherit;
}

.timeline-item:hover .timeline-dot {
    transform: scale(1.3);
}

/* Timeline Icon */
.timeline-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-top: 10px;
}

.timeline-item:hover .timeline-icon {
    transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .timeline-item {
        width: 250px;
    }
    
    .timeline-track {
        gap: 60px;
    }
}

@media (max-width: 768px) {
    .timeline-horizontal-container {
        gap: 10px;
        padding: 40px 0;
    }
    
    .timeline-nav-btn {
        width: 40px;
        height: 40px;
    }
    
    .timeline-wrapper {
        height: 500px;
    }
    
    .timeline-item {
        width: 220px;
    }
    
    .timeline-item-top {
        padding-bottom: 250px;
    }
    
    .timeline-item-bottom {
        padding-top: 250px;
    }
    
    .timeline-item-top .timeline-connector {
        bottom: 250px;
    }
    
    .timeline-item-bottom .timeline-connector {
        top: 250px;
    }
    
    .timeline-track {
        gap: 40px;
    }
    
    .timeline-image {
        height: 140px;
    }
    
    .timeline-icon {
        width: 40px;
        height: 40px;
    }
    
    .timeline-item-top .timeline-card {
        margin-bottom: 60px;
    }
    
    .timeline-item-bottom .timeline-card {
        margin-top: 60px;
    }
}

@media (max-width: 480px) {
    .timeline-wrapper {
        height: 450px;
    }
    
    .timeline-item {
        width: 200px;
    }
    
    .timeline-item-top {
        padding-bottom: 225px;
    }
    
    .timeline-item-bottom {
        padding-top: 225px;
    }
    
    .timeline-item-top .timeline-connector {
        bottom: 225px;
    }
    
    .timeline-item-bottom .timeline-connector {
        top: 225px;
    }
    
    .timeline-card-content {
        padding: 15px;
    }
    
    .timeline-title {
        font-size: 16px;
    }
    
    .timeline-content {
        font-size: 13px;
    }
    
    .timeline-item-top .timeline-card {
        margin-bottom: 50px;
    }
    
    .timeline-item-bottom .timeline-card {
        margin-top: 50px;
    }
}

/* Animation for initial load */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.timeline-card {
    animation: fadeInUp 0.5s ease backwards;
}

.timeline-item:nth-child(1) .timeline-card { animation-delay: 0.1s; }
.timeline-item:nth-child(2) .timeline-card { animation-delay: 0.2s; }
.timeline-item:nth-child(3) .timeline-card { animation-delay: 0.3s; }
.timeline-item:nth-child(4) .timeline-card { animation-delay: 0.4s; }
.timeline-item:nth-child(5) .timeline-card { animation-delay: 0.5s; }
.timeline-item:nth-child(6) .timeline-card { animation-delay: 0.6s; }
