/* Data Pipeline Web Interface Styles with Correlation Support */

/* JSON Viewer Styles */
.json-viewer {
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
}

/* Event Stream Container */
.event-stream {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    background: #f9fafb;
}

/* Status Indicators */
.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.status-healthy { 
    background-color: #10b981; 
}

.status-degraded { 
    background-color: #f59e0b; 
}

.status-unhealthy { 
    background-color: #ef4444; 
}

.status-unknown { 
    background-color: #6b7280; 
}

/* Pulse Animation */
.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* Demo Controls Styles */
.demo-controls {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.demo-button {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    padding: 12px 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(238, 90, 36, 0.3);
}

.demo-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(238, 90, 36, 0.4);
}

.demo-button:active {
    transform: translateY(0);
}

.demo-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.demo-input {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: white;
}

.demo-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Severity Colors Enhanced */
.severity-critical {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
}

.severity-error {
    background: linear-gradient(135deg, #ff9ff3, #f368e0);
    color: white;
    border: none;
}

.severity-warning {
    background: linear-gradient(135deg, #feca57, #ff9ff3);
    color: #333;
    border: none;
}

.severity-info {
    background: linear-gradient(135deg, #48cae4, #023e8a);
    color: white;
    border: none;
}

.severity-debug {
    background: linear-gradient(135deg, #a8edea, #fed6e3);
    color: #333;
    border: none;
}

/* Loading Spinner */
.loading-spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Event Cards Enhanced with Correlation Support */
.event-card {
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    position: relative;
}

.event-card:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.event-card.severity-critical {
    border-left-color: #ef4444;
}

.event-card.severity-error {
    border-left-color: #f97316;
}

.event-card.severity-warning {
    border-left-color: #eab308;
}

.event-card.severity-info {
    border-left-color: #3b82f6;
}

.event-card.severity-debug {
    border-left-color: #6b7280;
}

/* Correlation Highlight */
.correlation-highlight {
    background: linear-gradient(135deg, #fef3c7, #fed7aa) !important;
    border: 2px solid #f59e0b !important;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.correlation-highlight:hover {
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* Risk Level Borders */
.event-card.border-l-4.border-l-red-500 {
    border-left: 4px solid #ef4444 !important;
    background: linear-gradient(135deg, #fee2e2, #fecaca);
}

.event-card.border-l-4.border-l-orange-500 {
    border-left: 4px solid #f97316 !important;
    background: linear-gradient(135deg, #fed7aa, #fdba74);
}

.event-card.border-l-4.border-l-yellow-500 {
    border-left: 4px solid #eab308 !important;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
}

/* Correlation Indicators */
.correlation-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 10;
}

.correlation-badge {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(168, 85, 247, 0.3);
}

.risk-badge {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

/* Correlation Summary Panel */
.correlation-panel {
    background: linear-gradient(135deg, #f3e8ff, #e9d5ff);
    border: 1px solid #a855f7;
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
}

.correlation-rule-tag {
    display: inline-block;
    background: linear-gradient(135deg, #ddd6fe, #c4b5fd);
    color: #581c87;
    font-size: 10px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 12px;
    margin: 2px;
    border: 1px solid #a855f7;
}

/* Risk Analysis Section */
.risk-analysis {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border: 1px solid #ef4444;
    border-radius: 6px;
    padding: 8px;
    margin-top: 8px;
}

.risk-analysis h5 {
    color: #991b1b;
    font-weight: 600;
    margin-bottom: 4px;
}

.risk-analysis ul {
    color: #7f1d1d;
}

/* Correlation Statistics */
.correlation-stats {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 1px solid #0ea5e9;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.correlation-stat-item {
    text-align: center;
    padding: 8px;
}

.correlation-stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.correlation-stat-label {
    font-size: 0.75rem;
    color: #0369a1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Intelligence Badge */
.intelligence-badge {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

/* Correlation Item Styles */
.correlation-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.correlation-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #a855f7;
}

.correlation-item .risk-indicator {
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
}

.correlation-item .risk-high {
    background: #fee2e2;
    color: #991b1b;
}

.correlation-item .risk-medium {
    background: #fed7aa;
    color: #9a3412;
}

.correlation-item .risk-low {
    background: #fef3c7;
    color: #92400e;
}

/* Responsive Design */
@media (max-width: 768px) {
    .demo-controls {
        padding: 16px;
    }
    
    .demo-button {
        width: 100%;
        margin-top: 12px;
    }
    
    .event-stream {
        max-height: 300px;
    }
    
    .correlation-indicator {
        position: static;
        margin-top: 8px;
        margin-bottom: 8px;
        justify-content: flex-start;
    }
    
    .event-card {
        padding-right: 16px;
    }
}

/* Success/Error Messages */
.message-success {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border: 1px solid #10b981;
    color: #065f46;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 8px 0;
}

.message-error {
    background: linear-gradient(135deg, #fee2e2, #fca5a5);
    border: 1px solid #ef4444;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 8px 0;
}

/* Connection Status Enhanced */
.connection-status {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.connection-status.connected {
    background: rgba(16, 185, 129, 0.1);
}

.connection-status.disconnected {
    background: rgba(239, 68, 68, 0.1);
}

/* Correlation Legend */
.correlation-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #6b7280;
}

.correlation-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.correlation-legend-box {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* Animation for new correlations */
@keyframes correlationPulse {
    0% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.7);
    }
    70% { 
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(168, 85, 247, 0);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(168, 85, 247, 0);
    }
}

.correlation-highlight.new-correlation {
    animation: correlationPulse 2s ease-out;
}

/* Dark mode correlation support */
@media (prefers-color-scheme: dark) {
    .correlation-highlight {
        background: linear-gradient(135deg, #451a03, #78350f) !important;
        border-color: #f59e0b !important;
    }
    
    .correlation-panel {
        background: linear-gradient(135deg, #2d1b69, #4c1d95);
        border-color: #a855f7;
        color: #e9d5ff;
    }
    
    .correlation-rule-tag {
        background: linear-gradient(135deg, #4c1d95, #5b21b6);
        color: #e9d5ff;
        border-color: #a855f7;
    }
}
