/* Timeline Styles */

.timeline-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    padding: 2rem 0 4rem;
    margin: 2rem 0;
    position: relative;
}

.timeline-wrapper {
    display: flex;
    gap: 4rem;
    padding: 2rem;
    min-width: min-content;
    position: relative;
}

/* Timeline connector line */
.timeline-wrapper::before {
    content: '';
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        rgba(139, 92, 246, 0.3) 0%, 
        rgba(139, 92, 246, 0.6) 50%, 
        rgba(139, 92, 246, 0.3) 100%);
    z-index: 0;
}

/* Year Section */
.timeline-year {
    min-width: 350px;
    max-width: 400px;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease-out forwards;
    animation-delay: calc(var(--year-index, 0) * 0.1s);
}

.timeline-year:nth-child(1) { --year-index: 0; }
.timeline-year:nth-child(2) { --year-index: 1; }
.timeline-year:nth-child(3) { --year-index: 2; }
.timeline-year:nth-child(4) { --year-index: 3; }
.timeline-year:nth-child(5) { --year-index: 4; }
.timeline-year:nth-child(6) { --year-index: 5; }
.timeline-year:nth-child(7) { --year-index: 6; }
.timeline-year:nth-child(8) { --year-index: 7; }

.year-marker {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1.5rem;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.year-marker:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 40px rgba(139, 92, 246, 0.4);
}

.year-marker::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: #667eea;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.9);
    z-index: 3;
}

.timeline-year.active .year-marker::after {
    background: #fbbf24;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.6);
    animation: pulse 2s ease-in-out infinite;
}

.year-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.year-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 400;
}

/* Milestones */
.milestones {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.milestone {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.milestone:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateX(5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.milestone-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.milestone-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.milestone-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    margin: 0;
    flex: 1;
    min-width: 150px;
}

.milestone-date {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.milestone-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease, margin-top 0.4s ease;
    opacity: 0;
}

.milestone.expanded .milestone-content {
    max-height: 800px;
    opacity: 1;
    margin-top: 1rem;
}

.milestone-image-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.milestone-image-placeholder:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
    border-color: rgba(255, 255, 255, 0.3);
}

.milestone-image-placeholder span {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.95rem;
}

.milestone-image-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.milestone-story {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    font-size: 0.95rem;
    margin: 0;
}

/* Instructions */
.timeline-instructions {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    margin: 3rem auto;
    max-width: 600px;
}

.timeline-instructions h3 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.timeline-instructions p {
    color: rgba(255, 255, 255, 0.7);
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateX(-50%) scale(1.3);
        opacity: 0.8;
    }
}

/* Scrollbar styling */
.timeline-container::-webkit-scrollbar {
    height: 10px;
}

.timeline-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.timeline-container::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

.timeline-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #764ba2 0%, #667eea 100%);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .timeline-wrapper {
        gap: 2rem;
        padding: 1rem;
    }

    .timeline-year {
        min-width: 280px;
        max-width: 300px;
    }

    .year-number {
        font-size: 2rem;
    }

    .year-subtitle {
        font-size: 0.9rem;
    }

    .milestone-title {
        font-size: 1rem;
    }

    .milestone-image-placeholder {
        height: 150px;
    }

    .timeline-instructions {
        padding: 1.5rem;
        margin: 2rem 1rem;
    }

    .timeline-instructions h3 {
        font-size: 1.1rem;
    }

    .timeline-instructions p {
        font-size: 0.85rem;
    }
}

/* Touch feedback for mobile */
@media (hover: none) {
    .milestone:active {
        transform: scale(0.98);
    }
    
    .year-marker:active {
        transform: scale(0.97);
    }
}

/* Progress indicator */
.timeline-progress {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    color: white;
    font-size: 0.85rem;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.timeline-progress.visible {
    opacity: 1;
}
