/* Pipeline Page Styles - Lucius Component */
:root {
    --pipeline-orange: #ff9329;
    --pipeline-orange-dim: rgba(255, 147, 41, 0.15);
    --pipeline-bg: #0a0a0a;
    --pipeline-surface: rgba(20, 20, 22, 0.85);
    --pipeline-border: rgba(255, 147, 41, 0.12);
    --pipeline-text: #e5e5e5;
    --pipeline-text-muted: #888;
    --pipeline-green: #4ade80;
    --pipeline-red: #ff4a4a;
}

.pipeline-page {
    background: var(--pipeline-bg);
    color: var(--pipeline-text);
    font-family: 'Inter', -apple-system, sans-serif;
    min-height: 100vh;
}

.pipeline-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 48px 24px;
}

/* ─── Header ─── */
.pipeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
}

.pipeline-header .brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.pipeline-header .brand img {
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 0 20px rgba(255, 147, 41, 0.5));
}

.pipeline-header .brand h1 {
    font-family: 'Orbitron', monospace;
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ff9329, #ff6b4a);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 3px;
    margin: 0;
}

.pipeline-header .brand p {
    font-size: 11px;
    color: #666;
    margin: 2px 0 0;
}

.run-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ff9329 0%, #ff6b00 100%);
    border: none;
    color: #111;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: 13px;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(255, 147, 41, 0.3);
}

.run-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(255, 147, 41, 0.5);
}

.run-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.run-icon {
    font-size: 16px;
}

/* ─── Pipeline Flow ─── */
.pipeline-flow {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: 0;
}

.pipeline-stage {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    position: relative;
    cursor: pointer;
}

.stage-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 56px;
    padding-top: 20px;
    position: relative;
    z-index: 2;
}

.stage-number {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 147, 41, 0.15);
    border: 2px solid rgba(255, 147, 41, 0.3);
    color: #ff9329;
    font-family: 'Orbitron', monospace;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.stage-status-icon {
    font-size: 16px;
    line-height: 1;
}

.stage-connector {
    position: absolute;
    left: 28px;
    top: 58px;
    bottom: -20px;
    width: 2px;
    background: linear-gradient(to bottom, rgba(255, 147, 41, 0.3), rgba(255, 147, 41, 0.05));
    z-index: 1;
}

.pipeline-stage:last-child .stage-connector {
    display: none;
}

/* ─── Stage Card ─── */
.stage-card {
    flex: 1;
    background: var(--pipeline-surface);
    border: 1px solid var(--pipeline-border);
    border-radius: 8px;
    padding: 20px;
    margin: 8px 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(12px);
}

.stage-card:hover {
    border-color: rgba(255, 147, 41, 0.3);
    box-shadow: 0 0 20px rgba(255, 147, 41, 0.08);
}

.stage-card.expanded {
    border-color: rgba(255, 147, 41, 0.4);
    box-shadow: 0 0 30px rgba(255, 147, 41, 0.12);
}

.stage-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.stage-header h2 {
    font-family: 'Orbitron', monospace;
    font-size: 14px;
    font-weight: 700;
    color: #ff9329;
    letter-spacing: 1px;
    margin: 0;
}

.stage-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stage-badge.trigger {
    background: rgba(255, 147, 41, 0.2);
    color: #ff9329;
    border: 1px solid rgba(255, 147, 41, 0.3);
}

.stage-badge.check {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.25);
}

.stage-badge.build {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(96, 165, 250, 0.25);
}

.stage-badge.deploy {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.25);
}

.stage-preview {
    font-size: 13px;
    color: #999;
    margin-top: 4px;
}

/* ─── Stage Detail (Expandable) ─── */
.stage-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
    opacity: 0;
    margin-top: 0;
}

.stage-detail.open {
    max-height: 600px;
    opacity: 1;
    margin-top: 16px;
}

.detail-content {
    padding: 16px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-content p {
    font-size: 13px;
    color: #ccc;
    line-height: 1.6;
    margin: 0 0 12px;
}

.detail-content p:last-child {
    margin-bottom: 0;
}

.detail-content h4 {
    font-family: 'Orbitron', monospace;
    font-size: 11px;
    color: #ff9329;
    margin: 16px 0 8px;
    letter-spacing: 0.5px;
}

.detail-content ul {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
}

.detail-content li {
    font-size: 12px;
    color: #aaa;
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-content li::before {
    content: '→';
    color: #ff9329;
}

.detail-content code {
    background: rgba(255, 147, 41, 0.1);
    padding: 1px 6px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: #ff9329;
}

.detail-snippet {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    margin-top: 8px;
}

.detail-snippet code {
    font-size: 13px;
    background: transparent;
    color: #4ade80;
}

.snippet-hint {
    font-size: 10px;
    color: #666;
}

.detail-note {
    font-size: 12px;
    color: #aaa;
    padding: 10px 14px;
    background: rgba(255, 147, 41, 0.06);
    border-left: 3px solid #ff9329;
    border-radius: 0 4px 4px 0;
    margin-top: 12px;
}

.detail-note strong {
    color: #ff9329;
}

/* ─── Reference Section ─── */
.pipeline-reference {
    margin-top: 48px;
}

.pipeline-reference h2 {
    font-family: 'Orbitron', monospace;
    font-size: 16px;
    color: #ff9329;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.ref-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.ref-card {
    background: var(--pipeline-surface);
    border: 1px solid var(--pipeline-border);
    border-radius: 8px;
    padding: 20px;
}

.ref-card h3 {
    font-family: 'Orbitron', monospace;
    font-size: 12px;
    color: #ff9329;
    margin: 0 0 14px;
    letter-spacing: 0.5px;
}

.ref-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ref-card li {
    font-size: 12px;
    color: #aaa;
    padding: 4px 0;
    line-height: 1.5;
}

.ref-card li::before {
    content: '•';
    color: #ff9329;
    margin-right: 8px;
}

.ref-code,
.ref-file {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.ref-code:last-child,
.ref-file:last-child {
    border-bottom: none;
}

.ref-code code,
.ref-file code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #ddd;
}

.ref-code span,
.ref-file span {
    font-size: 10px;
    color: #666;
}

/* ─── YAML Section ─── */
.pipeline-yaml {
    margin-top: 48px;
}

.pipeline-yaml h2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: 'Orbitron', monospace;
    font-size: 16px;
    color: #ff9329;
    margin-bottom: 16px;
    letter-spacing: 1px;
}

.toggle-yaml-btn {
    background: rgba(255, 147, 41, 0.1);
    border: 1px solid rgba(255, 147, 41, 0.25);
    color: #ff9329;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-yaml-btn:hover {
    background: rgba(255, 147, 41, 0.2);
}

.pipeline-yaml pre {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 147, 41, 0.1);
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
    margin: 0;
}

.pipeline-yaml pre.open {
    max-height: 2000px;
}

.pipeline-yaml code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: #ccc;
    line-height: 1.6;
    white-space: pre;
}

/* ─── Footer ─── */
.pipeline-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 48px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
}

.footer-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer-label {
    font-family: 'Orbitron', monospace;
    font-size: 9px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-value {
    font-size: 12px;
    color: #aaa;
}

.footer-value code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #ff9329;
}

/* ─── Animations ─── */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .pipeline-container {
        padding: 24px 16px;
    }

    .pipeline-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .ref-grid {
        grid-template-columns: 1fr;
    }

    .pipeline-footer {
        flex-direction: column;
        gap: 16px;
    }

    .stage-card {
        padding: 14px;
    }
}
