/* Animated Timeline Styles */
.animated-timeline {
    position: relative;
    padding: 2rem 0;
}

.timeline-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline-container::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--secondary) 100%);
    z-index: 1;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateX(-20px);
    animation: slideInLeft 0.6s ease forwards;
}

.timeline-item:nth-child(even) {
    animation-delay: 0.1s;
}

.timeline-item:nth-child(3) {
    animation-delay: 0.2s;
}

.timeline-item:nth-child(4) {
    animation-delay: 0.3s;
}

.timeline-item:nth-child(5) {
    animation-delay: 0.4s;
}

.timeline-item:nth-child(6) {
    animation-delay: 0.5s;
}

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.timeline-marker {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 2;
}

.marker-icon {
    width: 60px;
    height: 60px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    border: 3px solid var(--bs-body-bg);
}

.timeline-item:hover .marker-icon {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.timeline-line {
    position: absolute;
    left: 29px;
    top: 60px;
    width: 2px;
    height: calc(100% + 2rem);
    background: var(--primary);
    opacity: 0.3;
}

.timeline-item:last-child .timeline-line {
    display: none;
}

.timeline-content {
    margin-left: 80px;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.timeline-content::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 20px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid var(--bs-border-color);
    transition: border-color 0.3s ease;
}

.timeline-item:hover .timeline-content {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary);
}

.timeline-item:hover .timeline-content::before {
    border-right-color: var(--primary);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.timeline-title-section {
    flex: 1;
}

.timeline-title {
    margin: 0 0 0.5rem 0;
    color: var(--bs-body-color);
    font-weight: 600;
    font-size: 1.1rem;
}

.timeline-subtitle {
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.timeline-date {
    color: var(--bs-secondary-color);
    font-size: 0.9rem;
    font-style: italic;
}

.timeline-toggle {
    color: var(--bs-secondary-color);
    transition: transform 0.3s ease;
}

.timeline-item.expanded .timeline-toggle {
    transform: rotate(180deg);
}

.timeline-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 0;
}

.timeline-item.expanded .timeline-details {
    max-height: 1000px;
    opacity: 1;
}

.timeline-description {
    color: var(--bs-body-color);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.timeline-bullets {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.timeline-bullets li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--bs-body-color);
    line-height: 1.5;
}

.timeline-bullets li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

.timeline-tech-stack {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--bs-border-color);
}

.timeline-tech-stack h6 {
    color: var(--bs-body-color);
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tag {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.tech-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.timeline-link {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--bs-border-color);
}

/* Dark mode adjustments */
[data-bs-theme="dark"] .timeline-content {
    background: var(--bs-dark);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .timeline-content::before {
    border-right-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .timeline-item:hover .timeline-content::before {
    border-right-color: var(--primary);
}

/* Responsive design */
@media (max-width: 768px) {
    .timeline-container::before {
        left: 20px;
    }
    
    .marker-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .timeline-line {
        left: 19px;
    }
    
    .timeline-content {
        margin-left: 60px;
        padding: 1rem;
    }
    
    .timeline-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .timeline-toggle {
        align-self: flex-end;
    }
    
    .tech-tags {
        gap: 0.25rem;
    }
    
    .tech-tag {
        font-size: 0.75rem;
        padding: 0.2rem 0.6rem;
    }
}

/* Animation for expanding content */
.timeline-details > * {
    animation: fadeInUp 0.4s ease forwards;
    animation-delay: 0.1s;
    opacity: 0;
    transform: translateY(10px);
}

.timeline-item.expanded .timeline-details > * {
    animation: fadeInUp 0.4s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
