/* Timeline Styles */
.timeline {
    position: relative;
    max-width: 100%;
    margin: 2rem 0;
    padding: 1rem 0;
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, #7868E6, #B8B5FF, #E4FBFF);
    transform: translateX(-50%);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    opacity: 1;
}

.timeline-item:nth-child(odd) {
    flex-direction: row;
}

.timeline-item:nth-child(even) {
    flex-direction: row-reverse;
}

.timeline-content {
    background: white;
    padding: 1.5rem;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(120, 104, 230, 0.1);
    border: 2px solid #E4FBFF;
    width: calc(50% - 30px);
    position: relative;
    margin: 0 20px;
    box-sizing: border-box;
    max-width: 100%;
    transition: all 0.3s ease;
}

.timeline-content:hover {
    box-shadow: 0 6px 24px rgba(120, 104, 230, 0.15);
    border-color: #B8B5FF;
    transform: scale(1.02);
}

.timeline-item:nth-child(odd) .timeline-content {
    margin-right: 20px;
    margin-left: 0;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-left: 20px;
    margin-right: 0;
}

.timeline-content::before {
    content: '';
    position: absolute;
    top: 50%;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    transform: translateY(-50%);
}

.timeline-item:nth-child(odd) .timeline-content::before {
    right: -20px;
    border-left-color: white;
}

.timeline-item:nth-child(even) .timeline-content::before {
    left: -20px;
    border-right-color: white;
}

.timeline-marker {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: #7868E6;
    border: 4px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.timeline-marker.current {
    background: #FFB4B4;
    animation: pulse 2s infinite;
}

.timeline-marker.completed {
    background: #4CAF50;
}

.timeline-marker.upcoming {
    background: #B8B5FF;
}

@keyframes pulse {
    0% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.2); }
    100% { transform: translateX(-50%) scale(1); }
}

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

.timeline-date {
    font-weight: 600;
    color: #7868E6;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timeline-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.timeline-description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.timeline-details {
    background: linear-gradient(135deg, #F9F9FF 0%, #E4FBFF 100%);
    padding: 1.25rem;
    border-radius: 10px;
    border: 2px solid #E4FBFF;
    border-left: 4px solid #7868E6;
    margin-top: 0.5rem;
}

.timeline-details h4 {
    color: #7868E6;
    margin-bottom: 0.75rem;
    font-size: 1.05rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timeline-details h4::before {
    content: '📋';
    font-size: 1.2rem;
}

.timeline-details ul {
    margin-left: 1.25rem;
    color: #666;
}

.timeline-details li {
    margin-bottom: 0.4rem;
    line-height: 1.5;
}

.timeline-details p {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #E4FBFF;
    color: #7868E6;
    font-weight: 600;
}

/* Timeline Status Indicators */
.status-indicator {
    display: inline-block;
    padding: 0.35rem 0.875rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid transparent;
}

.status-current {
    background: linear-gradient(135deg, #FFB4B4, #FFC9C9);
    color: #8B0000;
    border-color: #FFB4B4;
}

.status-completed {
    background: linear-gradient(135deg, #E8F5E8, #C8E6C9);
    color: #2E7D32;
    border-color: #81C784;
}

.status-upcoming {
    background: linear-gradient(135deg, #E4FBFF, #B3E5FC);
    color: #0277BD;
    border-color: #4FC3F7;
}

/* Timeline Summary */
.timeline-summary {
    background: linear-gradient(135deg, #7868E6, #B8B5FF);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: center;
}

.timeline-summary h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.stat-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    display: block;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Timeline Controls */
.timeline-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.timeline-filter {
    padding: 0.5rem 1rem;
    border: 2px solid #7868E6;
    background: white;
    color: #7868E6;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.timeline-filter.active,
.timeline-filter:hover {
    background: #7868E6;
    color: white;
}

/* Responsive Timeline */
@media (max-width: 768px) {
    .timeline {
        padding: 0.5rem 0;
    }

    .timeline::before {
        left: 30px;
        width: 3px;
    }
    
    .timeline-item {
        flex-direction: row !important;
        margin-bottom: 2rem;
    }
    
    .timeline-content {
        width: calc(100% - 70px);
        margin-left: 50px !important;
        margin-right: 0 !important;
        padding: 1.25rem;
    }
    
    .timeline-content::before {
        left: -15px !important;
        right: auto !important;
        border-right-color: white !important;
        border-left-color: transparent !important;
        border-width: 8px;
    }
    
    .timeline-marker {
        left: 30px;
        transform: translateX(-50%);
        width: 18px;
        height: 18px;
        border: 3px solid white;
    }
    
    .timeline-summary {
        padding: 1.5rem;
    }
    
    .summary-stats {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .stat-item {
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .timeline-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .timeline-filter {
        width: 100%;
        max-width: 250px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .timeline::before {
        left: 20px;
        width: 2px;
    }

    .timeline-content {
        width: calc(100% - 40px);
        margin-left: 32px !important;
        padding: 1rem;
        font-size: 0.9rem;
        border-radius: 12px;
    }

    .timeline-content::before {
        left: -12px !important;
        border-width: 6px;
    }

    .timeline-marker {
        left: 20px;
        width: 14px;
        height: 14px;
        border: 2px solid white;
    }
    
    .timeline-date {
        font-size: 0.9rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .status-indicator {
        font-size: 0.7rem;
        padding: 0.3rem 0.7rem;
        margin-top: 0.25rem;
    }
    
    .timeline-title {
        font-size: 1.05rem;
        line-height: 1.3;
    }
    
    .timeline-description {
        font-size: 0.85rem;
        line-height: 1.5;
    }
    
    .timeline-details {
        padding: 0.875rem;
        font-size: 0.875rem;
    }

    .timeline-details h4 {
        font-size: 0.95rem;
    }

    .timeline-details ul {
        margin-left: 0.75rem;
    }

    .timeline-details li {
        font-size: 0.825rem;
        margin-bottom: 0.35rem;
    }
    
    .summary-stats {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .stat-item {
        padding: 0.875rem;
    }

    .stat-number {
        font-size: 1.3rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }
}

@media (max-width: 375px) {
    .timeline::before {
        left: 16px;
        width: 2px;
    }

    .timeline-content {
        width: calc(100% - 30px);
        margin-left: 24px !important;
        padding: 0.875rem;
        border-radius: 10px;
    }

    .timeline-content::before {
        left: -10px !important;
        border-width: 5px;
    }

    .timeline-marker {
        left: 16px;
        width: 12px;
        height: 12px;
        border: 2px solid white;
    }

    .timeline-date {
        font-size: 0.85rem;
        flex-wrap: wrap;
    }

    .status-indicator {
        font-size: 0.65rem;
        padding: 0.25rem 0.6rem;
    }

    .timeline-title {
        font-size: 1rem;
        line-height: 1.3;
    }

    .timeline-description {
        font-size: 0.8rem;
        line-height: 1.4;
    }

    .timeline-details {
        padding: 0.75rem;
        font-size: 0.825rem;
    }

    .timeline-details h4 {
        font-size: 0.875rem;
        margin-bottom: 0.4rem;
    }

    .timeline-details ul {
        margin-left: 0.5rem;
    }

    .timeline-details li {
        font-size: 0.775rem;
        line-height: 1.4;
    }

    .summary-stats {
        grid-template-columns: 1fr;
    }

    .timeline-summary {
        padding: 1.125rem;
    }

    .timeline-summary h3 {
        font-size: 1.25rem;
    }
}

@media (max-width: 320px) {
    .timeline::before {
        left: 14px;
    }

    .timeline-content {
        width: calc(100% - 26px);
        margin-left: 20px !important;
        padding: 0.75rem;
        border-radius: 8px;
    }

    .timeline-marker {
        left: 14px;
        width: 10px;
        height: 10px;
    }

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

    .status-indicator {
        font-size: 0.6rem;
        padding: 0.2rem 0.5rem;
        letter-spacing: 0.3px;
    }

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

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

    .timeline-details {
        padding: 0.65rem;
    }

    .timeline-details h4 {
        font-size: 0.825rem;
    }

    .timeline-details li {
        font-size: 0.725rem;
    }

    .timeline-summary {
        padding: 1rem;
    }

    .timeline-summary h3 {
        font-size: 1.15rem;
    }
}

/* Print Styles for Timeline */
@media print {
    .timeline::before {
        background: #000 !important;
    }
    
    .timeline-marker {
        background: #000 !important;
        border-color: #fff !important;
    }
    
    .timeline-content {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
    
    .timeline-summary {
        background: #f5f5f5 !important;
        color: #000 !important;
    }
    
    .timeline-controls {
        display: none !important;
    }
}

/* Animation Delays for Staggered Effect */
.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }
.timeline-item:nth-child(5) { animation-delay: 0.5s; }
.timeline-item:nth-child(6) { animation-delay: 0.6s; }
.timeline-item:nth-child(7) { animation-delay: 0.7s; }
.timeline-item:nth-child(8) { animation-delay: 0.8s; }

/* Accessibility Improvements */
.timeline-item:focus-within {
    outline: 3px solid #7868E6;
    outline-offset: 2px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    .timeline-item {
        animation: none;
        opacity: 1;
    }
    
    .timeline-marker {
        animation: none;
    }
}
