/* Graph Network Visualization */
.graph-network-container {
    position: relative;
    padding: 2.5rem 2rem;
    background: 
        radial-gradient(circle at 20% 20%, rgba(45, 166, 110, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 159, 28, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(16, 185, 129, 0.05) 0%, transparent 40%),
        linear-gradient(135deg, rgba(248, 250, 252, 0.98) 0%, rgba(255, 255, 255, 0.99) 100%);
    border-radius: 16px;
    min-height: 380px;
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(23, 104, 212, 0.08);
}

/* Graph Connections */
.graph-connections {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* Graph Labels */
.graph-label {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--deep-atlantic-blue);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    z-index: 3;
    padding: 0.3rem 0.6rem;
    background: 
        linear-gradient(135deg, rgba(248, 250, 252, 0.9), rgba(255, 255, 255, 0.95));
    border-radius: 12px;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(23, 104, 212, 0.08);
    backdrop-filter: blur(5px);
}

.label-icon {
    font-size: 0.9rem;
    opacity: 0.8;
}

.label-text {
    font-size: 0.7rem;
}

/* Label Color Themes */
.input-label {
    color: #374151;
    border-color: rgba(107, 114, 128, 0.15);
    background: 
        linear-gradient(135deg, rgba(249, 250, 251, 0.9), rgba(255, 255, 255, 0.95));
}

.input-label .label-icon {
    color: #6B7280;
}

.ai-label {
    color: var(--deep-atlantic-blue);
    border-color: rgba(23, 104, 212, 0.15);
    background: 
        linear-gradient(135deg, rgba(239, 246, 255, 0.9), rgba(255, 255, 255, 0.95));
}

.ai-label .label-icon {
    color: var(--royal-wave-blue);
}

.output-label {
    color: #047857;
    border-color: rgba(16, 185, 129, 0.15);
    background: 
        linear-gradient(135deg, rgba(240, 253, 250, 0.9), rgba(255, 255, 255, 0.95));
}

.output-label .label-icon {
    color: #10B981;
}

/* Graph Nodes */
.graph-node {
    position: absolute;
    width: 95px;
    height: 75px;
    background: var(--white);
    border-radius: 16px;
    border: 2px solid rgba(23, 104, 212, 0.12);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.08),
        0 2px 10px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    z-index: 2;
    backdrop-filter: blur(10px);
}

/* Smaller Output Nodes */
.output-node {
    width: 70px;
    height: 50px;
    border-radius: 10px;
}

.graph-node:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.graph-node.active:not(.input-node) {
    border-color: var(--success-color);
    background: linear-gradient(135deg, rgba(45, 166, 110, 0.05), var(--white));
}

.graph-node.ready {
    border-color: var(--success-color);
    background: linear-gradient(135deg, rgba(45, 166, 110, 0.08), var(--white));
}

.graph-node.generating:not(.output-node) {
    border-color: var(--accent-color);
    background: linear-gradient(135deg, rgba(255, 159, 28, 0.08), var(--white));
    animation: nodeGlow 2s infinite ease-in-out;
}

.graph-node.processing {
    border-color: var(--royal-wave-blue);
    background: linear-gradient(135deg, rgba(23, 104, 212, 0.08), var(--white));
}

/* Node Glow Effects */
.node-glow {
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.graph-node.active:not(.input-node) .node-glow {
    background: linear-gradient(135deg, rgba(45, 166, 110, 0.3), rgba(45, 166, 110, 0.1));
    opacity: 1;
}

.graph-node.ready .node-glow {
    background: linear-gradient(135deg, rgba(45, 166, 110, 0.4), rgba(45, 166, 110, 0.1));
    opacity: 1;
}

.graph-node.generating:not(.output-node) .node-glow {
    background: linear-gradient(135deg, rgba(255, 159, 28, 0.4), rgba(255, 159, 28, 0.1));
    opacity: 1;
    animation: glowPulse 2s infinite ease-in-out;
}

.graph-node:hover .node-glow {
    opacity: 1;
}

/* Node Content */
.node-content {
    padding: 0.6rem 0.4rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}

.node-icon {
    font-size: 1.3rem;
    margin-bottom: 0.2rem;
}

.node-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--deep-atlantic-blue);
    margin-bottom: 0.15rem;
    line-height: 1.1;
}

/* Smaller text for output nodes */
.output-node .node-icon {
    font-size: 0.9rem;
    margin-bottom: 0.05rem;
}

.output-node .node-label {
    font-size: 0.5rem;
    line-height: 0.9;
    margin-bottom: 0.05rem;
    font-weight: 700;
}

.node-metric, .node-status {
    font-size: 0.6rem;
    font-weight: 500;
}

.node-metric {
    color: var(--success-color);
    background: rgba(45, 166, 110, 0.1);
    padding: 0.1rem 0.3rem;
    border-radius: 6px;
}

.node-status {
    color: var(--text-light);
}

/* Input Nodes - Grey Theme */
.input-node {
    border-color: #6B7280;
    background: 
        linear-gradient(135deg, rgba(107, 114, 128, 0.08) 0%, rgba(107, 114, 128, 0.04) 100%);
    box-shadow: 
        0 8px 25px rgba(107, 114, 128, 0.12),
        0 2px 10px rgba(107, 114, 128, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.input-node:hover {
    border-color: #6B7280;
    box-shadow: 
        0 10px 30px rgba(107, 114, 128, 0.18),
        0 4px 15px rgba(107, 114, 128, 0.08);
}

.input-node .node-label {
    color: #374151;
}

.input-node.active {
    border-color: #6B7280;
    background: 
        linear-gradient(135deg, rgba(107, 114, 128, 0.08) 0%, rgba(107, 114, 128, 0.04) 100%);
}

.input-node.active .node-glow {
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.2), rgba(107, 114, 128, 0.05));
    opacity: 0;
}

/* Output Nodes - Green Theme */
.output-node {
    border-color: #10B981;
    background: 
        linear-gradient(135deg, rgba(16, 185, 129, 0.10) 0%, rgba(16, 185, 129, 0.06) 100%);
    box-shadow: 
        0 8px 25px rgba(16, 185, 129, 0.12),
        0 2px 10px rgba(16, 185, 129, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.output-node:hover {
    border-color: #059669;
    box-shadow: 
        0 10px 30px rgba(16, 185, 129, 0.18),
        0 4px 15px rgba(16, 185, 129, 0.08);
}

.output-node .node-label {
    color: #047857;
}

.output-node.ready {
    border-color: #10B981;
    background: 
        linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(16, 185, 129, 0.08) 100%);
}

.output-node.ready .node-status {
    color: var(--success-color);
}

.output-node.generating {
    border-color: #10B981;
    background: 
        linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.10) 100%);
    animation: nodeGlow 2s infinite ease-in-out;
}

.output-node.generating .node-glow {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.4), rgba(16, 185, 129, 0.1));
    opacity: 1;
    animation: glowPulse 2s infinite ease-in-out;
}

.output-node.generating .node-status {
    color: #059669;
}

/* AI Processing Node */
.ai-node {
    width: 130px;
    height: 110px;
    border-color: var(--royal-wave-blue);
    background: 
        linear-gradient(135deg, rgba(23, 104, 212, 0.10) 0%, rgba(23, 104, 212, 0.06) 100%);
    box-shadow: 
        0 12px 35px rgba(23, 104, 212, 0.15),
        0 4px 15px rgba(23, 104, 212, 0.08),
        inset 0 2px 0 rgba(255, 255, 255, 0.9);
}

.ai-core {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-ring-outer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 65px;
    height: 65px;
    border: 2px solid rgba(23, 104, 212, 0.15);
    border-radius: 50%;
    border-top-color: var(--royal-wave-blue);
    border-right-color: rgba(45, 166, 110, 0.4);
    animation: rotateRing 4s linear infinite;
}

.ai-ring-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 45px;
    height: 45px;
    border: 2px solid rgba(255, 159, 28, 0.2);
    border-radius: 50%;
    border-bottom-color: var(--accent-color);
    border-left-color: rgba(23, 104, 212, 0.3);
    animation: rotateRing 6s linear infinite reverse;
}

.ai-center {
    position: relative;
    width: 50px;
    height: 50px;
    background: 
        linear-gradient(135deg, var(--gradient-primary), var(--royal-wave-blue)),
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 6px 20px rgba(23, 104, 212, 0.4),
        0 2px 8px rgba(23, 104, 212, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    z-index: 3;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-icon {
    font-size: 1.4rem;
    margin-bottom: 0.1rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-icon img {
    width: 32px;
    height: auto;
    max-height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3));
}

.ai-label {
    font-size: 0.48rem;
    font-weight: 700;
    color: var(--white);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    text-align: center;
    line-height: 1;
    letter-spacing: 0.02em;
}

.ai-modules {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 160px;
    height: 160px;
    z-index: 4;
}

.module-tag {
    position: absolute;
    font-size: 0.5rem;
    font-weight: 600;
    padding: 0.2rem 0.4rem;
    color: white;
    background: 
        linear-gradient(135deg, rgba(23, 104, 212, 0.60) 0%, rgba(23, 104, 212, 0.45) 100%);
    border-radius: 10px;
    border: 1.5px solid rgba(23, 104, 212, 0.20);
    box-shadow: 
        0 4px 12px rgba(23, 104, 212, 0.15),
        0 1px 3px rgba(23, 104, 212, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    backdrop-filter: blur(8px);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.module-tag.active {
    color: white;
    border-color: rgba(23, 104, 212, 0.25);
    background: 
        linear-gradient(135deg, rgba(23, 104, 212, 0.65) 0%, rgba(23, 104, 212, 0.50) 100%);
    box-shadow: 
        0 4px 12px rgba(23, 104, 212, 0.20),
        0 1px 3px rgba(23, 104, 212, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.module-tag.processing {
    color: white;
    border-color: rgba(23, 104, 212, 0.30);
    background: 
        linear-gradient(135deg, rgba(23, 104, 212, 0.70) 0%, rgba(23, 104, 212, 0.55) 100%);
    animation: moduleGlow 2s infinite ease-in-out;
    box-shadow: 
        0 4px 12px rgba(23, 104, 212, 0.25),
        0 1px 3px rgba(23, 104, 212, 0.20),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.module-tag:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 
        0 6px 16px rgba(0, 0, 0, 0.12),
        0 2px 6px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* Graph Network Animations */
@keyframes rotateRing {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes nodeGlow {
    0%, 100% {
        box-shadow: 0 6px 20px rgba(255, 159, 28, 0.1);
    }
    50% {
        box-shadow: 0 10px 30px rgba(255, 159, 28, 0.3);
    }
}

@keyframes glowPulse {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

@keyframes moduleGlow {
    0%, 100% {
        box-shadow: 
            0 4px 12px rgba(255, 159, 28, 0.15),
            0 1px 3px rgba(255, 159, 28, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.9);
    }
    50% {
        box-shadow: 
            0 6px 18px rgba(255, 159, 28, 0.25),
            0 2px 6px rgba(255, 159, 28, 0.12),
            inset 0 1px 0 rgba(255, 255, 255, 0.95);
    }
}

/* Responsive Styles for Graph Network */
@media (max-width: 768px) {
    .graph-network-container {
        padding: 1rem 0.75rem;
        min-height: 250px;
    }

    .graph-connections {
        transform: scale(0.85);
        transform-origin: center;
    }

    .graph-node {
        width: 75px;
        height: 60px;
    }

    .node-icon {
        font-size: 1.1rem;
        margin-bottom: 0.15rem;
    }

    .node-label {
        font-size: 0.65rem;
    }

    .ai-node {
        width: 95px;
        height: 75px;
    }

    .ai-ring-outer {
        width: 42px;
        height: 42px;
    }

    .ai-ring-inner {
        width: 32px;
        height: 32px;
    }

    .ai-center {
        width: 35px;
        height: 35px;
    }

    .ai-icon {
        font-size: 1rem;
    }

    .ai-icon img {
        width: 28px;
        max-height: 28px;
    }

    .ai-label {
        font-size: 0.45rem;
    }

    .module-tag {
        font-size: 0.5rem;
        padding: 0.1rem 0.25rem;
    }

    .graph-label {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .graph-network-container {
        padding: 0.75rem 0.5rem;
        min-height: 220px;
    }

    .graph-connections {
        transform: scale(0.75);
    }

    .graph-node {
        width: 65px;
        height: 50px;
    }

    .node-content {
        padding: 0.4rem 0.3rem;
    }

    .node-icon {
        font-size: 1rem;
        margin-bottom: 0.1rem;
    }

    .node-label {
        font-size: 0.6rem;
    }

    .ai-node {
        width: 85px;
        height: 65px;
    }

    .ai-ring-outer {
        width: 38px;
        height: 38px;
    }

    .ai-ring-inner {
        width: 28px;
        height: 28px;
    }

    .ai-center {
        width: 30px;
        height: 30px;
    }

    .ai-icon {
        font-size: 0.9rem;
        margin-bottom: 0.05rem;
    }

    .ai-icon img {
        width: 24px;
        max-height: 24px;
    }

    .ai-label {
        font-size: 0.4rem;
    }

    .ai-modules {
        width: 140px;
        height: 140px;
    }

    .module-tag {
        font-size: 0.45rem;
        padding: 0.08rem 0.2rem;
    }

    .graph-label {
        font-size: 0.65rem;
    }
}
