.education-timeline,
.experience-timeline {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 0;
}

/* Central line */
.education-timeline::after,
.experience-timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background: var(--primary-color);
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    width: calc(50% - 30px);
    margin-bottom: 50px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

/* Alternating items */
.timeline-item:nth-child(odd) {
    left: 0;
    padding-right: 40px;
}

.timeline-item:nth-child(even) {
    left: calc(50% + 30px);
    padding-left: 40px;
}

/* Dots on the timeline */
.timeline-item::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-color);
    border: 3px solid var(--primary-color);
    top: 25px;
    z-index: 1;
}

/* Position dots */
.timeline-item:nth-child(odd)::before {
    right: -38px;
}

.timeline-item:nth-child(even)::before {
    left: -38px;
}

/* Connecting lines */
.timeline-item::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 2px;
    background: var(--primary-color);
    top: 32px;
}

/* Position connecting lines */
.timeline-item:nth-child(odd)::after {
    right: -30px;
}

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

.timeline-content {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    position: relative;
}

.timeline-content:hover {
    transform: translateY(-5px);
}

/* Arrow pointers */
.timeline-content::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
    top: 24px;
}

/* Position arrows */
.timeline-item:nth-child(odd) .timeline-content::before {
    right: -10px;
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent var(--card-bg);
}

.timeline-item:nth-child(even) .timeline-content::before {
    left: -10px;
    border-width: 10px 10px 10px 0;
    border-color: transparent var(--card-bg) transparent transparent;
}

.timeline-date {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.timeline-title {
    color: var(--text-color);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.timeline-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 15px;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.tech-tag {
    background: var(--primary-color);
    color: var(--bg-color);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .education-timeline::after,
    .experience-timeline::after {
        left: 31px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }

    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        left: 0;
    }

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

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

    .timeline-content {
        padding: 20px;
    }

    .timeline-date {
        font-size: 0.9rem;
    }

    .timeline-title {
        font-size: 1.1rem;
    }

    .timeline-description {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .education-timeline,
    .experience-timeline {
        padding: 30px 0;
    }

    .timeline-item {
        padding-left: 60px;
        padding-right: 15px;
        margin-bottom: 40px;
    }

    .timeline-content {
        padding: 15px;
    }
}

@media (hover: none) {
    .timeline-content:hover {
        transform: none;
    }
}
