/* Performance Review Timeline Styles */

/* Vertical Timeline Styles - Shared Component */
.timeline {
    position: relative;
    padding-left: 2rem;
    list-style: none;
    margin: 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
    z-index: 0;
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
    display: block;
}

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

.timeline-marker {
    position: absolute;
    left: -2rem;
    top: 0.25rem;
    width: 2rem;
    height: 2rem;
    background: #fff;
    border: 2px solid #dee2e6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    z-index: 2;
}

.timeline-marker.bg-success {
    background-color: var(--bs-success, #198754) !important;
    border-color: var(--bs-success, #198754) !important;
}

.timeline-marker.bg-primary {
    background-color: var(--bs-primary, #0d6efd) !important;
    border-color: var(--bs-primary, #0d6efd) !important;
}

.timeline-marker .text-white {
    color: #fff !important;
}

.timeline-content {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-left: 1rem;
    position: relative;
    z-index: 1;
}

.timeline-content h6 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: #495057;
}

.timeline-content .small {
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Ensure timeline items don't get styled as progress bars */
.timeline-item {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    height: auto !important;
    width: auto !important;
}

/* Override any conflicting Bootstrap or custom progress bar styles */
.timeline .timeline-item:not(.progress):not(.progress-bar) {
    background: transparent !important;
    display: block !important;
    position: relative !important;
}

/* Specific overrides for custom.css conflicts */
.timeline .timeline-item:before {
    display: none !important;
    border: none !important;
    width: 0 !important;
    height: 0 !important;
}

.timeline .timeline-marker {
    z-index: 1000 !important;
    position: absolute !important;
    left: -2rem !important;
    top: 0.25rem !important;
    width: 2rem !important;
    height: 2rem !important;
    background: #fff !important;
    border: 2px solid #dee2e6 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.75rem !important;
}

/* Force timeline structure to display correctly */
.timeline {
    position: relative !important;
    padding-left: 2rem !important;
    list-style: none !important;
    margin: 0 !important;
}

.timeline::before {
    content: '' !important;
    position: absolute !important;
    left: 1rem !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 2px !important;
    background: #dee2e6 !important;
    z-index: 0 !important;
}

.timeline-horizontal {
    position: relative;
    padding: 20px 0;
}

.timeline-line {
    position: absolute;
    top: 32px;
    left: 12.5%;
    right: 12.5%;
    height: 2px;
    background: linear-gradient(to right, #198754 0%, #198754 var(--progress-width, 0%), #e9ecef var(--progress-width, 0%), #e9ecef 100%);
    z-index: 1;
}

.timeline-step {
    position: relative;
    z-index: 2;
    max-width: 200px;
}

.timeline-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 3;
    position: relative;
}

.timeline-circle.completed {
    background-color: var(--bs-success, #198754);
    color: var(--bs-on-success, #fff);
    border: 3px solid #fff;
}

.timeline-circle.pending {
    background-color: #f8f9fa;
    color: #6c757d;
    border: 3px solid #e9ecef;
}

.timeline-circle:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.timeline-connector {
    flex: 1;
    height: 2px;
    margin: 0 -1px;
    position: relative;
    top: 24px;
    z-index: 1;
}

.timeline-connector.completed {
    background-color: var(--bs-success, #198754);
}

.timeline-connector.pending {
    background-color: #e9ecef;
}

.timeline-content {
    padding: 0 8px;
    min-height: 80px;
}

.timeline-content h6 {
    color: #495057;
    margin-bottom: 4px;
}

/* X1 (cross-app contrast, 2026-09-27): the timeline card's inks are the
   tenant's measured ones, not literals. `#6c757d` read 4.44:1 on the #f8f9fa
   card (Tasks' activity timeline), and the raw `--bs-success` pinned over the
   theme's clamped `.text-success` put an unmeasured brand green on it. The
   muted ink is BusinessTheme's (clamped against every surface, the #f5f7fb
   shell included, which is darker than this card); `.text-success` is left to
   the theme's own clamped rule. */
.timeline-content .text-muted {
    color: var(--text-muted, #5c636a) !important;
    line-height: 1.3;
}

/* Responsive timeline for mobile */
@media (max-width: 768px) {
    .timeline-horizontal {
        padding: 15px 0;
    }

    .timeline-circle {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .timeline-line {
        top: 20px;
        left: 10%;
        right: 10%;
    }

    .timeline-connector {
        top: 20px;
    }

    .timeline-content {
        padding: 0 4px;
        min-height: 70px;
    }

    .timeline-content h6 {
        font-size: 0.8rem;
    }

    .timeline-content .small {
        font-size: 0.7rem !important;
    }

    .timeline-content div[style*="font-size: 0.75rem"] {
        font-size: 0.65rem !important;
    }
}

/* Quick stats styling */
.performance-review-status-card .row .col-6,
.performance-review-status-card .row .col-md-3 {
    margin-bottom: 1rem;
}

.performance-review-status-card .text-center {
    padding: 0.5rem;
}

.performance-review-status-card .text-center:hover {
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease;
}

/* Animation for progress */
@keyframes progressFill {
    from {
        width: 0%;
    }

    to {
        width: var(--progress-width);
    }
}

.timeline-line {
    animation: progressFill 1s ease-out;
}

/* Status indicators with better visual hierarchy */
.timeline-content .fw-medium {
    font-size: 0.85rem;
}

.timeline-content .small.fw-medium {
    font-weight: 600 !important;
}

/* Audit log uses the vertical timeline; reset .timeline-content rules above
 * that were defined unscoped but were intended for .timeline-horizontal
 * (min-height: 80px / padding: 0 8px). Without this, short audit entries
 * sit top-aligned with empty space below them, leaving the white card flush
 * to the top of an inflated gray container. (ISS-20260506-769-C4268D) */
.audit-log-timeline .timeline-content {
    padding: 1rem;
    min-height: 0;
}

/* Sourcing-campaign show timeline — vertically center the marker dot with
 * its content rectangle so the icon and label baseline match (the default
 * top: 0.25rem aligns the dot with the first text line). */
.campaign-timeline .timeline-marker {
    top: 50% !important;
    transform: translateY(-50%) !important;
}

/* Reset the unscoped .timeline-content min-height: 80px (intended for the
 * horizontal timeline) so vertical campaign-timeline pills size to their
 * actual content and the text is vertically centered inside the gray
 * rectangle rather than top-aligned with empty space below.
 * (ISS-20260515-991-28E76D) */
.campaign-timeline .timeline-content {
    padding: 1rem;
    min-height: 0;
}

/* OKR Hub objective show timeline — same vertical-timeline alignment fix as
 * campaign/audit-log above. The default top: 0.25rem aligns the marker dot
 * with the first text line instead of the card's vertical center, and the
 * unscoped min-height: 80px (intended for .timeline-horizontal) inflates each
 * card so short Start/End/Days-remaining content sits top-aligned with empty
 * space below it. Center the dot and size the card to its content.
 * (ISS-20260612-137-A872BC) */
.okr-objective-timeline .timeline-marker {
    top: 50% !important;
    transform: translateY(-50%) !important;
}

.okr-objective-timeline .timeline-content {
    padding: 1rem;
    min-height: 0;
}

/* Compensation Management history timeline — same vertical-timeline fix as
 * audit-log/campaign/okr above. The unscoped .timeline-content padding: 0 8px
 * (intended for .timeline-horizontal) overrides the vertical timeline's
 * padding: 1rem on equal specificity, zeroing the top/bottom padding. That
 * leaves the "Effective Soon" / "Retroactive" badge flush against the top edge
 * of the gray content box with no spacing, looking cramped and misaligned.
 * Restore proper padding and let the card size to its content.
 * (ISS-20260625-685-7C57B9) */
.compensation-history-timeline .timeline-content {
    padding: 1rem;
    min-height: 0;
}

/* ── X1 (cross-app contrast, 2026-09-27): the timeline in the dark theme ────
   Every surface in this file is a light literal with no dark twin, and it is
   loaded by shared/_head for every layout: each vertical timeline entry was a
   #f8f9fa slab under the dark theme's near-white text, 1.13-1.24:1 (Guest
   Pass's activity log, Tasks, and every other view that renders
   `.timeline-content` — Console #4091), on a white rail with white marker
   discs. The card takes AdminKit's dark tertiary ground (the recessed panel
   every dark ink is clamped against, BusinessTheme ADMINKIT_DARK_PANEL_BG),
   and the rail and the default marker disc the theme's border and card. A
   marker that carries its own `bg-{tone}` keeps it: those rules are
   `!important` too and the view-level marker styles load later. */
:root[data-theme="dark"] .timeline-content {
    background: var(--bs-tertiary-bg, #384350);
    border-color: var(--bs-border-color, #4b4b4b);
}
/* A view that draws the card's pointer as a border triangle (issue reports) points it in the card's colour. */
:root[data-theme="dark"] .timeline-content::before {
    border-right-color: var(--bs-tertiary-bg, #384350);
}
:root[data-theme="dark"] .timeline::before {
    background: var(--bs-border-color, #4b4b4b) !important;
}
:root[data-theme="dark"] .timeline .timeline-marker:not([class*="bg-"]) {
    background: var(--bs-card-bg, #333333) !important;
    border-color: var(--bs-border-color, #4b4b4b) !important;
}
:root[data-theme="dark"] .timeline-circle.pending {
    background-color: var(--bs-tertiary-bg, #384350);
    color: var(--text-muted, #c2bac1);
    border-color: var(--bs-border-color, #4b4b4b);
}
:root[data-theme="dark"] .timeline-connector.pending {
    background-color: var(--bs-border-color, #4b4b4b);
}
/* ── end X1 ── */
