/**
 * Vertical Message Timeline Navigation - Scrolling Ribbon Version
 */

.timeline-container {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    /* Increased for better hover zone */
    height: 75vh;
    /* Taller to show more ticks */
    max-height: 480px;
    /* Set maximum height as requested */
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    visibility: hidden;
    pointer-events: auto;
    /* Gradient mask to fade out ticks at top and bottom */
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 15%, black 85%, transparent);
    mask-image: linear-gradient(to bottom, transparent, black 15%, black 85%, transparent);
    overflow: hidden;
}

.main-content.has-chat .timeline-container {
    opacity: 1;
    visibility: visible !important;
}

/* Hide on narrow screens */
@media (max-width: 767px) {
    .timeline-container {
        display: none !important;
    }
}

.timeline-bar {
    display: none;
}

.timeline-scroller {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1);
    z-index: 2;
}

.timeline-tick {
    position: absolute;
    right: 12px;
    width: 4px;
    height: 2px;
    background: var(--text-faded);
    border-radius: 1px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: right center;
    z-index: 5;
}

/* Invisible hit area to make hovering easier */
.timeline-tick::after {
    content: '';
    position: absolute;
    right: -8px;
    top: -6px;
    bottom: -6px;
    width: 40px;
    background: transparent;
}

/* User ticks are longer, as seen in the reference image */
.timeline-tick.user-tick {
    width: 10px;
    background: rgba(255, 255, 255, 0.4);
}

.timeline-tick:hover {
    background: var(--accent) !important;
    width: 18px !important;
    z-index: 10;
}

.timeline-tick.active {
    background: var(--accent);
    width: 14px;
    height: 2px;
    box-shadow: 0 0 8px var(--accent);
    opacity: 1 !important;
}

/* Tooltip for message preview - Fixed to avoid clipping */
.timeline-tooltip {
    position: fixed;
    right: 48px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    width: 260px;
    pointer-events: none;
    opacity: 0;
    transform: translateX(8px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    line-height: 1.5;
}

.timeline-tooltip.show {
    opacity: 1;
    transform: translateX(0);
}

.timeline-tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-weight: 600;
    color: var(--text-secondary, #999);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.timeline-tooltip-body {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Highlighted message effect */
.chat-message.timeline-highlight {
    animation: timeline-pulse 1.5s ease-out;
}

@keyframes timeline-pulse {
    0% {
        background-color: rgba(78, 204, 163, 0.1);
    }

    100% {
        background-color: transparent;
    }
}