/**
 * Fortune Timeline — 墨金 Dark Luxury
 */

.fortune-timeline-container {
    width: 100%;
    background: var(--color-glass-surface);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-glass);
}

/* Timeline Header */
.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.timeline-header h3 {
    font-size: 1.5rem;
    color: var(--color-gold);
    font-weight: 600;
    font-family: var(--font-heading);
}

.timeline-controls {
    display: flex;
    gap: 0.5rem;
}

.timeline-controls button {
    width: 36px;
    height: 36px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.timeline-controls button:hover {
    background: var(--color-bg-tertiary);
    border-color: var(--color-gold-muted);
    color: var(--color-gold);
}

/* Timeline Body */
.timeline-body {
    position: relative;
}

/* Major Fortune Timeline */
.major-fortune-timeline {
    margin-bottom: 3rem;
}

.major-fortune-timeline h4,
.yearly-fortune-timeline h4,
.combined-fortune-graph h4 {
    font-size: 1.1rem;
    color: var(--color-text-primary);
    margin-bottom: 1rem;
    font-weight: 600;
}

.timeline-track {
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 1rem 0;
    -webkit-overflow-scrolling: touch;
}

#major-fortune-track {
    display: flex;
    gap: 1rem;
    padding-bottom: 1rem;
}

.fortune-period {
    flex: 0 0 150px;
    background: var(--color-bg-secondary);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--color-border);
    position: relative;
    color: var(--color-text-primary);
}

.fortune-period:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-glass);
    border-color: var(--color-gold-muted);
}

.fortune-period.current {
    background: linear-gradient(135deg, var(--color-gold-deep), var(--color-gold));
    color: var(--color-bg-primary);
    border-color: var(--color-gold);
}

.fortune-period.current .period-header,
.fortune-period.current .period-element {
    color: var(--color-bg-primary);
}

.fortune-period.selected {
    border-color: var(--color-gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.period-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.period-age {
    font-weight: 600;
}

.period-score {
    background: rgba(212, 175, 55, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.period-stems {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-heading);
}

.period-element {
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.5rem;
}

.period-bar {
    height: 6px;
    background: var(--color-bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Yearly Fortune Timeline */
.yearly-fortune-timeline {
    margin-bottom: 3rem;
}

.yearly-timeline-scroll {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 1rem 0;
    -webkit-overflow-scrolling: touch;
}

.yearly-period {
    flex: 0 0 100px;
    background: var(--color-bg-secondary);
    border-radius: 8px;
    padding: 1rem 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--color-border);
    position: relative;
    color: var(--color-text-primary);
}

.yearly-period:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-glass);
}

.yearly-period.past {
    opacity: 0.6;
}

.yearly-period.current {
    background: var(--color-gold);
    color: var(--color-bg-primary);
    font-weight: 600;
    border-color: var(--color-gold);
}

.yearly-period.current .year-age,
.yearly-period.current .year-stems {
    color: var(--color-bg-primary);
}

.yearly-period.selected {
    border-color: var(--color-gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.year-label {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.year-age {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.5rem;
}

.year-stems {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
}

.year-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-size: 0.75rem;
}

.score-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Combined Fortune Graph */
.combined-fortune-graph {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

#combined-fortune-chart {
    height: 250px;
}

/* Fortune Details Panel */
.fortune-details-panel {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.fortune-details-panel h4 {
    font-size: 1.1rem;
    color: var(--color-gold);
    margin-bottom: 1rem;
    font-weight: 600;
}

.fortune-detail-card {
    background: var(--color-glass-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
    position: relative;
}

.fortune-detail-card h5 {
    font-size: 1.2rem;
    color: var(--color-gold);
    margin-bottom: 1rem;
    font-weight: 600;
}

.detail-items {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background: var(--color-bg-tertiary);
    border-radius: 4px;
}

.detail-item .label {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.detail-item .value {
    font-weight: 600;
    color: var(--color-text-primary);
}

.detail-description {
    padding: 1rem;
    background: var(--color-bg-secondary);
    border-radius: 6px;
    border-left: 4px solid var(--color-gold);
}

.detail-description p {
    line-height: 1.6;
    color: var(--color-text-primary);
}

.current-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--color-gold);
    color: var(--color-bg-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Scrollbar Styles */
.timeline-track::-webkit-scrollbar,
.yearly-timeline-scroll::-webkit-scrollbar {
    height: 8px;
}

.timeline-track::-webkit-scrollbar-track,
.yearly-timeline-scroll::-webkit-scrollbar-track {
    background: var(--color-bg-tertiary);
    border-radius: 4px;
}

.timeline-track::-webkit-scrollbar-thumb,
.yearly-timeline-scroll::-webkit-scrollbar-thumb {
    background: var(--color-gold-muted);
    border-radius: 4px;
}

.timeline-track::-webkit-scrollbar-thumb:hover,
.yearly-timeline-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--color-gold);
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fortune-period,
.yearly-period {
    animation: fadeInUp 0.5s ease backwards;
}

.fortune-period:nth-child(1) { animation-delay: 0.05s; }
.fortune-period:nth-child(2) { animation-delay: 0.1s; }
.fortune-period:nth-child(3) { animation-delay: 0.15s; }
.fortune-period:nth-child(4) { animation-delay: 0.2s; }
.fortune-period:nth-child(5) { animation-delay: 0.25s; }
.fortune-period:nth-child(6) { animation-delay: 0.3s; }
.fortune-period:nth-child(7) { animation-delay: 0.35s; }
.fortune-period:nth-child(8) { animation-delay: 0.4s; }

/* Responsive Design */
@media (max-width: 768px) {
    .fortune-timeline-container {
        padding: 1rem;
    }

    .timeline-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .fortune-period {
        flex: 0 0 120px;
    }

    .yearly-period {
        flex: 0 0 80px;
        padding: 0.75rem 0.5rem;
    }

    .year-stems {
        font-size: 0.9rem;
    }

    .detail-items {
        gap: 0.5rem;
    }

    .detail-item {
        flex-direction: column;
        gap: 0.25rem;
    }
}

@media (max-width: 480px) {
    .timeline-controls button {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .fortune-period {
        flex: 0 0 100px;
        padding: 0.75rem;
    }

    .period-stems {
        font-size: 1.2rem;
    }

    #combined-fortune-chart {
        height: 200px;
    }
}
