/* =====================================================
   Vishnu Gonela Portfolio
   timeline.css — animated vertical experience timeline
===================================================== */

.timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 0;
}

/* Center vertical line */
.timeline::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 3px;
    transform: translateX(-50%);
    background: linear-gradient(
        180deg,
        transparent,
        var(--primary),
        var(--accent),
        transparent
    );
    border-radius: 4px;
}

.timeline-item {
    position: relative;
    width: 50%;
    padding: 10px 45px;
    box-sizing: border-box;
}

/* Left / right alternation */
.timeline-item:nth-child(odd) {
    left: 0;
    text-align: right;
}

.timeline-item:nth-child(even) {
    left: 50%;
    text-align: left;
}

/* Glowing node on the line */
.timeline-item::after {
    content: "";
    position: absolute;
    top: 28px;
    width: 20px;
    height: 20px;
    background: var(--dark2);
    border: 4px solid var(--accent);
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 0 0 4px rgba(6, 182, 212, .18),
                0 0 18px rgba(6, 182, 212, .7);
    animation: nodePulse 2.4s infinite;
}

.timeline-item:nth-child(odd)::after {
    right: -10px;
}

.timeline-item:nth-child(even)::after {
    left: -10px;
}

@keyframes nodePulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(6,182,212,.18), 0 0 14px rgba(6,182,212,.5); }
    50%      { box-shadow: 0 0 0 8px rgba(6,182,212,.06), 0 0 26px rgba(6,182,212,.85); }
}

/* Connector arrow from card to line */
.timeline-item .card-glass {
    position: relative;
}

.timeline-item .card-glass span {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .5px;
    color: var(--accent);
    background: rgba(6, 182, 212, .12);
    padding: 4px 14px;
    border-radius: 50px;
    margin-bottom: 12px;
}

.timeline-item .card-glass h4 {
    font-size: 22px;
    margin-bottom: 2px;
}

.timeline-item .card-glass h5 {
    font-size: 16px;
    color: #cbd5e1;
    margin-bottom: 6px;
    font-weight: 500;
}

body.light-theme .timeline-item .card-glass h5 {
    color: #475569;
}

/* Achievement chips */
.timeline-tags {
    list-style: none;
    padding: 0;
    margin: 14px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.timeline-item:nth-child(odd) .timeline-tags {
    justify-content: flex-end;
}

.timeline-tags li {
    font-size: 13px;
    padding: 5px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .1);
    color: #e2e8f0;
}

.timeline-tags li i {
    color: #22c55e;
    margin-right: 5px;
}

body.light-theme .timeline-tags li {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #334155;
}

/* Scroll reveal */
.timeline-item {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity .6s ease, transform .6s ease;
}

.timeline-item.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive: single column */
@media (max-width: 768px) {
    .timeline::before {
        left: 20px;
    }

    .timeline-item,
    .timeline-item:nth-child(even),
    .timeline-item:nth-child(odd) {
        width: 100%;
        left: 0;
        text-align: left;
        padding-left: 55px;
        padding-right: 10px;
    }

    .timeline-item:nth-child(odd) .timeline-tags,
    .timeline-item .timeline-tags {
        justify-content: flex-start;
    }

    .timeline-item::after,
    .timeline-item:nth-child(odd)::after,
    .timeline-item:nth-child(even)::after {
        left: 10px;
        right: auto;
    }
}
