/**
 * History Timeline Styles
 */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&display=swap');

.history-timeline-wrapper {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    font-family: 'Roboto', sans-serif;
}

/* Timeline Navigation */
.history-timeline-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    gap: 20px;
}

.timeline-years {
    display: flex;
    align-items: center;
    gap: 1px;
    flex-wrap: nowrap;
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.timeline-years::-webkit-scrollbar {
    display: none;
}

.timeline-year {
    background: transparent;
    border: none;
    color: #999;
    font-size: 16px;
    font-weight: 600;
    padding: 10px 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
    flex-shrink: 0;
}

.timeline-year::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: #7BCEF4;
    transition: width 0.3s ease;
}

.timeline-year:hover {
    color: #7BCEF4;
}

.timeline-year.active {
    color: black;
    font-weight: 700;
}

.timeline-year.active::after {
    width: 100%;
}

/* Mobile Timeline Years Swiper - Hidden by default */
.timeline-years-mobile-container {
    display: none;
}

/* Desktop Timeline Years - Visible by default with horizontal scroll */
.timeline-years-desktop {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 5px;
}

/* Timeline Navigation Arrows */
.history-timeline-navigation {
    display: flex;
    gap: 10px;
}

.timeline-prev,
.timeline-next {
    background: #f3f4f6;
    border: 2px solid #7BCEF4;
    border-radius: 13px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #6b7280;
}

.timeline-prev:hover,
.timeline-next:hover {
    background: #2563eb;
    color: white;
}

.timeline-prev:disabled,
.timeline-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Slider Container */
.history-slider-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.history-swiper {
    width: 100%;
    height: 355px;
    border-radius: 12px;
    overflow: visible;
    display: grid;
    grid-template-rows: 1fr auto;
}

.swiper-slide {
    width: 293px;
    position: relative;
    transition: opacity 0.3s ease;
    border-radius: 13px;
    overflow: hidden;
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 2;
}

.swiper-slide.active {
    opacity: 1;
}

.slide-content {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 2;
    border-radius: 13px;
}

.slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #00000066;
    z-index: 0;
    border-radius: 13px;
    pointer-events: none;
}

.swiper-slide.active .slide-overlay {
    background: linear-gradient(135deg, rgba(0, 70, 153, 0.8) 0%, rgba(35, 33, 118, 0.8) 100%);
}

.slide-year-badge {
    display: inline-block;
    background: #FFFFFF33;
    backdrop-filter: blur(8px);
    padding: 8px 14px;
    border-radius: 13px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.5px;
    position: absolute;
    color: white;
    top: 20px;
    left: 20px;
    z-index: 3;
    transition: all 0.3s ease;
}

.slide-info {
    position: relative;
    z-index: 3;
    padding: 30px 20px;
    color: white;
    width: 100%;
    display: flex;
    flex-direction: column;
    grid-row: 2;
    align-self: end;
}

.swiper-slide.active .slide-year-badge {
    background: #7BCEF4;
    color: #004699;
}

.slide-milestone {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 10px 0;
    line-height: 1.3;
    height: 36px;
}

.slide-excerpt {
    font-size: 11px;
    line-height: 1.5;
    opacity: 0.9;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 49px;
}

/* Swiper Navigation Buttons */
.swiper-button-prev,
.swiper-button-next {
    background: rgba(255, 255, 255, 0.9);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: #2563eb;
}

.swiper-button-prev:after,
.swiper-button-next:after {
    font-size: 20px;
    font-weight: 900;
}

.swiper-button-prev:hover,
.swiper-button-next:hover {
    background: white;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .history-swiper {
        height: 450px;
    }
}

@media (max-width: 768px) {
    .history-timeline-nav {
        align-items: flex-start;
        gap: 3px;
    }
    
    /* Hide desktop timeline years */
    .timeline-years-desktop {
        display: none;
    }
    
    /* Show mobile timeline years swiper */
    .timeline-years-mobile-container {
        display: block;
        width: 100%;
        overflow: hidden;
    }
    
    .timeline-years-mobile-swiper {
        width: 100%;
    }
    
    .timeline-years-mobile-swiper .swiper-slide {
        width: auto;
        display: flex;
        justify-content: center;
    }
    
    .timeline-years-mobile-swiper .timeline-year {
        font-size: 14px;
        padding: 8px 15px;
        white-space: nowrap;
    }
    
    /* Ensure active state matches desktop on mobile */
    .timeline-years-mobile-swiper .timeline-year.active {
        color: black !important;
        font-weight: 700 !important;
    }
    
    .timeline-years-mobile-swiper .timeline-year.active::after {
        background: #7BCEF4 !important;
        width: 100% !important;
    }
    
    .history-swiper {
        height: 400px;
    }
    
    .slide-info {
        padding: 25px 15px;
    }
    
    .slide-milestone {
        font-size: 18px;
    }
    
    .slide-excerpt {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }
    
    .swiper-button-prev,
    .swiper-button-next {
        width: 40px;
        height: 40px;
    }
    
    .swiper-button-prev:after,
    .swiper-button-next:after {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .history-timeline-wrapper {
        padding: 20px 10px;
    }
    
    .history-swiper {
        height: 350px;
    }
    
    .slide-info {
        padding: 20px 12px;
    }
    
    .slide-milestone {
        font-size: 16px;
    }
    
    .slide-excerpt {
        font-size: 11px;
    }
}
