/**
 * Mix History Timeline Styles
 *
 * @author Amit Haridas, ConcreteInfo
 */

/* Timeline container */
.mix-history-timeline {
    position: relative;
    padding-left: 30px;
}

/* Timeline item */
.timeline-item {
    position: relative;
    padding-bottom: 24px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

/* Marker */
.timeline-marker {
    position: absolute;
    left: -30px;
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--color-gray-300, #d1d5db);
    border: 2px solid var(--bg-elevated, #fff);
    z-index: 1;
}

.timeline-dot--active {
    background-color: var(--color-brand);
    box-shadow: 0 0 0 4px hsl(var(--color-brand-h) var(--color-brand-s) var(--color-brand-l) / 0.2);
}

.dark .timeline-dot {
    border-color: var(--bg-elevated, #1f2937);
}

.timeline-line {
    width: 2px;
    flex: 1;
    background-color: var(--color-gray-200, #e5e7eb);
    margin-top: 4px;
    min-height: 30px;
}

.dark .timeline-line {
    background-color: var(--color-gray-700, #374151);
}

/* Content */
.timeline-content {
    background-color: var(--bg-elevated, #fff);
    border: 1px solid var(--border-subtle, #e5e7eb);
    border-radius: var(--radius-lg, 0.5rem);
    padding: var(--spacing-4, 1rem);
    margin-left: var(--spacing-2, 0.5rem);
}

.dark .timeline-content {
    background-color: var(--bg-secondary, #1f2937);
    border-color: var(--color-gray-700, #374151);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-2, 0.5rem);
}

.timeline-title {
    font-weight: var(--font-weight-semibold, 600);
    color: var(--text-primary, #1f2937);
}

.dark .timeline-title {
    color: var(--text-primary, #f9fafb);
}

.timeline-time {
    font-size: var(--font-size-xs, 0.75rem);
    color: var(--text-tertiary, #9ca3af);
}

/* Changes list */
.timeline-changes {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--spacing-3, 0.75rem) 0;
    font-size: var(--font-size-sm, 0.875rem);
}

.timeline-changes li {
    position: relative;
    padding-left: var(--spacing-4, 1rem);
    margin-bottom: var(--spacing-1, 0.25rem);
    color: var(--text-secondary, #6b7280);
}

.timeline-changes li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--color-brand);
}

/* Material changes table */
.material-changes-table {
    width: 100%;
    font-size: var(--font-size-xs, 0.75rem);
    margin-bottom: var(--spacing-3, 0.75rem);
}

.material-changes-table th,
.material-changes-table td {
    padding: var(--spacing-2, 0.5rem);
    text-align: left;
    border-bottom: 1px solid var(--border-subtle, #e5e7eb);
}

.material-changes-table th {
    font-weight: var(--font-weight-medium, 500);
    color: var(--text-tertiary, #9ca3af);
}

.material-changes-table .value-prev {
    color: var(--color-red-500, #ef4444);
}

.material-changes-table .value-new {
    color: var(--color-green-500, #22c55e);
    font-weight: var(--font-weight-medium, 500);
}

/* Actions */
.timeline-actions {
    display: flex;
    gap: var(--spacing-2, 0.5rem);
    padding-top: var(--spacing-2, 0.5rem);
    border-top: 1px solid var(--border-subtle, #e5e7eb);
}

/* Latest badge */
.timeline-item--latest .timeline-content {
    border-color: var(--color-brand);
}

.timeline-item--latest .timeline-content::before {
    content: 'Latest';
    position: absolute;
    top: -10px;
    right: 10px;
    font-size: 10px;
    padding: 2px 8px;
    background-color: var(--color-brand);
    color: white;
    border-radius: var(--radius-full, 9999px);
    text-transform: uppercase;
    font-weight: var(--font-weight-semibold, 600);
}
