/* ================================
   Timeline Page Styles
   ================================ */

/* Timeline Hero Section */
.timeline-hero {
    background: #fff;
    color: #333;
    padding: 3rem 0 2rem 0;
    position: relative;
    overflow: hidden;
}

.timeline-hero::before {
    display: none;
}

.timeline-hero-main {
    position: relative;
    z-index: 2;
}

.timeline-summary-section {
    background: #fff;
    backdrop-filter: none;
    border-radius: 16px;
    padding: 2rem;
    color: #2c3e50;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.timeline-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.summary-title-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.summary-robot-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.summary-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2c3e50;
}

.countdown-compact {
    font-size: 0.95rem;
    color: #666;
    background: #f8f9fa;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    white-space: nowrap;
}

.countdown-compact span {
    font-weight: 600;
    color: #e74c3c;
}

.summary-analysis-list {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    padding-left: 0;
}

.summary-analysis-item {
    background: transparent;
    padding: 0 0 0 1.5rem;
    border-radius: 0;
    border-left: 3px solid #667eea;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #4a5568;
    transition: all 0.3s ease;
    position: relative;
    counter-increment: summary-counter;
}

.summary-analysis-item::before {
    content: counter(summary-counter) ". ";
    font-weight: 600;
    color: #667eea;
    margin-right: 0.5rem;
}

.summary-analysis-item:hover {
    border-left-color: #5a67d8;
    transform: translateX(5px);
    color: #2d3748;
}

.summary-analysis-item:last-child {
    margin-bottom: 0;
}

/* 初始化計數器 */
.summary-analysis-list {
    counter-reset: summary-counter;
}

/* Timeline Content */
.timeline-content {
    background: #f8f9fa;
    min-height: 60vh;
    padding: 3rem 0;
    overflow-x: hidden; /* 防止時間軸區域水平滾動 */
}

.timeline-section-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Timeline Filters */
.timeline-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.9rem;
    color: #666;
    white-space: nowrap;
}

.custom-select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 0.9rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%23666' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.custom-select:hover {
    border-color: #2196F3;
}

.custom-select:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

/* Filter Result Hint */
.filter-result-hint {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    background: #f5f9ff;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #1976D2;
}

.hint-icon {
    font-size: 1.1rem;
}

.hint-text {
    flex: 1;
}

.clear-all-filters-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    color: #1976D2;
    background: #fff;
    border: 1px solid #1976D2;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-all-filters-btn:hover {
    background: #1976D2;
    color: #fff;
}

/* Timeline Event Types */
.timeline-event.agreement {
    border-left: 4px solid #4CAF50;
}

.timeline-event.temporary-agreement {
    border-left: 4px solid #FFC107;
}

.timeline-event.us-policy {
    border-left: 4px solid #F44336;
}

.timeline-event.defeat {
    border-left: 4px solid #9C27B0;
}

.timeline-event.global-response {
    border-left: 4px solid #2196F3;
}

.timeline-event.neutral {
    border-left: 4px solid #757575;
}

.event-type-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #FFFFFF;
}

.event-type-badge.agreement {
    background: #4CAF50;
}

.event-type-badge.temporary-agreement {
    background: #FFC107;
}

.event-type-badge.us-policy {
    background: #F44336;
}

.event-type-badge.defeat {
    background: #9C27B0;
}

.event-type-badge.global-response {
    background: #2196F3;
}

.event-type-badge.neutral {
    background: #757575;
}

/* Timeline Container */
.timeline-container {
    position: relative;
    overflow-x: hidden; /* 防止水平滾動 */
    width: 100%;
}

.timeline-container::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, #667eea, #764ba2);
    border-radius: 2px;
}

/* Timeline Event Items */
.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 80px;
    opacity: 0;
    transform: translateX(-20px);
    animation: fadeInSlide 0.6s ease forwards;
}

.timeline-item:nth-child(odd) {
    animation-delay: 0.1s;
}

.timeline-item:nth-child(even) {
    animation-delay: 0.2s;
}

@keyframes fadeInSlide {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.timeline-date {
    position: absolute;
    left: 0;
    top: 0;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    z-index: 2;
}

.timeline-event {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f3f4;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.timeline-event:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12), 0 2px 10px rgba(0, 0, 0, 0.08);
}

.timeline-event.us-policy:hover {
    border-color: #f5c6cb;
    background: linear-gradient(135deg, #fff 0%, #fef2f2 50%, #fce4e4 100%);
}

.timeline-event.international:hover {
    border-color: #b8daff;
    background: linear-gradient(135deg, #fff 0%, #f0f6ff 50%, #dbeafe 100%);
}

.timeline-event.neutral:hover {
    border-color: #c6c8ca;
    background: linear-gradient(135deg, #fff 0%, #f6f8fa 50%, #e2e6ea 100%);
}

.timeline-event.agreement:hover {
    border-color: #c3e6cb;
    background: linear-gradient(135deg, #fff 0%, #f1fbf3 50%, #e1f5e1 100%);
}

/* Event Type Colors - 增強色彩明顯度 */
.timeline-event.us-policy {
    border-left-color: #e74c3c;
    border-left-width: 4px;
    background: linear-gradient(135deg, #fff 0%, #fef5f5 50%, #fdeaea 100%);
    border-color: #f8d7da;
}

.timeline-event.international {
    border-left-color: #3498db;
    border-left-width: 4px;
    background: linear-gradient(135deg, #fff 0%, #f4f9ff 50%, #e3f2fd 100%);
    border-color: #cce7ff;
}

.timeline-event.neutral {
    border-left-color: #6c757d;
    border-left-width: 4px;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 50%, #e9ecef 100%);
    border-color: #dee2e6;
}

.timeline-event.agreement {
    border-left-color: #28a745;
    border-left-width: 4px;
    background: linear-gradient(135deg, #fff 0%, #f4fdf6 50%, #e8f5e8 100%);
    border-color: #d1ecf1;
}

.event-type-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.event-type-badge.us-policy {
    background: linear-gradient(135deg, #e74c3c, #dc3545);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.event-type-badge.international {
    background: linear-gradient(135deg, #3498db, #007bff);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.event-type-badge.neutral {
    background: linear-gradient(135deg, #6c757d, #495057);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.event-type-badge.agreement {
    background: linear-gradient(135deg, #28a745, #20c997);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.timeline-event-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.8rem;
    line-height: 1.4;
    padding-right: 120px; /* 為標籤留出空間 */
}

.timeline-event-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.timeline-event-analysis {
    background: linear-gradient(135deg, #f8f9ff 0%, #eef2ff 50%, #e6ebff 100%);
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-left: 4px solid #667eea;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.timeline-event-analysis:hover {
    background: linear-gradient(135deg, #eef2ff 0%, #e2e8ff 50%, #d9e2ff 100%);
    border-color: rgba(102, 126, 234, 0.35);
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(102, 126, 234, 0.15);
}

.timeline-analysis-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.timeline-analysis-title {
    font-weight: 600;
    color: #667eea;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.robot-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.timeline-analysis-toggle {
    color: #667eea;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.timeline-analysis-content {
    color: #555;
    line-height: 1.6;
    font-size: 0.95rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.timeline-event-analysis.expanded .timeline-analysis-content {
    max-height: 300px;
    margin-top: 0.5rem;
}

.timeline-event-analysis .timeline-analysis-toggle {
    transition: color 0.3s ease;
}

/* Responsive Design for Timeline */
@media (max-width: 768px) {
    .timeline-hero {
        padding: 2rem 0 1.5rem 0;
    }
    
    .timeline-summary-section {
        padding: 1.5rem;
        margin: 0 1rem;
    }
    
    .timeline-summary-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .summary-title {
        font-size: 1.2rem;
    }
    
    .summary-robot-icon {
        width: 28px;
        height: 28px;
    }
    
    .countdown-compact {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
        align-self: stretch;
        text-align: center;
    }
    
    .summary-analysis-item {
        padding: 0 0 0 1.2rem;
        font-size: 0.9rem;
    }
    
    .timeline-filters {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .custom-select {
        width: 100%;
    }
    
    .timeline-item {
        padding-left: 70px;
        margin-left: 0.5rem;
        margin-right: 1rem;
    }
    
    .timeline-date {
        width: 50px;
        height: 50px;
        font-size: 0.75rem;
        left: 5px; /* 對齊到線條中心 */
    }
    
    .timeline-container::before {
        left: 30px; /* 調整線條位置以對齊圈圈中心 */
    }
    
    .timeline-event-title {
        font-size: 1.1rem;
        padding-right: 100px;
    }
}

@media (max-width: 480px) {
    .timeline-hero {
        padding: 1.5rem 0 1rem 0;
    }
    
    .timeline-summary-section {
        padding: 1rem;
        margin: 0 0.5rem;
        border-radius: 12px;
    }
    
    .summary-title {
        font-size: 1.1rem;
    }
    
    .summary-robot-icon {
        width: 24px;
        height: 24px;
    }
    
    .countdown-compact {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
    
    .summary-analysis-item {
        padding: 0 0 0 1rem;
        font-size: 0.85rem;
    }
    
    .timeline-item {
        padding-left: 60px;
        margin-left: 0.25rem;
        margin-right: 0.5rem;
    }
    
    .timeline-date {
        width: 40px;
        height: 40px;
        font-size: 0.7rem;
        left: 5px; /* 確保圈圈對齊線條中心 */
    }
    
    .timeline-container::before {
        left: 25px; /* 線條對齊圈圈中心 */
        width: 2px;
    }
    
    .timeline-event {
        padding: 1rem;
    }
    
    .timeline-event-title {
        font-size: 1rem;
        padding-right: 80px;
    }
    
    .event-type-badge {
        padding: 0.2rem 0.6rem;
        font-size: 0.7rem;
        top: 6px;
        right: 6px;
    }
    
    .timeline-filters {
        margin: 0 0.5rem 1.5rem 0.5rem;
        padding: 0.8rem;
    }
}

/* 中間斷點優化 (平板橫式) */
@media (max-width: 1024px) and (min-width: 769px) {
    .timeline-item {
        padding-left: 75px;
        margin-left: 0.75rem;
        margin-right: 1rem;
    }
    
    .timeline-date {
        width: 55px;
        height: 55px;
        font-size: 0.8rem;
        left: 2px;
    }
    
    .timeline-container::before {
        left: 29px;
    }
}

/* 手機版響應式設計 */
@media (max-width: 768px) {
    .filter-result-hint {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.875rem;
    }
    
    .filter-result-hint .hint-icon {
        margin-right: 0.25rem;
    }
    
    .clear-all-filters-btn {
        align-self: flex-end;
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
}

/* 超小螢幕額外優化 */
@media (max-width: 320px) {
    .timeline-item {
        padding-left: 55px;
        margin-left: 0.125rem;
        margin-right: 0.25rem;
    }
    
    .timeline-date {
        width: 35px;
        height: 35px;
        font-size: 0.65rem;
        left: 2px;
    }
    
    .timeline-container::before {
        left: 20px;
        width: 1.5px;
    }
    
    .timeline-event {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .timeline-event-title {
        font-size: 0.9rem;
        padding-right: 70px;
        line-height: 1.3;
    }
    
    .event-type-badge {
        padding: 0.15rem 0.5rem;
        font-size: 0.65rem;
        top: 4px;
        right: 4px;
    }
} 