/* ── vis-timeline overrides for Oney design system ────────────── */

/* Container */
.vis-timeline {
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    background: #fff;
}

/* Time axis */
.vis-time-axis .vis-text {
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
}

.vis-time-axis .vis-grid.vis-minor {
    border-color: #f3f4f6;
}

.vis-time-axis .vis-grid.vis-major {
    border-color: #e5e7eb;
}

/* Current time marker */
.vis-current-time {
    background-color: #81bc00;
    width: 2px;
}

/* Group labels (swimlanes) */
.vis-labelset .vis-label {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
    padding: 4px 12px;
}

.vis-labelset .vis-label .vis-inner {
    padding: 6px 0;
}

/* Items (range bars) */
.vis-item {
    border-radius: 6px;
    border: none;
    font-size: 11px;
    min-height: 32px;
}

.vis-item .vis-item-content {
    padding: 2px 8px;
}

.vis-item.vis-selected {
    border: 2px solid #81bc00;
    box-shadow: 0 0 0 2px rgba(129, 188, 0, 0.2);
}

/* Range items default */
.vis-item.vis-range {
    background-color: #dbeafe;
    border-left: 3px solid #3b82f6;
}

/* Status-based colors */
.vis-item.timeline-planned {
    background-color: #f0f9ff;
    border-left: 3px solid #3b82f6;
    color: #1e40af;
}

.vis-item.timeline-in-progress {
    background-color: #fefce8;
    border-left: 3px solid #eab308;
    color: #854d0e;
}

.vis-item.timeline-done {
    background-color: #f0fdf4;
    border-left: 3px solid #22c55e;
    color: #166534;
    opacity: 0.75;
}

.vis-item.timeline-cancelled {
    background-color: #f9fafb;
    border-left: 3px solid #9ca3af;
    color: #6b7280;
    opacity: 0.5;
    text-decoration: line-through;
}

/* Point items (EOL markers) */
.vis-item.vis-dot {
    border-width: 3px;
}

.vis-item.timeline-eol-expired {
    color: #ef4444;
}

.vis-item.timeline-eol-expired .vis-item-content {
    color: #ef4444;
    font-weight: 600;
}

.vis-item.timeline-eol-expired.vis-dot {
    border-color: #ef4444;
}

.vis-item.timeline-eol-warning {
    color: #f59e0b;
}

.vis-item.timeline-eol-warning .vis-item-content {
    color: #92400e;
    font-weight: 500;
}

.vis-item.timeline-eol-warning.vis-dot {
    border-color: #f59e0b;
}

.vis-item.timeline-eol-ok {
    color: #22c55e;
}

.vis-item.timeline-eol-ok .vis-item-content {
    color: #166534;
}

.vis-item.timeline-eol-ok.vis-dot {
    border-color: #22c55e;
}

/* Covered EOL items (have an active obsolescence plan) */
.vis-item.timeline-eol-covered.vis-dot {
    border-width: 4px;
    box-shadow: 0 0 0 2px rgba(129, 188, 0, 0.3);
}

.timeline-covered-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 10px;
    font-weight: 700;
    background: #81bc00;
    color: #fff;
    border-radius: 50%;
    margin-left: 3px;
    flex-shrink: 0;
    vertical-align: middle;
    line-height: 1;
}

/* Commitment vs Forecast visual distinction */
.vis-item.timeline-commitment {
    border-left-width: 4px;
    border-left-style: solid;
}

.vis-item.timeline-forecast {
    border-left-width: 3px;
    border-left-style: dashed;
    opacity: 0.8;
}

/* Background items (planning periods) */
.vis-item.vis-background.timeline-period {
    background-color: rgba(59, 130, 246, 0.05);
    border-left: 1px dashed rgba(59, 130, 246, 0.3);
}

.vis-item.vis-background.timeline-period-current {
    background-color: rgba(129, 188, 0, 0.08);
    border-left: 2px solid rgba(129, 188, 0, 0.4);
}

/* ── Custom item template elements ────────────── */

.timeline-item-content {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 100%;
    flex-wrap: wrap;
}

.timeline-item-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    font-weight: 500;
    font-size: 11px;
}

.timeline-priority-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.timeline-jira-badge {
    font-size: 9px;
    background: rgba(0, 0, 0, 0.08);
    color: #6b7280;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 600;
    white-space: nowrap;
}

/* Progress bar inside items */
.timeline-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 0 0 6px 6px;
}

.timeline-progress-fill {
    height: 100%;
    background: #81bc00;
    border-radius: 0 0 6px 0;
    transition: width 0.3s ease;
}

/* ── Zoom controls ────────────── */

.timeline-controls {
    display: flex;
    gap: 4px;
    padding: 8px 0;
    justify-content: flex-end;
}

.timeline-zoom-btn {
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.15s ease;
}

.timeline-zoom-btn:hover {
    background: #81bc00;
    color: #fff;
    border-color: #81bc00;
}

/* ── Toast notifications ────────────── */

.timeline-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 10px 20px;
    background: #1f2937;
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.timeline-toast-error {
    background: #ef4444;
}

.timeline-toast-hide {
    opacity: 0;
    transform: translateY(10px);
}

/* ── Tooltip overrides ────────────── */

.vis-tooltip {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    background: #1f2937;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    max-width: 300px;
    line-height: 1.5;
}

/* ── Filter controls ────────────── */

.timeline-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 8px;
}

.timeline-filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.timeline-filter-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    white-space: nowrap;
    margin-right: 2px;
}

.timeline-filter-check {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 11px;
    color: #4b5563;
    white-space: nowrap;
}

.timeline-filter-check input[type="checkbox"] {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    cursor: pointer;
}

.timeline-filter-select {
    font-size: 11px;
    font-family: 'Inter', sans-serif;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 3px 8px;
    background: #fff;
    color: #374151;
    cursor: pointer;
}

.timeline-filter-select:focus {
    outline: none;
    ring: 2px;
    border-color: #81bc00;
    box-shadow: 0 0 0 2px rgba(129, 188, 0, 0.2);
}

/* Separator between filter groups */
.timeline-filter-group + .timeline-filter-group {
    padding-left: 12px;
    border-left: 1px solid #e5e7eb;
}

/* ── Responsive ────────────── */

@media (max-width: 768px) {
    .timeline-item-label {
        max-width: 120px;
        font-size: 10px;
    }

    .timeline-jira-badge {
        display: none;
    }

    .timeline-controls {
        flex-wrap: wrap;
    }

    .timeline-zoom-btn {
        font-size: 10px;
        padding: 3px 8px;
    }

    .timeline-filters {
        gap: 8px;
        padding: 8px 10px;
    }

    .timeline-filter-group + .timeline-filter-group {
        padding-left: 8px;
    }

    .timeline-filter-check span {
        font-size: 10px;
    }
}
