/* ===== RAG PIPELINE GRAPH ===== */
.pipeline-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.3rem;
    padding: 2rem 0;
    overflow: visible !important;
    height: 600px;
    justify-content: center;
    z-index: 5;
    padding-left: 2rem;
    transform: translateX(1rem);
}

/* Connecting line (vertical) */
.pipeline-container::before {
    content: '';
    position: absolute;
    top: 2rem;
    bottom: 2rem;
    left: 50%;
    width: 1px;
    background: linear-gradient(180deg,
            rgba(20, 184, 166, 0) 0%,
            rgba(20, 184, 166, 0.4) 15%,
            rgba(20, 184, 166, 0.4) 85%,
            rgba(20, 184, 166, 0) 100%);
    transform: translateX(-0.5px);
    z-index: 0;
}

/* Main Node Style */
.pipeline-node {
    position: relative;
    width: 180px;
    height: 44px;
    background: rgba(13, 61, 56, 0.6);
    border: 1px solid rgba(20, 184, 166, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 1rem;
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
    z-index: 5;
}

.node-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Status Indicators */
.node-status {
    position: absolute;
    right: 1rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

/* Node states */
.pipeline-node.node-success {
    border-color: rgba(52, 211, 153, 0.4);
}

.pipeline-node.node-success .node-status {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.pipeline-node.node-warning {
    border-color: rgba(251, 191, 36, 0.4);
}

.pipeline-node.node-warning .node-status {
    background: var(--warning);
    box-shadow: 0 0 8px var(--warning);
}

.pipeline-node.node-error {
    border-color: rgba(248, 113, 113, 0.4);
}

.pipeline-node.node-error .node-status {
    background: var(--error);
    box-shadow: 0 0 8px var(--error);
}

.node-active {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(94, 234, 212, 0.5);
}

/* Side Cards (Inputs/Outputs) */
.side-card {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) translateX(0);
    background: #0A1612;
    border: 1px solid rgba(94, 234, 212, 0.2);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Courier New', monospace;
    color: var(--text-secondary);
    white-space: nowrap;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

/* Connecting dashed lines */
.side-card::before {
    content: '';
    position: absolute;
    top: 50%;
    width: 1.5rem;
    height: 1px;
    border-top: 1px dashed rgba(94, 234, 212, 0.3);
}

/* Input Card (Left) */
.side-card.input-card {
    right: calc(100% + 1.5rem);
    text-align: right;
    border-right: 2px solid var(--core-teal);
}

.side-card.input-card::before {
    left: 100%;
}

/* Output Card (Right) */
.side-card.output-card {
    left: calc(100% + 1.5rem);
    text-align: left;
    border-left: 2px solid var(--core-teal);
}

.side-card.output-card::before {
    right: 100%;
}

/* Visibility States */
.pipeline-node:hover .side-card,
.pipeline-node.node-active .side-card {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

/* Slightly slide in on reveal */
.pipeline-node:hover .input-card,
.pipeline-node.node-active .input-card {
    transform: translateY(-50%) translateX(-5px);
}

.pipeline-node:hover .output-card,
.pipeline-node.node-active .output-card {
    transform: translateY(-50%) translateX(5px);
}

/* Metrics (Bubble above node) */
.node-metric-bubble {
    position: absolute;
    top: -20px;
    right: 0;
    background: var(--deep-teal);
    color: var(--bright-teal);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    border: 1px solid var(--core-teal);
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.3s ease;
}

.node-active .node-metric-bubble {
    opacity: 1;
    transform: translateY(0);
}

/* Warning indicators */
.warning-indicator {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 16px;
    height: 16px;
    background: var(--warning);
    border-radius: 50%;
    border: 2px solid var(--bg-deep);
    font-size: 10px;
    color: var(--bg-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s var(--ease-premium);
}

.warning-indicator.active {
    opacity: 1;
    transform: scale(1);
}

/* Controlled Signal Drop */
.signal-drop {
    position: absolute;
    left: 50%;
    width: 8px;
    height: 8px;
    background: var(--bright-teal);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--bright-teal), 0 0 24px rgba(94, 234, 212, 0.6);
    transform: translateX(-50%);
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: top 0.5s ease-out, opacity 0.15s ease;
}

.signal-drop.error-signal {
    background: var(--error);
    box-shadow: 0 0 12px var(--error), 0 0 24px rgba(248, 113, 113, 0.6);
}

/* Error message */
.error-message {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid var(--error);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    color: var(--error);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.error-output {
    display: none;
    color: var(--error);
    border-left-color: var(--error);
}

/* Responsive */
@media (max-width: 1024px) {
    .pipeline-container {
        height: 500px;
    }

    .pipeline-node {
        min-width: 160px;
        padding: 0.875rem 1.25rem;
    }
}

@media (max-width: 768px) {
    .pipeline-container {
        height: 400px;
        transform: scale(0.85);
    }
}

@media (max-width: 640px) {
    .side-card {
        display: none !important;
    }

    .pipeline-node {
        width: 100%;
    }
}

/* ===== INTEGRATIONS MARQUEE ===== */
.integrations-section {
    padding: 3rem 0;
    border-top: 1px solid rgba(94, 234, 212, 0.1);
    border-bottom: 1px solid rgba(94, 234, 212, 0.1);
    background: linear-gradient(180deg,
            rgba(10, 21, 20, 0.5) 0%,
            rgba(3, 11, 10, 0.8) 100%);
    overflow: hidden;
    position: relative;
    z-index: 2;
}

.integrations-label {
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-bottom: 2rem;
    opacity: 0.7;
}

.marquee {
    position: relative;
    overflow: hidden;
    mask-image: linear-gradient(90deg,
            transparent 0%,
            black 10%,
            black 90%,
            transparent 100%);
    width: 100%;
}

.marquee-content {
    display: flex;
    gap: 4rem;
    width: max-content;
    animation: scroll-left 40s linear infinite;
}

.integration-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    white-space: nowrap;
    color: var(--text-dim);
    opacity: 0.6;
    transition: all 0.3s ease;
    animation: float-stochastic 6s ease-in-out infinite;
}

.integration-item:nth-child(2n) {
    animation-duration: 7s;
    animation-delay: 1s;
}

.integration-item:nth-child(3n) {
    animation-duration: 5s;
    animation-delay: 2s;
}

.integration-item:nth-child(5n) {
    animation-duration: 8s;
    animation-delay: 0.5s;
}

.integration-item:hover {
    opacity: 1;
    color: var(--bright-teal);
}

.integration-icon {
    width: 1.75rem;
    height: 1.75rem;
    flex-shrink: 0;
}

.integration-item span {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* Pause on hover */
.marquee:hover .marquee-content {
    animation-play-state: paused;
}

/* ===== ENHANCED NODE LABELS ===== */
/* Node input/output labels */
.node-input-label,
.node-output-label {
    position: absolute;
    font-size: 0.7rem;
    font-family: 'Courier New', monospace;
    color: var(--text-dim);
    background: rgba(3, 11, 10, 0.95);
    padding: 0.375rem 0.625rem;
    border-radius: 4px;
    border: 1px solid rgba(94, 234, 212, 0.3);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 10;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.node-input-label {
    right: calc(100% + 0.75rem);
    top: 50%;
    transform: translateY(-50%);
}

.node-output-label {
    left: calc(100% + 0.75rem);
    top: 50%;
    transform: translateY(-50%);
}

.pipeline-node:hover .node-input-label,
.pipeline-node:hover .node-output-label,
.node-active .node-input-label,
.node-active .node-output-label {
    opacity: 1;
}

/* Enhanced error messages */
.error-message.active {
    opacity: 1;
    transform: translateX(-50%) translateY(4px);
}

.error-message.error-type {
    background: rgba(248, 113, 113, 0.2);
    border: 1px solid #F87171;
    color: #F87171;
    box-shadow: 0 0 20px rgba(248, 113, 113, 0.4);
}

.error-message.warning-type {
    background: rgba(251, 191, 36, 0.2);
    border: 1px solid #FBBF24;
    color: #FBBF24;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
}

/* Enhanced node metrics */
.node-metric {
    position: absolute;
    top: -1.75rem;
    right: 0;
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
    background: rgba(13, 61, 56, 0.95);
    border: 1px solid #14B8A6;
    border-radius: 4px;
    color: #5EEAD4;
    font-weight: 700;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    white-space: nowrap;
}

.node-metric.active {
    opacity: 1;
    transform: scale(1);
}

/* Responsive - hide enhanced labels on mobile */
@media (max-width: 768px) {

    .node-input-label,
    .node-output-label,
    .node-metric {
        display: none;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@keyframes float-stochastic {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}