* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Lexend', sans-serif;
}

body {
    background: linear-gradient(135deg, #012169, #ffc72c);
    color: #333;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 20px auto;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(to right, #2c3e50, #4ca1af);
    color: white;
    text-align: center;
    padding: 30px 20px;
    position: relative;
}

h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
}

.timeline-controls {
    background: #f5f5f5;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    border-bottom: 1px solid #ddd;
}

.search-box {
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 25px;
    width: 250px;
    font-size: 1rem;
}

.era-filter {
    display: flex;
    gap: 10px;
}

.era-btn {
    padding: 8px 15px;
    background: #e9ecef;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.era-btn:hover, .era-btn.active {
    background: #4ca1af;
    color: white;
}

.timeline-container {
    position: relative;
    padding: 50px 20px;
    overflow-x: auto;
}

.timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: #4ca1af;
    border-radius: 2px;
}

.event {
    position: relative;
    width: 45%;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.5s, transform 0.5s;
}

.event.visible {
    opacity: 1;
    transform: translateY(0);
}

.event:nth-child(odd) {
    left: -5px;
}

.event:nth-child(even) {
    left: 55%;
}


.year {
    position: absolute;
    top: 15px;
    background: #4ca1af;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
}

.event:nth-child(odd) .year {
    right: -75px;
}

.event:nth-child(even) .year {
    left: -74px;
}

.event-content {
    margin-top: 10px;
}

.event-title {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.event-description {
    line-height: 1.6;
    color: #555;
}

/* Event Images */
.event-images {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.event-image {
    max-width: 100px;
    max-height: 80px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.1s ease;
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);

}

.event-image:hover {
    box-shadow: 0 0 0 4px white;
    transform: translateY(-3px);
}

/* Modal for full-size images */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.image-modal.active {
    display: flex;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.modal-image {
    max-width: 100%;
    max-height: 100%;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.close-button {
    position: absolute;
    top: -50px;
    right: -5px;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    font-size: 30px;
    font-weight: bold;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    /* Move text up by 3px */
    padding-bottom: 5px;
}

.close-button:hover {
    background: white;
    transform: scale(1.1);
}

/* Navigation arrows for modal */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2001;
}

.nav-arrow:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.nav-arrow-left {
    left: -70px;
}

.nav-arrow-right {
    right: -70px;
}

/* Image counter */
.image-counter {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.timeline-footer {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #ddd;
    font-style: italic;
    color: #666;
}

footer {
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: #ffffff;
    margin-top: 20px;
}

.decade-marker {
    text-align: center;
    margin: 30px 0;
    position: relative;
    font-weight: bold;
    font-size: 1.5rem;
    color: #2c3e50;
}

.decade-marker::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    background: #ddd;
    z-index: 1;
}

.decade-marker span {
    background: white;
    padding: 10px 20px;
    position: relative;
    z-index: 2;
    border-radius: 10px;
}

/* Navbar Styles */
.navbar {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(24, 20, 20, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 8px;
    z-index: 1001;
    display: flex;
    gap: 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    transition: background-color 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: #4ECDC4;
}

.nav-link i {
    font-size: 16px;
}


@media (max-width: 768px) {
    .event, .event:nth-child(even) {
        width: 85%;
        left: 15%;
    }
    
    .timeline::before {
        left: 15%;
    }
    
    .event::after, .event:nth-child(even)::after {
        left: -25px;
    }
    
    .event .year, .event:nth-child(even) .year {
        left: -70px;
    }
    
    .timeline-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-box {
        width: 100%;
    }
    
    .era-filter {
        width: 100%;
        justify-content: center;
    }
    
    /* Mobile adjustments for images */
    .event-images {
        gap: 8px;
    }
    
    .event-image {
        max-width: 80px;
        max-height: 60px;
    }
    
    .modal-content {
        max-width: 95%;
        max-height: 85%;
    }
    
    .close-button {
        top: -35px;
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    
    /* Mobile adjustments for navigation arrows */
    .nav-arrow {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .nav-arrow-left {
        left: -55px;
    }
    
    .nav-arrow-right {
        right: -55px;
    }
    
    .image-counter {
        bottom: -40px;
        font-size: 12px;
        padding: 6px 12px;
    }
}