/* ==========================================================
   TIMELINE VIEW
   ========================================================== */

#timelineView {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #111827;
    color: #ffffff;
}


/* ==========================================================
   HEADER
   ========================================================== */

.timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 28px;
    border-bottom: 1px solid #374151;
    background: #1f2937;
}

.timeline-header-title {
    margin: 0;
}

.timeline-header-subtitle {
    margin-top: 8px;
    color: #9ca3af;
}

.timeline-toolbar {
    display: flex;
    gap: 10px;
}


/* ==========================================================
   CONTENT
   ========================================================== */

#timelineContent {
    flex: 1;
    overflow: auto;
    padding: 30px;
    min-height: 0;
    box-sizing: border-box;
}


/* ==========================================================
   MAIN LAYOUT
   ========================================================== */

.timeline-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    align-items: start;
    min-height: 100%;
}


/* ==========================================================
   SIDEBAR
   ========================================================== */

.timeline-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.timeline-panel {
    padding: 20px;
    border: 1px solid #374151;
    border-radius: 8px;
    background: #1f2937;
}

.timeline-panel h3 {
    margin-top: 0;
}

.timeline-panel table {
    width: 100%;
    border-collapse: collapse;
}


/* ==========================================================
   LEGEND
   ========================================================== */

.timeline-legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.timeline-legend-item:last-child {
    margin-bottom: 0;
}

.timeline-legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-right: 10px;
}

.timeline-legend-dot.event {
    background: #3b82f6;
}

.timeline-legend-dot.start {
    background: #22c55e;
}

.timeline-legend-dot.end {
    background: #ef4444;
}

.timeline-legend-axis {
    width: 22px;
    height: 2px;
    background: #60a5fa;
    margin-right: 10px;
}

/* ==========================================================
   TIMELINE CANVAS
   ========================================================== */

.timeline-main {
    display: flex;
    flex-direction: column;
    border: 1px solid #374151;
    border-radius: 8px;
    background: #111827;
    overflow: hidden;
}

.timeline-canvas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #374151;
    background: #1f2937;
    font-weight: 600;
}

.timeline-canvas-count {
    font-size: 13px;
    color: #9ca3af;
}

.timeline-canvas {
    position: relative;
    flex: 1;
    min-height: 650px;
    overflow: auto;
    background:
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 119px,
            rgba(255,255,255,.05) 120px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 79px,
            rgba(255,255,255,.03) 80px
        );
}


/* ==========================================================
   YEAR MARKERS
   ========================================================== */

.timeline-year-label {
    position: absolute;
    color: #9ca3af;
    font-size: 12px;
}

.timeline-year-line {
    position: absolute;
    top: 40px;
    bottom: 0;
    width: 1px;
    background: rgba(255,255,255,.08);
}


/* ==========================================================
   LANES
   ========================================================== */

.timeline-lane {
    position: absolute;
    left: 100px;
    right: 0;
    height: 2px;
    background: #4b5563;
}

.timeline-lane-label {
    position: absolute;
    left: 20px;
    color: #9ca3af;
    font-size: 13px;
}


/* ==========================================================
   EVENT MARKERS
   ========================================================== */

.timeline-event-marker {
    position: absolute;
    border-radius: 50%;
    border: 2px solid #ffffff;
    cursor: pointer;
    transition:
        transform .15s ease,
        box-shadow .15s ease,
        opacity .15s ease;
    z-index: 9999;
    pointer-events: auto;
}

.timeline-event-marker:hover {
    transform: scale(1.08);
    box-shadow: 0 0 18px rgba(255,255,255,.9);
}

.timeline-event-marker.selected {
    z-index: 20;
    box-shadow: 0 0 12px rgba(255,255,255,.8);
}


/* ==========================================================
   EVENT LABELS
   ========================================================== */

.timeline-event-label {
    position: absolute;
    color: #d1d5db;
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    opacity: .75;
    transition:
        opacity .15s ease,
        transform .15s ease,
        color .15s ease,
        text-shadow .15s ease;
}

.timeline-event-label:hover {
    opacity: 1;
    transform: scale(1.02);
}

.timeline-event-label.selected {
    color: #ffffff;
    font-weight: 700;
    opacity: 1;
    text-shadow: 0 0 8px rgba(255,255,255,.6);
}

.timeline-event-icon {
    font-size: 12px;
    margin-right: 6px;
}

.timeline-event-date {
    font-size: 11px;
    color: #9ca3af;
}


/* ==========================================================
   TIMELINE PREVIEW
   ========================================================== */

.timeline-preview {

    position: absolute;

    width: 340px;
    max-width: 340px;

    padding: 16px;

    border: 1px solid #374151;
    border-radius: 10px;

    background: #1f2937;

    color: #ffffff;

    box-shadow:
        0 12px 32px rgba(0,0,0,.45);

    z-index: 1000;

    pointer-events: auto;

}

.timeline-preview[hidden]{

    display: none;

}

.timeline-preview,
.timeline-preview * {
    color: #ffffff !important;
}

.timeline-event-marker.timeline-related {
    opacity: 1;
    box-shadow: 0 0 10px rgba(255,255,255,.45);
}

.timeline-event-label.timeline-related {
    color: #ffffff;
    opacity: .95;
}

.timeline-event-marker.timeline-muted {
    opacity: .22;
}

.timeline-event-label.timeline-muted {
    opacity: .22;
}

.timeline-event-marker.selected,
.timeline-event-label.selected {
    opacity: 1;
}