/**
 * Enhanced Alert System Styles
 * AI-powered alert interface styling
 */

/* AI Status Indicator */
.ai-status-indicator {
    display: inline-flex;
    align-items: center;
    margin-left: 1rem;
    padding: 0.5rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ai-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.ai-status.ai-active {
    color: #10b981;
}

.ai-status.ai-fallback {
    color: #f59e0b;
}

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

.ai-coverage {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-left: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* AI Metrics Panel */
.ai-metrics-panel {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.ai-metrics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.ai-metrics-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.btn-refresh-ai {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-refresh-ai:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.btn-refresh-ai.refreshing .refresh-icon {
    animation: spin 1s linear infinite;
}

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

.ai-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.ai-metric-card {
    background: rgba(255, 255, 255, 0.15);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease;
}

.ai-metric-card:hover {
    transform: translateY(-2px);
}

.metric-label {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    transition: all 0.3s ease;
}

.metric-value.value-updated {
    transform: scale(1.1);
    color: #fbbf24;
}

.metric-subtitle {
    font-size: 0.75rem;
    opacity: 0.7;
}

.metric-value.active {
    color: #10b981;
}

.metric-value.fallback {
    color: #f59e0b;
}

/* AI Insights Indicator */
.ai-insights-indicator {
    display: inline-flex;
    margin-left: 0.5rem;
    cursor: pointer;
}

.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.ai-badge.ai_content_analysis {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.ai-badge.pattern_matching {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
}

.ai-badge.compliance_analysis {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
}

.ai-badge.risk_analysis {
    background: linear-gradient(135deg, #fa709a, #fee140);
    color: white;
}

.ai-badge.temporal_analysis {
    background: linear-gradient(135deg, #a8edea, #fed6e3);
    color: #333;
}

.ai-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* AI Insights Modal */
.ai-insights-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.insight-grid {
    display: grid;
    gap: 1rem;
}

.insight-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.insight-item label {
    font-weight: 500;
    color: #374151;
}

.insight-value {
    font-weight: 600;
    color: #111827;
}

.insight-value.risk-high {
    color: #dc2626;
}

.insight-value.risk-medium {
    color: #d97706;
}

.insight-value.risk-low {
    color: #059669;
}

.insight-value.risk-critical {
    color: #991b1b;
    font-weight: 700;
}

/* Analysis Progress */
.analysis-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.progress-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.progress-spinner {
    width: 3rem;
    height: 3rem;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.progress-content span {
    font-size: 1.125rem;
    font-weight: 500;
    color: #374151;
}

/* Notifications */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

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

.notification-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.notification-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.notification-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.notification-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.notification-close:hover {
    opacity: 1;
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .ai-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ai-status-indicator {
        margin-left: 0;
        margin-top: 0.5rem;
    }
    
    .ai-metrics-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .notification {
        right: 0.5rem;
        left: 0.5rem;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .ai-metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .insight-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

