/* ===========================================
   TIMELINE SECTION
   =========================================== */

#timeline {
    position: relative;
}

#timeline::before {
    content: '';
    position: absolute;
    top: 80px;
    right: -10%;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.10) 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
}

#timeline::after {
    content: '';
    position: absolute;
    bottom: 80px;
    left: -10%;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(244, 114, 182, 0.08) 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
}

/* === Labels (Academic / Professional) === */
.timeline-labels {
    display: grid;
    grid-template-columns: 1fr 4px 1fr;
    column-gap: 60px;
    margin-bottom: 40px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.timeline-labels .label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid;
    backdrop-filter: blur(8px);
    display: inline-block;
    justify-self: end;
    width: fit-content;
}

.timeline-labels .label.academic {
    grid-column: 1;
    color: var(--secondary-color);
    border-color: rgba(129, 140, 248, 0.35);
    background: rgba(129, 140, 248, 0.08);
    justify-self: end;
}

.timeline-labels .label.professional {
    grid-column: 3;
    color: var(--primary-color);
    border-color: rgba(56, 189, 248, 0.35);
    background: rgba(56, 189, 248, 0.08);
    justify-self: start;
}

/* === Timeline grid + spine === */
.timeline {
    position: relative;
    padding: 40px 0;
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 4px 1fr;
    column-gap: 60px;
    row-gap: 60px;
    z-index: 1;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg,
        transparent,
        var(--primary-color) 12%,
        var(--secondary-color) 50%,
        var(--accent-color) 88%,
        transparent);
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.45);
    opacity: 0.7;
}

/* === Entry === */
.entry {
    position: relative;
    margin-bottom: 0;
    display: flex;
    align-items: flex-start;
}

.entry.academic   { grid-column: 1 / 2; justify-self: end;   text-align: left; flex-direction: row-reverse; }
.entry.professional { grid-column: 3 / 4; justify-self: start; text-align: left; }

.entry-image {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.35);
    background: #000;
    z-index: 10;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease, border-color 0.4s ease;
}

.entry.academic   .entry-image { margin-left: 25px; border-color: var(--secondary-color); box-shadow: 0 0 18px rgba(129, 140, 248, 0.35); }
.entry.professional .entry-image { margin-right: 25px; }

.entry:hover .entry-image {
    transform: scale(1.08) rotate(-3deg);
    box-shadow: 0 0 26px rgba(56, 189, 248, 0.55);
}

.entry.academic:hover .entry-image {
    box-shadow: 0 0 26px rgba(129, 140, 248, 0.55);
}

.entry-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* === Card === */
.entry-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 26px 28px;
    position: relative;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.4s ease,
                box-shadow 0.4s ease;
    width: 100%;
    max-width: 500px;
    backdrop-filter: blur(10px);
    overflow: hidden;
}

/* Top gradient accent line that lights up on hover */
.entry-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), var(--secondary-color), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.entry.academic .entry-content::before {
    background: linear-gradient(90deg, transparent, var(--secondary-color), var(--primary-color), transparent);
}

.entry-content:hover {
    transform: translateY(-6px);
    border-color: var(--primary-color);
    box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.6),
                0 0 24px rgba(56, 189, 248, 0.15);
}

.entry.academic .entry-content:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.6),
                0 0 24px rgba(129, 140, 248, 0.18);
}

.entry-content:hover::before { opacity: 1; }

/* === Dots on the central spine === */
.entry::after {
    content: '';
    position: absolute;
    top: 22px;
    width: 14px;
    height: 14px;
    background: var(--bg-dark);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    z-index: 5;
    box-shadow: 0 0 12px var(--primary-color);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.entry.academic::after   { right: -69px; border-color: var(--secondary-color); box-shadow: 0 0 12px var(--secondary-color); }
.entry.professional::after { left: -69px; }

.entry:hover::after {
    background: var(--primary-color);
    transform: scale(1.3);
    box-shadow: 0 0 20px var(--primary-color);
}

.entry.academic:hover::after {
    background: var(--secondary-color);
    box-shadow: 0 0 20px var(--secondary-color);
}

/* === Connectors === */
.entry::before {
    content: '';
    position: absolute;
    top: 28px;
    height: 1px;
    width: 60px;
    background: linear-gradient(90deg, var(--primary-color), transparent);
    opacity: 0.55;
    transition: opacity 0.3s ease;
}

.entry.academic::before   { right: -60px; background: linear-gradient(90deg, transparent, var(--secondary-color)); }
.entry.professional::before { left: -60px; }

.entry:hover::before { opacity: 1; }

/* === Content typography === */
.entry-header h3 {
    font-size: 19px;
    color: var(--primary-color);
    margin: 0;
    line-height: 1.3;
    background: linear-gradient(135deg, var(--text-primary), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.entry.academic .entry-header h3 {
    background: linear-gradient(135deg, var(--text-primary), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.entry-header .organization {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 600;
    margin: 6px 0 8px;
}

.entry-meta {
    font-size: 12.5px;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    margin: 0 0 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
}

.entry-meta .year,
.entry-meta .location {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-glass);
    border-radius: 4px;
    color: var(--text-secondary);
}

.entry-meta .year::before    { content: '⌗ '; color: var(--primary-color); margin-right: 4px; }
.entry-meta .location::before { content: '↪ '; color: var(--accent-color); margin-right: 4px; }

.entry-content p {
    color: var(--text-secondary);
    font-size: 14.5px;
    line-height: 1.65;
    margin: 0 0 8px;
}

.entry-content ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
    text-align: left;
    list-style-position: outside;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.65;
}

.entry-content ul li {
    padding-left: 4px;
    margin-bottom: 4px;
}

.entry-content ul li::marker {
    color: var(--primary-color);
}

.entry.academic .entry-content ul li::marker {
    color: var(--secondary-color);
}

/* === Responsive === */
@media (max-width: 768px) {
    .timeline { grid-template-columns: 1fr; padding-left: 30px; }
    .timeline::before { left: 30px; }

    .entry.academic, .entry.professional {
        grid-column: 1;
        justify-self: start;
        text-align: left;
        flex-direction: row;
        padding-left: 20px;
    }

    .entry.academic .entry-image,
    .entry.professional .entry-image {
        margin-left: 0;
        margin-right: 18px;
        width: 50px;
        height: 50px;
    }

    .entry.academic::after,
    .entry.professional::after {
        left: -37px;
        right: auto;
    }

    .entry::before { display: none; }
    .timeline-labels { display: none; }
}
