/* Compact Timeline CSS - Inspired by photo.inuma.world */

.timeline-section-wrapper {
    padding: 0 20px;
    background: #0a0a0f;
    min-height: 100vh;
}

/* Category-based color schemes for date badges - Only 3 categories */
.timeline-date[data-category="背景"] {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;  /* Purple gradient */
}

.timeline-date[data-category="應用"] {
    background: linear-gradient(135deg, #f093fb, #f5576c) !important;  /* Pink gradient */
}

.timeline-date[data-category="模型"] {
    background: linear-gradient(135deg, #4facfe, #00f2fe) !important;  /* Blue gradient */
}

/* Default gradient if category is empty or unknown */
.timeline-date {
    background: linear-gradient(135deg, #c81a75, #e63989) !important;  /* Default pink */
}

/* Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Main Timeline */
.timeline {
    position: relative;
    padding: 40px 0;
}

/* Center Line */
.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(200, 26, 117, 0.3) 10%,
        rgba(200, 26, 117, 0.3) 90%,
        transparent 100%
    );
    transform: translateX(-50%);
    z-index: 1;
}

/* Section */
.timeline-section {
    margin-bottom: 50px;
}

/* Section Title */
.timeline-section-title {
    text-align: center;
    color: #e63989;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 80px 0 40px;  /* Increased spacing: 80px top, 40px bottom */
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 10;
    padding: 20px 0;  /* Additional padding for extra breathing room */
}

/* First section title - reduced top margin */
.timeline-section:first-child .timeline-section-title {
    margin-top: 20px;  /* Much smaller top margin for first title */
}

/* Section Description */
.timeline-section > p {
    text-align: center;
    color: rgba(255,255,255,0.6);
    max-width: 700px;
    margin: 0 auto 30px;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Timeline Item - Simple positioning */
.timeline-item {
    position: relative;
    margin: 20px 0;
    min-height: 100px;
}

/* Timeline Dot */
.timeline-dot {
    position: absolute;
    left: 50%;
    top: 22px;
    width: 14px;
    height: 14px;
    background: #e63989;
    border-radius: 50%;
    border: 3px solid #0a0a0f;
    box-shadow: 0 0 0 3px rgba(200, 26, 117, 0.3);
    transform: translateX(-50%);
    z-index: 10;
}

/* Content Box - Base styles */
.timeline-content {
    width: 45%;
    max-width: 450px;
    padding: 18px 24px;
    background: rgba(30, 30, 40, 0.95);
    border: 1px solid rgba(200, 26, 117, 0.2);
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

/* Left side items (odd) */
.timeline-item:nth-child(odd) .timeline-content:first-child {
    position: absolute;
    right: 50%;
    margin-right: 20px;
    text-align: right;
}

/* Right side items (even) */
.timeline-item:nth-child(even) .timeline-content:last-child {
    position: absolute;
    left: 50%;
    margin-left: 20px;
    text-align: left;
}

/* Hide duplicate content */
.timeline-item:nth-child(odd) .timeline-content:last-child {
    display: none;
}

.timeline-item:nth-child(even) .timeline-content:first-child {
    display: none;
}

/* Connection lines */
.timeline-content::after {
    content: '';
    position: absolute;
    top: 24px;
    width: 25px;
    height: 1px;
    background: rgba(200, 26, 117, 0.3);
}

.timeline-item:nth-child(odd) .timeline-content::after {
    right: -25px;
}

.timeline-item:nth-child(even) .timeline-content::after {
    left: -25px;
}

/* Date Badge */
.timeline-date {
    display: inline-block;
    background: linear-gradient(135deg, #c81a75, #e63989);
    color: white;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Body Text */
.timeline-body {
    color: rgba(255,255,255,0.9);
    line-height: 1.6;
    font-size: 0.95rem;
}

.timeline-body b {
    color: #ff4d9a;
    font-weight: 600;
}

/* Significance Text */
.timeline-significance {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(200, 26, 117, 0.15);
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
    font-style: italic;
}

/* Hover Effects */
.timeline-content:hover {
    background: rgba(40, 40, 50, 0.95);
    border-color: rgba(200, 26, 117, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(200, 26, 117, 0.2);
}

/* Animation on scroll */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.timeline-item:nth-child(odd) .timeline-content:first-child {
    animation: slideInLeft 0.6s ease forwards;
}

.timeline-item:nth-child(even) .timeline-content:last-child {
    animation: slideInRight 0.6s ease forwards;
}

/* Mobile Responsive - Simple Box Layout */
@media screen and (max-width: 768px) {
    /* 1. Hide all timeline-specific visual elements */
    .timeline::before,
    .timeline-dot,
    .timeline-content::after {
        display: none;
    }

    /* 2. Reset the main timeline container for simple flow */
    .timeline {
        padding: 20px 0;
    }

    /* 3. Reset each timeline item */
    .timeline-item {
        padding: 0; /* Remove padding that was for the line */
        margin: 0 0 20px 0; /* Simple margin for spacing between cards */
    }

    /* 4. Reset the content box to be a simple, full-width block */
    .timeline-content {
        width: 100%;
        max-width: 100%;
        position: static; /* Override absolute positioning from desktop */
        margin: 0;
        text-align: left !important; /* Ensure text is left-aligned */
        animation: none !important; /* Disable animations */
        transform: none !important;
    }

    /* 5. IMPORTANT: Ensure only ONE content box is shown per item */
    /* Show the first content box by default */
    .timeline-item .timeline-content:first-of-type {
        display: block;
    }
    /* Hide the second (duplicate) content box */
    .timeline-item .timeline-content:last-of-type {
        display: none;
    }

    /* Override the desktop rule that hides the first box for even items */
    .timeline-item:nth-child(even) .timeline-content:first-of-type {
        display: block;
    }
    .timeline-item:nth-child(even) .timeline-content:last-of-type {
        display: none;
    }
}