/* War Database - Timeline Styles */

.timeline-container {
    height: var(--timeline-height);
    min-height: 140px;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Timeline Controls */
.timeline-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.timeline-btn {
    padding: 6px 16px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.timeline-btn:hover {
    background-color: var(--border-color);
}

.timeline-btn.playing {
    background-color: var(--color-ongoing);
    border-color: var(--color-ongoing);
}

#timeline-zoom {
    padding: 6px 12px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.8rem;
    cursor: pointer;
}

#timeline-zoom:focus {
    outline: none;
    border-color: var(--color-ongoing);
}

/* Timeline Track Wrapper */
.timeline-wrapper {
    flex: 1;
    min-height: 50px;
    position: relative;
    background-color: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
}

/* Timeline Track */
.timeline-track {
    height: 100%;
    display: flex;
    align-items: flex-end;
    padding: 8px 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

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

/* Era markers */
.era-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    padding: 8px 12px;
    border-right: 1px solid var(--border-color);
    height: 100%;
    cursor: pointer;
    transition: background-color 0.2s ease;
    background-color: #ffffff;
    box-sizing: border-box;
}

.era-marker:hover {
    background-color: #f0f0f0;
}

.era-marker.selected {
    background-color: #121212;
}

.era-marker.selected .era-label,
.era-marker.selected .era-date {
    color: #ffffff;
}

.era-marker:last-child {
    border-right: none;
}

.era-label {
    font-size: 0.75rem;
    background: transparent;
    color: #121212;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    font-weight: 600;
}

.era-date {
    font-size: 0.7rem;
    background: transparent;
    color: #333333;
}

/* Conflict density bars - hidden */
.density-bar {
    display: none;
}

/* Time markers */
.time-marker {
    position: absolute;
    bottom: 0;
    width: 2px;
    background-color: var(--border-color);
    transform: translateX(-50%);
}

.time-marker.major {
    background-color: var(--text-muted);
}

.time-marker-label {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: var(--text-muted);
    white-space: nowrap;
    padding-bottom: 4px;
}

/* Timeline Slider */
.timeline-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.slider-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--color-ongoing);
    cursor: ew-resize;
    pointer-events: auto;
    transition: left 0.1s ease-out;
}

.slider-handle::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--color-ongoing);
}

.slider-handle::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--color-ongoing);
}

/* Time range selection */
.time-range {
    position: absolute;
    top: 0;
    bottom: 0;
    background-color: rgba(255, 68, 68, 0.2);
    pointer-events: none;
}

/* Timeline Info */
.timeline-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    padding: 4px 0;
    flex-shrink: 0;
}

#current-date {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
}

#conflict-count {
    color: var(--text-secondary);
    font-size: 0.85rem;
}


/* Conflict dots on timeline */
.timeline-conflict {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    transform: translate(-50%, 50%);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.timeline-conflict:hover {
    transform: translate(-50%, 50%) scale(1.5);
}

.timeline-conflict.war {
    background-color: var(--color-war);
}

.timeline-conflict.colonization {
    background-color: var(--color-colonization);
}

.timeline-conflict.genocide {
    background-color: var(--color-genocide);
}

.timeline-conflict.ongoing {
    background-color: var(--color-ongoing);
    animation: pulse-small 2s infinite;
}

@keyframes pulse-small {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(255, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0);
    }
}

/* Era quick jump buttons */
.era-buttons {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.era-btn {
    padding: 4px 8px;
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    color: var(--text-secondary);
    font-size: 0.65rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.era-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.era-btn.active {
    background-color: var(--color-war);
    border-color: var(--color-war);
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .timeline-container {
        padding: 8px 16px;
    }

    .era-marker {
        min-width: 80px;
    }

    .era-label {
        font-size: 0.6rem;
    }

    .era-buttons {
        display: none;
    }

    .timeline-info {
        font-size: 0.7rem;
    }
}
