/* Timeline Analysis Module Styles */

#timeline-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    padding: 0;
    /* Let children handle padding */
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 15%;
    border-bottom: 1px solid var(--border);
    background: rgba(15, 15, 19, 0.5);
}

.timeline-header h2 {
    font-family: var(--font-heading);
    color: var(--accent);
    font-size: 2rem;
    text-shadow: 0 0 10px var(--accent-glow);
}

.timeline-container {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    align-items: center;
    padding: 0 4rem;
    background:
        radial-gradient(circle at 50% 50%, #1f1f25 0%, #0f0f13 100%);
    position: relative;
    /* Custom Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--bg-panel);
}

.timeline-container::-webkit-scrollbar {
    height: 8px;
}

.timeline-container::-webkit-scrollbar-track {
    background: var(--bg-panel);
}

.timeline-container::-webkit-scrollbar-thumb {
    background-color: var(--accent);
    border-radius: 4px;
}

.timeline-track {
    display: flex;
    gap: 4rem;
    padding: 4rem 2rem;
    /* Vertical padding for hover effects */
    position: relative;
    align-items: flex-start;
    /* Align top */
}

/* The central continuous line */
.timeline-track::before {
    content: '';
    position: absolute;
    top: 3.5rem;
    /* Aligns with the date headers usually */
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    z-index: 0;
    pointer-events: none;
    opacity: 0.5;
}

.timeline-card {
    position: relative;
    min-width: 320px;
    max-width: 320px;
    background: rgba(24, 24, 27, 0.9);
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: 4px;
    padding: 1.5rem;
    z-index: 1;
    backdrop-filter: blur(10px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 2rem;
    /* Space for the date/node above */
}

.timeline-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    border-color: var(--accent);
    z-index: 10;
}

/* Node on the line */
.timeline-card::before {
    content: '';
    position: absolute;
    top: -2.6rem;
    /* Move up to intersect line */
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    background: var(--bg-app);
    border: 2px solid var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--accent-glow);
    z-index: 2;
    transition: background 0.3s;
}

.timeline-card:hover::before {
    background: var(--accent);
    box-shadow: 0 0 25px var(--accent);
}

/* Connector from node to card */
.timeline-card::after {
    content: '';
    position: absolute;
    top: -2rem;
    left: 50%;
    width: 2px;
    height: 2rem;
    background: linear-gradient(to bottom, var(--accent), transparent);
    transform: translateX(-50%);
    opacity: 0.5;
}

.timeline-date {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 0.2rem;
}

.timeline-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-main);
}

.timeline-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.meta-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.meta-icon {
    width: 16px;
    text-align: center;
}

/* Conflict Styles */
.timeline-card.conflict {
    border-color: #ef4444;
    border-top-color: #ef4444;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.1);
}

.timeline-card.conflict::before {
    border-color: #ef4444;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.timeline-card.conflict .timeline-date {
    color: #ef4444;
}

.conflict-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #ef4444;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    animation: pulse 2s infinite;
}

.conflict-details {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 4px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    font-size: 0.8rem;
    color: #fca5a5;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.empty-state {
    color: var(--text-muted);
    font-size: 1.2rem;
    text-align: center;
    width: 100%;
}