/* Timeline Slider for Portfolio */

.portfolio-with-timeline {
    display: flex;
    flex-direction: row;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    position: relative;
}

/* Timeline Container */
.timeline {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 20px;
    width: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 0;
    z-index: 100;
    overflow: visible;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    pointer-events: none;
    /* Let clicks pass to markers */
}

.timeline>* {
    pointer-events: auto;
}

.timeline.visible {
    opacity: 1;
    visibility: visible;
}

.timeline-year.revealed,
.timeline-dot.revealed,
.timeline-path-dot.revealed {
    opacity: 1;
    transform: translate(-50%, -50%) translateX(0);
}

.timeline-path-dot.revealed {
    opacity: 0.6;
}

.timeline-path-dot {
    position: absolute;
    left: 50%;
    transform: translate(-50%, -50%) translateX(-15px);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent-color);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 2;
}

[data-theme="dark"] .timeline-path-dot {
    background: var(--accent-color);
}


/* Year Cards */
.timeline-year {
    position: relative;
    z-index: 3;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--card-border-color);
    border-radius: 8px;
    padding: 6px 12px;
    margin: 10px 0;
    font-family: 'Raleway', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateX(-20px);
    position: absolute;
    /* Precisely positioned by JS */
    left: 50%;
    transform: translate(-50%, -50%) translateX(-20px);
}

.timeline-year.revealed {
    opacity: 1;
    transform: translate(-50%, -50%) translateX(0);
}


/* Project Dots */
.timeline-dot {
    position: relative;
    z-index: 3;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid var(--card-border-color);
    margin: 8px 0;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateX(-15px);
    position: absolute;
    /* Precisely positioned by JS */
    left: 50%;
    transform: translate(-50%, -50%) translateX(-15px);
}

.timeline-dot.revealed {
    opacity: 1;
    transform: translate(-50%, -50%) translateX(0);
}


.timeline-dot.active {
    background: var(--accent-color);
    border-color: #fff;
    transform: translate(-50%, -50%) scale(1.4);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.3s, background 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .timeline-dot.active {
    background: var(--accent-color);
    border-color: #fff;
}


/* Portfolio adjustments */
.portfolio-with-timeline .portfolio {
    flex: 1;
    min-width: 0;
    margin-left: 60px;
}

.portfolio .project-card {
    margin-bottom: 80px;
    /* Increased spacing for timeline alignment */
}

/* Hide on mobile */
@media (max-width: 1024px) {
    .timeline {
        display: none;
    }

    .portfolio-with-timeline .portfolio {
        margin-left: 0;
    }
}