/* Case header card */
.case-header-card {
    border-left: 4px solid #0d6efd;
    background: linear-gradient(90deg, #f8f9ff 0%, white 100%);
}

.case-header-card a {
    color: #6c757d;
    transition: color 0.2s;
}

.case-header-card a:hover {
    color: #0d6efd;
}

.case-header-card a i {
    font-size: 1.1rem;
}

/* Sidebar styles */
#sidebar-container {
    transition: all 0.3s ease;
}

#sidebar-container.sidebar-collapsed {
    width: 40px;
    flex: 0 0 40px;
    max-width: 40px;
    padding-right: 0;
}

.sidebar-toggle {
    display: none;
    width: 36px;
    height: 36px;
    background: #6c757d;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 20px;
}

.sidebar-toggle:hover {
    background: #5a6268;
}

#sidebar-container.sidebar-collapsed .sidebar-toggle {
    display: flex;
}

#sidebar-container.sidebar-collapsed .cases-sidebar {
    display: none !important;
}

#content-container {
    transition: all 0.3s ease;
}

/* Step colors */
:root {
    --step-1-color: #3b82f6;
    --step-2-color: #8b5cf6;
    --step-3-color: #14b8a6;
    --step-4-color: #64748b;
}

/* Timeline layout */
.pipeline-timeline {
    position: relative;
    padding-left: 30px;
}

.pipeline-card {
    position: relative;
    margin-bottom: 1rem;
}

.pipeline-card::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 0;
    bottom: -1rem;
    width: 2px;
    background: #dee2e6;
}

.pipeline-card:last-child::before {
    display: none;
}

.pipeline-card::after {
    content: '';
    position: absolute;
    left: -25px;
    top: 20px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--card-color, #6c757d);
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--card-color, #6c757d);
}

/* Step header cards */
.step-header-card {
    background: linear-gradient(135deg, var(--card-color) 0%, color-mix(in srgb, var(--card-color) 80%, black) 100%);
    color: white;
}

.step-header-card .card-body {
    padding: 0.75rem 1rem;
}

/* Extraction cards */
.extraction-card {
    border-left: 4px solid var(--card-color, #6c757d);
}

.extraction-card.empty {
    opacity: 0.5;
}

.extraction-card .card-header {
    background: color-mix(in srgb, var(--card-color) 10%, white);
    border-bottom: 1px solid color-mix(in srgb, var(--card-color) 20%, white);
    padding: 0.5rem 1rem;
}

/* Prompt/Response sections */
.prompt-section, .response-section {
    background: #f8f9fa;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.prompt-section .section-header,
.response-section .section-header {
    padding: 0.5rem 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.prompt-section .section-header:hover,
.response-section .section-header:hover {
    background: #e9ecef;
}

.prompt-text, .response-text {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    background: white;
    padding: 1rem;
    border-radius: 0.25rem;
    margin: 0 1rem 1rem 1rem;
    border: 1px solid #dee2e6;
}

/* Entity list */
.entity-list {
    max-height: 300px;
    overflow-y: auto;
}

.entity-item {
    background: white;
    border-left: 3px solid var(--entity-color, #6c757d);
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.entity-item .entity-label {
    font-weight: 600;
    color: var(--entity-color, #2e59d9);
}

.entity-item .entity-definition {
    color: #6c757d;
    font-size: 0.8rem;
}

/* Metadata bar */
.metadata-bar {
    font-size: 0.75rem;
    color: #6c757d;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

/* Activity Log styles */
.activity-timeline {
    position: relative;
    padding-left: 30px;
}

.activity-card {
    position: relative;
    margin-bottom: 1rem;
}

.activity-card::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 0;
    bottom: -1rem;
    width: 2px;
    background: #dee2e6;
}

.activity-card:last-child::before {
    display: none;
}

.activity-card::after {
    content: '';
    position: absolute;
    left: -25px;
    top: 20px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--activity-color, #6c757d);
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--activity-color, #6c757d);
}

.activity-extraction { --activity-color: #3b82f6; }
.activity-llm_query { --activity-color: #8b5cf6; }
.activity-composition { --activity-color: #14b8a6; }
.activity-alignment { --activity-color: #06b6d4; }
.activity-enrichment { --activity-color: #22c55e; }
.activity-synthesis { --activity-color: #f59e0b; }
.activity-storage { --activity-color: #64748b; }
.activity-analysis { --activity-color: #ec4899; }

.activity-card .card {
    border-left: 4px solid var(--activity-color, #6c757d);
}

.activity-card .card-header {
    background: linear-gradient(90deg, color-mix(in srgb, var(--activity-color) 10%, white), white);
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e3e6f0;
}

.activity-card .card-body {
    padding: 0.75rem;
}

.status-completed { background: #198754; }
.status-failed { background: #dc3545; }
.status-running { background: #0d6efd; }
