/**
 * Enhanced Event Timeline Styles
 * Modern, clean timeline with animated progress tracking
 */

/* ================================
   Timeline Container
   ================================ */
.timeline-container {
    background: linear-gradient(135deg, #f5f7fa 0%, #f8f9fc 100%);
    border-radius: 20px;
    padding: 2rem 2rem 1rem;
    position: relative;
    overflow: hidden;
}

.timeline-container::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

.timeline-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.timeline-title i {
    font-size: 1.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.timeline-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: white;
    border-radius: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    font-size: 0.875rem;
    font-weight: 600;
}

.timeline-status.upcoming {
    color: #6c757d;
    border: 2px solid #e9ecef;
}

.timeline-status.registration-open {
    color: #f59e0b;
    border: 2px solid #ffd700;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, rgba(255, 215, 0, 0.05) 100%);
}

.timeline-status.in-progress {
    color: #10b981;
    border: 2px solid #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(34, 197, 94, 0.05) 100%);
    animation: statusPulse 2s ease-in-out infinite;
}

.timeline-status.completed {
    color: #6c757d;
    border: 2px solid #dee2e6;
    background: #f8f9fa;
}

@keyframes statusPulse {
    0%, 100% {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    }
    50% {
        box-shadow: 0 4px 20px rgba(16, 185, 129, 0.2);
    }
}

.timeline-status-icon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ================================
   Enhanced Timeline Track
   ================================ */
.timeline-track {
    position: relative;
    padding-top: 2rem;
}

.timeline-track-bg {
    position: absolute;
    /* Position will be set dynamically by JavaScript */
    top: 0;
    bottom: 0;
    width: 4px;
    background: transparent; /* Will be set by JavaScript based on actual icon positions */
    border-radius: 4px;
    z-index: 1;
    margin-left: 0; /* Ensure no margin affects positioning */
}

.timeline-track-progress {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
    transform-origin: top;
}

.timeline-track-progress::after {
    content: '';
    position: absolute;
    bottom: -10px; /* Adjusted for better centering */
    right: -8px; /* Position from right edge to center on 4px track: (20px - 4px) / 2 */
    width: 20px;
    height: 20px;
    background: white;
    border: 3px solid #667eea;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2),
                0 4px 20px rgba(102, 126, 234, 0.4);
    animation: progressPulse 2s ease-in-out infinite;
    z-index: 5;
}

@keyframes progressPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2),
                    0 4px 20px rgba(102, 126, 234, 0.4);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 8px rgba(102, 126, 234, 0.1),
                    0 6px 30px rgba(102, 126, 234, 0.6);
    }
}

/* ================================
   Timeline Events
   ================================ */
.timeline-event {
    display: flex;
    align-items: flex-start;
    margin-bottom: 2rem;
    position: relative;
}

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

.timeline-event-marker {
    position: relative;
    z-index: 3;
    flex-shrink: 0;
    width: 80px; /* Reduced from 120px */
    display: flex;
    align-items: center;
    justify-content: center;
    /* Icon is centered in this area */
}

.timeline-event-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 4; /* Ensure icons are above the track */
}

.timeline-event-icon i {
    font-size: 1.25rem;
    color: #667eea;
}

/* Event type specific styles */
.timeline-event.registration .timeline-event-icon {
    background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%);
}

.timeline-event.registration .timeline-event-icon i {
    color: white;
}

.timeline-event.start .timeline-event-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    animation: iconPulse 3s ease-in-out infinite;
}

.timeline-event.start .timeline-event-icon i {
    color: white;
}

.timeline-event.end .timeline-event-icon {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

.timeline-event.end .timeline-event-icon i {
    color: white;
}

@keyframes iconPulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    }
    50% {
        box-shadow: 0 4px 25px rgba(102, 126, 234, 0.3);
    }
}

.timeline-event:hover .timeline-event-icon {
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.3);
}

/* Timeline content card */
.timeline-event-content {
    flex: 1;
    margin-left: 1rem; /* Reduced from 2rem */
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: relative;
}

.timeline-event-content::before {
    content: '';
    position: absolute;
    left: -6px; /* Adjusted for closer spacing */
    top: 24px;
    width: 12px;
    height: 12px;
    background: white;
    transform: rotate(45deg);
    box-shadow: -2px -2px 5px rgba(0, 0, 0, 0.05);
}

.timeline-event:hover .timeline-event-content {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.timeline-event-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.timeline-event-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
}

.timeline-event-date {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    background: linear-gradient(135deg, #f3f4f6 0%, #f9fafb 100%);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6c757d;
}

.timeline-event-date i {
    font-size: 0.875rem;
}

.timeline-event.registration .timeline-event-date {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 183, 0, 0.1) 100%);
    color: #f59e0b;
}

.timeline-event.start .timeline-event-date {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: #667eea;
}

.timeline-event-description {
    color: #6c757d;
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.timeline-event-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.timeline-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.timeline-meta-item i {
    color: #667eea;
    font-size: 1rem;
}

/* Time display */
.timeline-event-time {
    position: absolute;
    left: -140px;
    top: 12px;
    text-align: right;
    min-width: 100px;
}

.timeline-time-value {
    display: block;
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 0.25rem;
}

.timeline-time-period {
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Hide time display on mobile by default */
@media (max-width: 768px) {
    .timeline-event-time {
        display: none;
    }
}

/* ================================
   Timeline Footer Stats
   ================================ */
.timeline-footer {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid rgba(0, 0, 0, 0.05);
}

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

.timeline-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 12px;
}

.timeline-stat:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.timeline-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: #667eea;
    font-size: 1.25rem;
}

.timeline-stat-info {
    flex: 1;
}

.timeline-stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.timeline-stat-label {
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ================================
   Responsive Design
   ================================ */
@media (max-width: 768px) {
    .timeline-container {
        padding: 1.5rem;
    }

    .timeline-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

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

    .timeline-track-bg {
        /* Position will be set dynamically by JavaScript */
        width: 3px;
    }

    .timeline-event-marker {
        width: 60px; /* Smaller on mobile */
    }

    .timeline-event-icon {
        width: 40px;
        height: 40px;
    }

    .timeline-event-icon i {
        font-size: 1rem;
    }

    .timeline-event-content {
        margin-left: 0.75rem; /* Even less space on mobile */
        padding: 1.25rem;
    }

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

    .timeline-event-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .timeline-event {
        margin-bottom: 1.5rem; /* Less space between events on mobile */
    }
}