/**
 * History Timeline Styles
 * Creative timeline design for CSI North America history page
 */

/* Introduction Section */
.history-intro {
    padding: 4rem 0 2rem;
    background: #f8f9fa;
}

.intro-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.intro-content h2 {
    font-size: 2.5rem;
    color: #1e5ba8;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.lead-text {
    font-size: 1.25rem;
    line-height: 1.8;
    color: #555;
}

/* Timeline Section */
.history-timeline {
    padding: 4rem 0;
    background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 50%, #f8f9fa 100%);
}

.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 0;
}

/* Timeline vertical line */
.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #1e5ba8, #d73333);
    border-radius: 2px;
}

/* Timeline Item */
.timeline-item {
    position: relative;
    width: 50%;
    padding: 0 2.5rem 3rem;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.timeline-item:nth-child(odd) {
    left: 0;
    padding-right: 2.5rem;
    padding-left: 0;
}

.timeline-item:nth-child(even) {
    left: 50%;
    padding-left: 2.5rem;
    padding-right: 0;
}

/* Stagger animation */
.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; }
.timeline-item:nth-child(9) { animation-delay: 0.9s; }
.timeline-item:nth-child(10) { animation-delay: 1s; }
.timeline-item:nth-child(n+11) { animation-delay: 1.1s; }

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

/* Timeline Marker (Circle) */
.timeline-marker {
    position: absolute;
    top: 0;
    width: 24px;
    height: 24px;
    background: #fff;
    border: 4px solid #1e5ba8;
    border-radius: 50%;
    z-index: 10;
    box-shadow: 0 0 0 4px rgba(30, 91, 168, 0.1);
    transition: all 0.3s ease;
}

.timeline-item:nth-child(odd) .timeline-marker {
    left: calc(100% - 12px);
}

.timeline-item:nth-child(even) .timeline-marker {
    left: -12px;
}

/* Milestone markers */
.timeline-item.milestone .timeline-marker {
    width: 32px;
    height: 32px;
    border-color: #d73333;
    border-width: 5px;
    box-shadow: 0 0 0 6px rgba(215, 51, 51, 0.15);
}

.timeline-item.milestone:nth-child(odd) .timeline-marker {
    left: calc(100% - 16px);
}

.timeline-item.milestone:nth-child(even) .timeline-marker {
    left: -16px;
}

.timeline-item.featured .timeline-marker {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #1e5ba8, #d73333);
    border: none;
    box-shadow: 0 0 0 8px rgba(30, 91, 168, 0.15), 0 0 20px rgba(30, 91, 168, 0.3);
}

.timeline-item.featured:nth-child(odd) .timeline-marker {
    left: calc(100% - 20px);
}

.timeline-item.featured:nth-child(even) .timeline-marker {
    left: -20px;
}

/* Timeline Content */
.timeline-content {
    position: relative;
    background: #fff;
    padding: 1.75rem 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.timeline-content:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.08);
}

/* Chevron arrows connecting marker to card */
.timeline-item:nth-child(odd) .timeline-content::before {
    content: '';
    position: absolute;
    top: 12px;
    right: -12px;
    width: 0;
    height: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-left: 12px solid #fff;
}

.timeline-item:nth-child(even) .timeline-content::before {
    content: '';
    position: absolute;
    top: 12px;
    left: -12px;
    width: 0;
    height: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-right: 12px solid #fff;
}

/* Milestone content styling */
.timeline-item.milestone .timeline-content {
    background: linear-gradient(135deg, rgba(30, 91, 168, 0.03) 0%, rgba(215, 51, 51, 0.03) 100%);
    border: 2px solid rgba(30, 91, 168, 0.15);
}

.timeline-item.milestone:nth-child(odd) .timeline-content::before {
    border-left-color: rgba(248, 249, 250, 1);
}

.timeline-item.milestone:nth-child(even) .timeline-content::before {
    border-right-color: rgba(248, 249, 250, 1);
}

.timeline-item.featured .timeline-content {
    background: linear-gradient(135deg, rgba(30, 91, 168, 0.08) 0%, rgba(215, 51, 51, 0.08) 100%);
    border: 3px solid #1e5ba8;
    box-shadow: 0 8px 16px rgba(30, 91, 168, 0.15), 0 2px 4px rgba(0, 0, 0, 0.06);
}

.timeline-item.featured:nth-child(odd) .timeline-content::before {
    border-left-color: rgba(243, 246, 249, 1);
}

.timeline-item.featured:nth-child(even) .timeline-content::before {
    border-right-color: rgba(243, 246, 249, 1);
}

/* Timeline Date */
.timeline-date {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    background: linear-gradient(135deg, #1e5ba8, #165091);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 20px;
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
}

.timeline-item.milestone .timeline-date {
    background: linear-gradient(135deg, #d73333, #b82828);
}

.timeline-item.featured .timeline-date {
    background: linear-gradient(135deg, #1e5ba8, #d73333);
    font-size: 0.95rem;
    padding: 0.5rem 1.2rem;
}

/* Timeline Content Text */
.timeline-content h3 {
    font-size: 1.5rem;
    color: #1e5ba8;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.timeline-item.featured .timeline-content h3 {
    font-size: 1.75rem;
    color: #d73333;
}

.timeline-content p {
    font-size: 1rem;
    line-height: 1.7;
    color: #444;
    margin-bottom: 0.75rem;
}

.timeline-content p:last-child {
    margin-bottom: 0;
}

/* Highlight Box */
.highlight-box {
    background: rgba(30, 91, 168, 0.05);
    border-left: 4px solid #1e5ba8;
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    border-radius: 4px;
}

.highlight-box strong {
    color: #1e5ba8;
    display: block;
    margin-bottom: 0.5rem;
}

.highlight-box ul {
    margin: 0;
    padding-left: 1.25rem;
}

.highlight-box li {
    margin-bottom: 0.35rem;
    color: #555;
}

/* Closing Section */
.history-closing {
    padding: 4rem 0;
    background: linear-gradient(135deg, rgba(30, 91, 168, 0.05) 0%, rgba(215, 51, 51, 0.05) 100%);
}

.closing-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.closing-content h2 {
    font-size: 2.5rem;
    color: #1e5ba8;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.closing-content p {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #555;
    margin-bottom: 1.25rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .timeline::before {
        left: 30px;
    }
    
    .timeline-item,
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        width: 100%;
        left: 0;
        padding: 0 0 2.5rem 4.5rem;
    }
    
    .timeline-marker,
    .timeline-item:nth-child(odd) .timeline-marker,
    .timeline-item:nth-child(even) .timeline-marker {
        left: 18px;
        right: auto;
    }
    
    .timeline-item.milestone .timeline-marker,
    .timeline-item.milestone:nth-child(odd) .timeline-marker,
    .timeline-item.milestone:nth-child(even) .timeline-marker {
        left: 14px;
    }
    
    .timeline-item.featured .timeline-marker,
    .timeline-item.featured:nth-child(odd) .timeline-marker,
    .timeline-item.featured:nth-child(even) .timeline-marker {
        left: 10px;
    }
    
    .timeline-content::before,
    .timeline-item:nth-child(odd) .timeline-content::before,
    .timeline-item:nth-child(even) .timeline-content::before {
        left: -12px;
        right: auto;
        border-right: 12px solid #fff;
        border-left: none;
    }
    
    .intro-content h2,
    .closing-content h2 {
        font-size: 2rem;
    }
    
    .lead-text {
        font-size: 1.125rem;
    }
    
    .timeline-content h3 {
        font-size: 1.25rem;
    }
    
    .timeline-item.featured .timeline-content h3 {
        font-size: 1.5rem;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .history-intro,
    .history-closing {
        padding: 2.5rem 0;
    }
    
    .history-timeline {
        padding: 2.5rem 0;
    }
    
    .timeline-item,
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        padding: 0 0 2rem 3.5rem;
    }
    
    .timeline::before {
        left: 20px;
    }
    
    .timeline-marker,
    .timeline-item:nth-child(odd) .timeline-marker,
    .timeline-item:nth-child(even) .timeline-marker {
        left: 12px;
        width: 16px;
        height: 16px;
    }
    
    .timeline-item.milestone .timeline-marker,
    .timeline-item.milestone:nth-child(odd) .timeline-marker,
    .timeline-item.milestone:nth-child(even) .timeline-marker {
        left: 8px;
        width: 24px;
        height: 24px;
    }
    
    .timeline-item.featured .timeline-marker,
    .timeline-item.featured:nth-child(odd) .timeline-marker,
    .timeline-item.featured:nth-child(even) .timeline-marker {
        left: 4px;
        width: 32px;
        height: 32px;
    }
    
    .timeline-content {
        padding: 1.25rem 1.5rem;
    }
    
    .intro-content h2,
    .closing-content h2 {
        font-size: 1.75rem;
    }
}
