/* AI Network Visualization Styles */
.ai-network-container {
    display: grid;
    grid-template-areas: 
        "control main"
        "legend main";
    grid-template-columns: 300px 1fr;
    grid-template-rows: auto 1fr;
    gap: 1rem;
    height: 500px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 12px;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.ai-control-panel {
    grid-area: control;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    padding: 1rem;
    backdrop-filter: blur(10px);
}

.ai-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

.ai-header h4 {
    margin: 0;
    color: #e2e8f0;
    font-size: 1.1rem;
    font-weight: 600;
}

.ai-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #94a3b8;
}

.ai-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 2s infinite;
}

.ai-indicator.active {
    box-shadow: 0 0 10px #10b981;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.ai-metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.ai-metric {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 6px;
    padding: 0.75rem;
    text-align: center;
}

.metric-label {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 0.25rem;
}

.metric-trend {
    font-size: 0.7rem;
    font-weight: 500;
}

.metric-trend.up { color: #10b981; }
.metric-trend.down { color: #ef4444; }
.metric-trend.stable { color: #f59e0b; }

.ai-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ai-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.ai-btn.primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
}

.ai-btn.primary:hover {
    background: linear-gradient(135deg, #5b21b6, #7c3aed);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.ai-btn.secondary {
    background: rgba(30, 41, 59, 0.8);
    color: #e2e8f0;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.ai-btn.secondary:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.5);
}

.ai-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.ai-icon.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.ai-network-main {
    grid-area: main;
    position: relative;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    overflow: hidden;
}

.network-canvas {
    width: 100%;
    height: 100%;
    position: relative;
}

.ai-insights-overlay {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 280px;
    z-index: 10;
}

.insight-panel {
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    padding: 1rem;
    backdrop-filter: blur(10px);
}

.insight-header {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

.insight-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.insight-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 4px;
    font-size: 0.8rem;
    color: #cbd5e1;
    transition: all 0.3s ease;
}

.insight-item.new {
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.4);
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.insight-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.ai-legend {
    grid-area: legend;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    padding: 1rem;
    backdrop-filter: blur(10px);
}

.legend-section h5 {
    margin: 0 0 0.75rem 0;
    color: #e2e8f0;
    font-size: 0.9rem;
    font-weight: 600;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 4px;
    font-size: 0.8rem;
    color: #cbd5e1;
}

.legend-node {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    flex-shrink: 0;
}

.legend-node.neural-cluster {
    background: #6366f1;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.legend-node.knowledge-hub {
    background: #f59e0b;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.legend-node.semantic-bridge {
    background: linear-gradient(45deg, #06b6d4, #3b82f6);
    border-radius: 50%;
}

.legend-node.ai-prediction {
    background: #10b981;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.legend-count {
    margin-left: auto;
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Responsive design */
@media (max-width: 1200px) {
    .ai-network-container {
        grid-template-areas: 
            "control"
            "main"
            "legend";
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
        height: 600px;
    }
    
    .ai-control-panel {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .ai-insights-overlay {
        position: relative;
        top: 0;
        right: 0;
        width: 100%;
        margin-top: 1rem;
    }
}

/* Dark theme enhancements */
.dark .ai-network-container {
    background: linear-gradient(135deg, #0f172a 0%, #020617 100%);
}

.dark .ai-metric {
    background: rgba(2, 6, 23, 0.8);
}

.dark .insight-panel {
    background: rgba(2, 6, 23, 0.95);
}
