/* ============================================================
   Timeline Page Styles
   /css/pages/timeline.css
   
   Supports both .theme-light and .theme-dark via CSS variables.
   ============================================================ */

/* ---- Empty State ---- */
.timeline-empty {
    text-align: center;
    padding: 3rem 1rem;
}

.timeline-empty > i {
    font-size: 3rem;
    color: var(--text-muted, #6c757d);
    opacity: 0.3;
    display: block;
    margin-bottom: 1rem;
}

/* ---- Timeline Container ---- */
.bus-timeline {
    position: relative;
    padding-left: 40px;
}

/* Vertical line */
.bus-timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color, #dee2e6);
}

/* ---- Timeline Item ---- */
.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

/* ---- Timeline Dot ---- */
.timeline-dot {
    position: absolute;
    left: -40px;
    top: 2px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.7rem;
    z-index: 2;
    box-shadow: 0 0 0 3px var(--card-bg, #fff);
}

.theme-dark .timeline-dot {
    box-shadow: 0 0 0 3px var(--card-bg, #1a1a2e);
}

/* ---- Timeline Content ---- */
.timeline-content {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    position: relative;
    transition: box-shadow 0.2s;
}

.timeline-content:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.theme-dark .timeline-content {
    background: var(--card-bg, #1e1e2f);
    border-color: var(--border-color, #2d2d44);
}

.theme-dark .timeline-content:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Left arrow pointer on content card */
.timeline-content::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 10px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid var(--border-color, #dee2e6);
}

.timeline-content::after {
    content: '';
    position: absolute;
    left: -7px;
    top: 10px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid var(--card-bg, #fff);
}

.theme-dark .timeline-content::before {
    border-right-color: var(--border-color, #2d2d44);
}

.theme-dark .timeline-content::after {
    border-right-color: var(--card-bg, #1e1e2f);
}

/* ---- Title ---- */
.timeline-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-color, #333);
    margin-bottom: 0.35rem;
    line-height: 1.4;
}

/* ---- Description ---- */
.timeline-description {
    font-size: 0.88rem;
    color: var(--text-muted, #6c757d);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* ---- Meta Row ---- */
.timeline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted, #6c757d);
}

.timeline-meta a {
    color: var(--primary-color, #ffc107);
    text-decoration: none;
}

.timeline-meta a:hover {
    text-decoration: underline;
}

/* ---- Date ---- */
.timeline-date {
    white-space: nowrap;
}

/* ---- Event Type Badge ---- */
.timeline-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

/* ---- Source ---- */
.timeline-source a {
    color: var(--text-muted, #6c757d);
    text-decoration: underline;
    text-decoration-style: dotted;
}

.timeline-source a:hover {
    color: var(--primary-color, #ffc107);
}

/* ---- Auto-generated Badge ---- */
.timeline-auto-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--table-header-bg, #f8f9fa);
    color: var(--text-muted, #6c757d);
    border-radius: 3px;
    padding: 0.1rem 0.4rem;
    font-size: 0.7rem;
}

.theme-dark .timeline-auto-badge {
    background: var(--table-header-bg, #16213e);
}

/* ---- Operator Link ---- */
.timeline-operator-link {
    color: var(--primary-color, #ffc107) !important;
}

/* ---- Action Buttons (Edit/Delete) ---- */
.timeline-actions {
    float: right;
    display: flex;
    gap: 0.35rem;
    margin-left: 0.75rem;
    margin-bottom: 0.25rem;
}

.timeline-actions .btn {
    padding: 0.2rem 0.45rem;
    font-size: 0.72rem;
    line-height: 1;
    border-radius: 4px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.timeline-content:hover .timeline-actions .btn {
    opacity: 1;
}

/* ---- Responsive ---- */
@media (max-width: 576px) {
    .bus-timeline {
        padding-left: 32px;
    }

    .bus-timeline::before {
        left: 11px;
    }

    .timeline-dot {
        left: -32px;
        width: 24px;
        height: 24px;
        font-size: 0.6rem;
    }

    .timeline-content {
        padding: 0.75rem 1rem;
    }

    .timeline-content::before,
    .timeline-content::after {
        left: -6px;
        border-top-width: 6px;
        border-bottom-width: 6px;
        border-right-width: 6px;
    }

    .timeline-content::after {
        left: -5px;
    }

    .timeline-meta {
        font-size: 0.75rem;
        gap: 0.4rem;
    }

    .timeline-actions {
        float: none;
        margin: 0 0 0.5rem 0;
    }
}
