/* Modern CI/CD pipeline panel — looping run animation */
.pipeline-panel {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(70% 80% at 100% 0%, rgba(109, 124, 255, 0.14), transparent 55%),
        radial-gradient(50% 60% at 0% 100%, rgba(34, 197, 94, 0.08), transparent 50%),
        #0d1018;
}

.pipeline-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 85%);
    pointer-events: none;
}

.pipeline-head {
    position: relative;
    z-index: 1;
}

.pipeline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    font-size: 0.78rem;
    font-weight: 600;
}

.pipeline-status,
.pipeline-duration {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 999px;
    padding: 0.32rem 0.72rem;
    transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.pipeline-status.is-success,
.pipeline-status:not(.is-running) {
    color: #4ade80;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.35);
    box-shadow: 0 0 18px rgba(34, 197, 94, 0.12);
}

.pipeline-status.is-running {
    color: #93a0ff;
    background: rgba(109, 124, 255, 0.14);
    border: 1px solid rgba(109, 124, 255, 0.4);
    box-shadow: 0 0 18px rgba(109, 124, 255, 0.14);
}

.pipeline-status.is-running .pipeline-live-dot {
    background: #93a0ff;
    box-shadow: 0 0 0 0 rgba(147, 160, 255, 0.55);
    animation: pipeline-dot-blue 1.4s ease-out infinite;
}

.pipeline-duration {
    color: #aeb6cb;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid #2a3042;
    font-family: 'JetBrains Mono', monospace;
}

.pipeline-live-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    background: #4ade80;
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55);
    animation: pipeline-dot 1.8s ease-out infinite;
}

.pipeline-bar {
    position: relative;
    z-index: 1;
    height: 0.28rem;
    margin: 0.15rem 0 1.35rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.pipeline-bar-fill {
    display: block;
    height: 100%;
    width: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #22c55e, #6d7cff 70%, #93a0ff);
    transform: scaleX(0);
    transform-origin: right center;
    transition: transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

html[dir='ltr'] .pipeline-bar-fill {
    transform-origin: left center;
}

.pipeline-track {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pipeline-track::before {
    content: '';
    position: absolute;
    top: 1.55rem;
    inset-inline: 8%;
    height: 2px;
    background: linear-gradient(
        to left,
        rgba(34, 197, 94, 0.35),
        rgba(109, 124, 255, 0.28) 70%,
        rgba(109, 124, 255, 0.12)
    );
    pointer-events: none;
}

html[dir='ltr'] .pipeline-track::before {
    background: linear-gradient(
        to right,
        rgba(34, 197, 94, 0.35),
        rgba(109, 124, 255, 0.28) 70%,
        rgba(109, 124, 255, 0.12)
    );
}

.pipeline-step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
}

.pipeline-node {
    position: relative;
    z-index: 2;
    width: 3.1rem;
    height: 3.1rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #6b738a;
    background: linear-gradient(180deg, #161b2a, #0d1018);
    border: 1px solid #2d3348;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
    transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.pipeline-node svg {
    width: 1.2rem;
    height: 1.2rem;
}

.pipeline-check,
.pipeline-pulse {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.pipeline-check {
    position: absolute;
    inset-inline-end: -0.15rem;
    bottom: -0.1rem;
    width: 1.05rem;
    height: 1.05rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 800;
    color: #04120a;
    background: #4ade80;
    border: 2px solid #0d1018;
    transform: scale(0.6);
}

.pipeline-pulse {
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    border: 1px solid rgba(109, 124, 255, 0.55);
}

.pipeline-card {
    width: 100%;
    padding: 0.95rem 0.8rem 1rem;
    border-radius: 1rem;
    background: rgba(13, 16, 24, 0.92);
    border: 1px solid #262a38;
    text-align: center;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, opacity 0.3s ease;
}

.pipeline-step.is-idle .pipeline-card,
.pipeline-step.is-pending .pipeline-card {
    opacity: 0.55;
}

.pipeline-step:hover .pipeline-card {
    transform: translateY(-3px);
    border-color: #3a4158;
    opacity: 1;
}

.pipeline-step.is-done .pipeline-node {
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.45);
    background: linear-gradient(180deg, rgba(34, 197, 94, 0.14), #0d1018);
}

.pipeline-step.is-done .pipeline-check {
    opacity: 1;
    transform: scale(1);
}

.pipeline-step.is-done .pipeline-card {
    border-color: rgba(34, 197, 94, 0.28);
    opacity: 1;
}

.pipeline-step.is-active .pipeline-node {
    color: #c4cbff;
    border-color: rgba(109, 124, 255, 0.7);
    background: linear-gradient(180deg, rgba(109, 124, 255, 0.22), #0d1018);
    box-shadow: 0 0 0 4px rgba(109, 124, 255, 0.12), 0 12px 28px rgba(109, 124, 255, 0.18);
    transform: scale(1.06);
}

.pipeline-step.is-active .pipeline-pulse {
    opacity: 1;
    animation: pipeline-pulse 1.4s ease-out infinite;
}

.pipeline-step.is-active .pipeline-card {
    border-color: rgba(109, 124, 255, 0.55);
    box-shadow: 0 0 0 1px rgba(109, 124, 255, 0.18), 0 16px 36px rgba(109, 124, 255, 0.14);
    background:
        linear-gradient(180deg, rgba(109, 124, 255, 0.1), transparent 60%),
        rgba(13, 16, 24, 0.96);
    opacity: 1;
    transform: translateY(-2px);
}

.pipeline-badge {
    display: inline-flex;
    margin-bottom: 0.4rem;
    color: #6b738a;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    transition: color 0.25s ease;
}

.pipeline-step.is-done .pipeline-badge {
    color: #4ade80;
}

.pipeline-step.is-active .pipeline-badge {
    color: #aeb6ff;
}

.pipeline-card strong {
    display: block;
    color: #f1f5ff;
    font-size: 0.95rem;
}

.pipeline-card em {
    display: block;
    margin-top: 0.25rem;
    color: #7f889e;
    font-size: 0.74rem;
    font-style: normal;
    font-family: 'JetBrains Mono', monospace;
}

@keyframes pipeline-pulse {
    0% {
        opacity: 0.85;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(1.45);
    }
}

@keyframes pipeline-dot {
    0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55); }
    70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

@keyframes pipeline-dot-blue {
    0% { box-shadow: 0 0 0 0 rgba(147, 160, 255, 0.55); }
    70% { box-shadow: 0 0 0 8px rgba(147, 160, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(147, 160, 255, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .pipeline-bar-fill {
        transition: none !important;
    }

    .pipeline-pulse,
    .pipeline-live-dot {
        animation: none !important;
    }
}

@media (max-width: 980px) {
    .pipeline-track {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem 0.75rem;
    }

    .pipeline-track::before {
        display: none;
    }

    .pipeline-step:last-child {
        grid-column: 1 / -1;
        max-width: 16rem;
        margin-inline: auto;
    }
}

@media (max-width: 560px) {
    .pipeline-track {
        grid-template-columns: 1fr;
    }

    .pipeline-step:last-child {
        max-width: none;
    }

    .pipeline-node {
        width: 2.7rem;
        height: 2.7rem;
    }
}
