/* ===== TIMELINE CONTAINER ===== */

.timeline-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 30px;
    min-height: 400px;
    padding: 60px 40px;
    margin-top: 40px;
    position: relative;
}

/* ===== TIMELINE BAR ===== */

.timeline-bar {
    width: 60px;
    height: 300px;
    position: relative;
    cursor: pointer;
    transition: all 0.4s ease;
    animation: barFloat 4s ease-in-out infinite;
}

/* Stagger the float animations */
.timeline-bar:nth-child(1) { animation-delay: 0s; }
.timeline-bar:nth-child(2) { animation-delay: 0.8s; }
.timeline-bar:nth-child(3) { animation-delay: 1.6s; }
.timeline-bar:nth-child(4) { animation-delay: 2.4s; }
.timeline-bar:nth-child(5) { animation-delay: 3.2s; }

@keyframes barFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

/* The colored stripe */
.bar-stripe {
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, 
        rgba(30,111,209,0.3),
        rgba(30,111,209,0.7),
        rgba(30,111,209,0.9)
    );
    border-radius: 10px;
    box-shadow: 
        inset 0 0 20px rgba(255,255,255,0.2),
        0 0 20px rgba(30,111,209,0.5);
    transition: all 0.3s ease;
}

/* Hover effect */
.timeline-bar:hover {
    transform: translateY(-20px) scale(1.05);
}

.timeline-bar:hover .bar-stripe {
    background: linear-gradient(to bottom, 
        rgba(60,150,255,0.5),
        rgba(60,150,255,0.8),
        rgba(60,150,255,1)
    );
    box-shadow: 
        inset 0 0 30px rgba(255,255,255,0.4),
        0 0 40px rgba(60,150,255,0.9);
}

/* Selected state */
.timeline-bar.selected .bar-stripe {
    background: linear-gradient(to bottom, 
        rgba(100,200,255,0.6),
        rgba(100,200,255,0.9),
        rgba(100,200,255,1)
    );
    box-shadow: 
        inset 0 0 30px rgba(255,255,255,0.5),
        0 0 50px rgba(100,200,255,1);
}

/* Date label */
.bar-label {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    letter-spacing: 2px;
    white-space: nowrap;
    opacity: 0.8;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.timeline-bar:hover .bar-label {
    opacity: 1;
    font-size: 12px;
}

/* ===== EVENT DETAIL PANEL ===== */

.event-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    max-width: 90%;
    max-height: 70vh;
    background: linear-gradient(135deg, #1e6fd1 0%, #1a56a8 100%);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 
        0 20px 60px rgba(0,0,0,0.7),
        inset 0 0 30px rgba(255,255,255,0.1);
    z-index: 100;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.event-panel.active {
    opacity: 1;
    visibility: visible;
}

/* Backdrop overlay */
.event-panel::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.event-panel.active::before {
    opacity: 1;
}

.panel-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s ease;
    line-height: 1;
}

.panel-close:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

#panelDate {
    font-size: 24px;
    letter-spacing: 2px;
    margin-bottom: 20px;
    color: white;
}

#panelEvents {
    list-style: none;
    padding: 0;
    margin: 0;
}

#panelEvents li {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255,255,255,0.95);
}

#panelEvents li:last-child {
    border-bottom: none;
}

/* Custom scrollbar for panel */
.event-panel::-webkit-scrollbar {
    width: 8px;
}

.event-panel::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}

.event-panel::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 10px;
}

.event-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

/* Responsive */
@media (max-width: 768px) {
    .timeline-container {
        gap: 20px;
        padding: 40px 20px;
    }
    
    .timeline-bar {
        width: 40px;
        height: 250px;
    }
    
    .event-panel {
        width: 95%;
        padding: 30px 20px;
    }
}