/**
 * Container Lifecycle Status Bar Styles
 *
 * @issue  #5663 — Container Lifecycle Status System
 * @author Olivier RAVEAU - Oliv.Ai
 * @date   2026-03-22
 */

/* === Status Bar Container === */
.container-status-bar {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 8px 0;
}

.container-status-bar.compact {
    padding: 6px 10px;
}

/* === Header — Issue #6379: Prevent overflow on narrow screens === */
.csb-header .csb-type-badge {
    font-size: 0.8rem;
    font-weight: 600;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* === Step Markers === */
.csb-steps {
    position: relative;
}

.csb-step {
    text-align: center;
    flex: 1;
    position: relative;
}

.csb-step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    margin: 0 auto 4px;
    border: 2px solid #dee2e6;
    background: #fff;
    color: #adb5bd;
    transition: all 0.3s ease;
}

.csb-step.done .csb-step-dot {
    background: #198754;
    border-color: #198754;
    color: #fff;
}

.csb-step.active .csb-step-dot {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

.csb-step.future .csb-step-dot {
    background: #f8f9fa;
    border-color: #dee2e6;
    color: #adb5bd;
}

.csb-step-label {
    font-size: 0.65rem;
    color: #6c757d;
    line-height: 1.2;
    max-width: 80px;
    margin: 0 auto;
    word-wrap: break-word;
}

.csb-step.done .csb-step-label {
    color: #198754;
    font-weight: 600;
}

.csb-step.active .csb-step-label {
    color: #0d6efd;
    font-weight: 700;
}

/* === Progress Bar === */
/* Reset Logistik theme global .progress overrides (style.css:10726) */
/* Issue #5790: Must use !important — theme .progress has position:absolute, width:190px, etc. */
.csb-progress {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    -webkit-transform: none !important;
    -ms-transform: none !important;
    display: flex !important;
    width: 100% !important;
    height: 8px !important;
    border-radius: 4px !important;
    overflow: hidden !important;
    background: #e9ecef !important;
    background-image: none !important;
    background-size: auto !important;
    transition: none !important;
}

.csb-progress .progress-bar {
    transition: width 0.6s ease;
    border-radius: 4px;
}

/* === Message === */
.csb-message {
    font-size: 0.82rem;
}

.csb-message code {
    font-size: 0.75rem;
    background: #f0f0f1;
    padding: 1px 4px;
    border-radius: 3px;
}

/* === TOS Source Indicator === */
.csb-source .badge {
    font-size: 0.7rem;
    font-weight: 500;
}

/* === Special States — Issue #6379: Fix badge layout + spacing === */
.csb-special-states {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.csb-special-states .badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35em 0.65em;
    white-space: nowrap;
    border-radius: 0.375rem;
}

/* === Events Timeline === */
.csb-timeline {
    position: relative;
    padding-left: 28px;
}

.csb-timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: #dee2e6;
}

.csb-timeline-item {
    position: relative;
    padding: 6px 0 6px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.csb-timeline-icon {
    position: absolute;
    left: -22px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #6c757d;
    z-index: 1;
}

.csb-timeline-item.past .csb-timeline-icon {
    background: #198754;
    border-color: #198754;
    color: #fff;
}

.csb-timeline-item.future .csb-timeline-icon {
    background: #f8f9fa;
    border-color: #adb5bd;
    color: #adb5bd;
}

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

.csb-timeline-content strong {
    font-weight: 600;
}

.csb-timeline-date {
    font-size: 0.72rem;
}

/* === Issue #6117: Date color badges — DRY: past=red, today=yellow, future=green === */
.csb-date-badge {
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.72rem;
    font-weight: 500;
}
.csb-date-past {
    background-color: #f8d7da;
    color: #842029;
}
.csb-date-today {
    background-color: #fff3cd;
    color: #664d03;
}
.csb-date-future {
    background-color: #d1e7dd;
    color: #0f5132;
}
/* Issue #6125: Completion dates — past=green (done!), future=yellow (pending) */
.csb-date-past-good {
    background-color: #d1e7dd;
    color: #0f5132;
}
.csb-date-future-warn {
    background-color: #fff3cd;
    color: #664d03;
}
/* Issue #6125: Neutral dates — no semantic color (informational) */
.csb-date-neutral {
    background-color: #e2e3e5;
    color: #41464b;
}

/* === Compact Mode === */
.container-status-bar.compact .csb-steps {
    display: none;
}

.container-status-bar.compact .csb-message {
    font-size: 0.75rem;
}

.container-status-bar.compact .csb-special-states .badge {
    font-size: 0.65rem;
}

/* === Responsive === */
@media (max-width: 768px) {
    .csb-step-label {
        display: none;
    }
    .csb-step-dot {
        width: 22px;
        height: 22px;
        font-size: 9px;
    }
}

/* === Admin Context (TOS Debug) === */
.tos-debug-tab .container-status-bar {
    background: #f6f7f7;
    border-color: #c3c4c7;
}

.tos-debug-tab .csb-step.done .csb-step-dot {
    background: #00a32a;
    border-color: #00a32a;
}

.tos-debug-tab .csb-step.active .csb-step-dot {
    background: #2271b1;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.25);
}
