/* Global Presence Timeline CSS - Horizontal Scrolling Offices */

/* Timeline Container Styles */
.horizontal-timeline-container.global-presence-timeline {
    position: relative;
    max-width: 100%;
    overflow: hidden;
    margin: 0 auto;
    padding: 40px 0 !important;
}

/* 线条式区域滑块组件样式 */
.timeline-line-slider {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto 4rem;
    padding: 2rem 0;
}

/* 滑块轨道 */
.slider-track {
    height: 2px;
    background: #e2e8f0;
    position: relative;
    margin: 2rem 0;
}

/* 滑块手柄 - 空心圆圈，与区域点重合 */
.slider-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 2px solid #00476B;
    background: transparent;
    border-radius: 50%;
    cursor: grab;
    z-index: 2;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    pointer-events: all;
}

.slider-handle:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    border-width: 2px;
}

.slider-handle:active {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.2);
}

/* 区域标记点 - 放置在线条上 */
.year-markers {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    pointer-events: none;
}

.year-marker {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.5rem;
    pointer-events: all;
}

.year-marker-dot {
    width: 12px;
    height: 12px;
    background: #cbd5e1;
    border-radius: 50%;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.year-marker:hover .year-marker-dot {
    background: #00476B;
    transform: scale(1.2);
}

.year-marker.active .year-marker-dot {
    background: #00476B;
    transform: scale(1.2);
}

.year-marker-label {
    font-size: 0.875rem;
    color: #475569;
    font-weight: 500;
    white-space: nowrap;
    position: absolute;
    bottom: -2rem;
}

.year-marker:hover .year-marker-label {
    color: #00476B;
}

.year-marker.active .year-marker-label {
    color: #00476B;
    font-weight: 600;
}

/* Timeline Navigation Buttons */
.timeline-nav {
    position: absolute;
    /* 精确对齐到Shenzhen Headquarters卡片垂直中线
       基于时间轴容器整体高度和卡片位置计算 */
    top: calc(50% + 100px);
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 20;
}

.nav-btn {
    pointer-events: all;
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    margin: 0 10px;
}

.nav-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    background-color: #00476B;
    color: white;
    border-color: #00476B;
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.nav-btn i {
    font-size: 1.2rem;
}

/* Timeline Wrapper */
.horizontal-timeline-wrapper {
    position: relative;
    padding: 20px 0 !important;
    min-height: 450px;
}

/* Timeline Content Wrapper */
.timeline-content-wrapper {
    position: relative;
    overflow: hidden;
    margin: 0 auto;
    max-width: 90%;
    height: auto;
    min-height: 400px;
}

/* Timeline Events Container */
.timeline-events {
    display: flex;
    gap: 30px;
    padding: 20px 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    min-height: 400px;
    /* 移动端优化 */
    user-select: none;
    touch-action: pan-x;
    scroll-snap-type: x mandatory;
}

/* 隐藏滚动条但保留滚动功能 */
.timeline-events::-webkit-scrollbar {
    display: none;
    height: 0;
}

.timeline-events {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Timeline Event */
.timeline-event {
    flex: 0 0 auto;
    width: 320px;
    scroll-snap-align: start;
    opacity: 1;
    transition: all 0.4s ease;
}

/* 筛选时隐藏的事件 */
.timeline-event.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
    width: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* Event Card Styles */
.event-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 380px;
    width: 320px;
    margin-bottom: 30px;
}

.event-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #00476B;
}

.event-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: #00476B;
}

/* Event Header */
.event-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

/* Event Icon */
.event-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #f0f9ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #00476B;
}

/* Region Badge */
.region-badge {
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: transparent;
    border: 2px solid #00476B;
    color: #00476B;
}

/* 筛选激活状态 - 白色文字，主色调背景 */
.timeline-event.filtered-active .region-badge {
    background: #00476B !important;
    color: #ffffff !important;
    border-color: #00476B !important;
}

.region-badge.asia {
    background-color: transparent;
    border-color: #00476B;
    color: #00476B;
}

.region-badge.europe {
    background-color: transparent;
    border-color: #00476B;
    color: #00476B;
}

.region-badge.americas {
    background-color: transparent;
    border-color: #00476B;
    color: #00476B;
}

.region-badge.oceania {
    background-color: transparent;
    border-color: #00476B;
    color: #00476B;
}

.region-badge.africa {
    background-color: transparent;
    border-color: #00476B;
    color: #00476B;
}

/* Event Title */
.event-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1rem;
    line-height: 1.3;
}

/* Event Description */
.event-description {
    margin-bottom: 1.5rem;
    color: #475569;
    line-height: 1.6;
}

.event-description p {
    margin-bottom: 0.75rem;
}

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

/* Email Link */
.email-link {
    color: #00476B;
    text-decoration: none;
    transition: color 0.2s ease;
}

.email-link:hover {
    color: #002a42;
    text-decoration: underline;
}

/* Direction Link */
.direction-link {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: #00476B;
    color: white;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
}

.direction-link:hover {
    background-color: #002a42;
    transform: translateY(-2px);
}

/* Event Tags */
.event-tags {
    margin-top: auto;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .timeline-content-wrapper {
        max-width: 95%;
    }
}

@media (max-width: 768px) {
    .horizontal-timeline-container.global-presence-timeline {
        padding: 20px 0 !important;
    }
    
    .timeline-nav {
        /* 在小屏幕上也确保与卡片高度中线对齐 */
        top: calc(50% + 80px);
        transform: translateY(-50%);
    }
    
    .nav-btn {
        width: 40px;
        height: 40px;
        margin: 0 5px;
    }
    
    .nav-btn i {
        font-size: 1rem;
    }
    
    /* 移动端线条式滑块适配 */
    .timeline-line-slider {
        margin-bottom: 3rem;
    }
    
    .slider-handle {
        width: 20px;
        height: 20px;
    }
    
    .year-marker-dot {
        width: 10px;
        height: 10px;
    }
    
    .year-marker-label {
        font-size: 0.75rem;
    }
    
    .timeline-event {
        width: 280px;
    }
    
    .event-card {
        width: 280px;
        padding: 1.5rem;
        height: 360px;
    }
    
    .event-header {
        flex-direction: row; /* 保持横向排列 */
        align-items: center; /* 垂直居中对齐 */
        justify-content: space-between; /* 保持两端对齐 */
        gap: 10px;
        flex-wrap: nowrap; /* 禁止换行 */
    }
    
    .event-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .timeline-nav {
        /* 移动屏幕上对齐到卡片中线 */
        top: calc(50% + 60px);
        transform: translateY(-50%);
    }
    
    .timeline-event {
        width: 250px;
    }
    
    .event-card {
        width: 250px;
        padding: 1.25rem;
    }
    
    .event-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .region-badge {
        padding: 0.3rem 0.8rem;
        font-size: 0.7rem;
        white-space: nowrap; /* 防止地区标签文字换行 */
        flex-shrink: 0; /* 防止地区标签被压缩 */
    }
    
    .event-title {
        font-size: 1.2rem;
    }
    
    .timeline-content-wrapper {
        max-width: 100%;
    }
    

}