/**
 * ImPax Platform v3.0 - Alerts & Proactive Intelligence Styles
 * 
 * CSS for Smart Alerts, Morning Briefing, and Prediction components.
 * 
 * @version 1.0.0
 * @date 2025-12-20
 */

/* ============================================================================
   ALERT BADGES (Navigation)
   ============================================================================ */

.alert-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-xl);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  margin-left: var(--space-2);
  animation: alertPulse 2s infinite;
}

.alert-badge-critical {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.alert-badge-warning {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

@keyframes alertPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ============================================================================
   ALERT PANEL (Dashboard)
   ============================================================================ */

.alert-panel {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  transition: all 0.3s ease;
}

.alert-panel-loading {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-muted);
}

.alert-panel-ok {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.alert-panel-ok .alert-panel-title {
  color: #22c55e;
}

.alert-panel-warning {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.alert-panel-warning .alert-panel-title {
  color: #f59e0b;
}

.alert-panel-critical {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  animation: criticalGlow 2s infinite;
}

.alert-panel-critical .alert-panel-title {
  color: #ef4444;
}

@keyframes criticalGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
  50% { box-shadow: 0 0 20px 0 rgba(239, 68, 68, 0.2); }
}

.alert-panel-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.alert-panel-icon {
  font-size: 1.5rem;
}

.alert-panel-title {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-lg);
}

.alert-panel-subtitle {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  margin: 0;
}

.alert-panel-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.alert-panel-meta {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin: 0;
  text-align: right;
}

/* ============================================================================
   ALERT CARDS (Individual Alerts)
   ============================================================================ */

.alert-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  transition: transform 0.2s ease;
}

.alert-card:hover {
  transform: translateX(4px);
}

.alert-card-critical {
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid var(--color-error);
}

.alert-card-warning {
  background: rgba(245, 158, 11, 0.1);
  border-left: 3px solid var(--color-warning);
}

.alert-card-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.alert-card-content {
  flex: 1;
  min-width: 0;
}

.alert-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

.alert-card-metric {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.alert-card-level {
  font-size: var(--font-size-xs);
  padding: 1px 6px;
  border-radius: 4px;
}

.badge-critical {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.alert-card-value {
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
  margin-bottom: var(--space-1);
}

.alert-card-threshold {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
}

.alert-card-message {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.alert-card-time {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  flex-shrink: 0;
}

/* ============================================================================
   ALERT INDICATORS (Inline on Metric Cards)
   ============================================================================ */

.alert-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 14px;
  cursor: help;
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  animation: indicatorPulse 1.5s infinite;
}

.alert-indicator-critical {
  background: rgba(239, 68, 68, 0.2);
}

.alert-indicator-warning {
  background: rgba(245, 158, 11, 0.2);
}

@keyframes indicatorPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ============================================================================
   ALERT SUMMARY (Compact)
   ============================================================================ */

.alert-summary {
  font-size: var(--font-size-sm);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}

.alert-summary-loading {
  color: var(--color-text-muted);
}

.alert-summary-ok {
  color: #22c55e;
}

.alert-summary-warning {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.alert-summary-critical {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* ============================================================================
   MORNING BRIEFING PANEL
   ============================================================================ */

.briefing-panel {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}

.briefing-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.briefing-icon {
  font-size: 1.75rem;
}

.briefing-title {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-lg);
  color: var(--color-text-primary);
  flex: 1;
}

.briefing-period {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  background: var(--color-bg-tertiary);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}

.briefing-summary {
  font-size: var(--font-size-md);
  color: var(--color-text-primary);
  line-height: 1.6;
  margin-bottom: var(--space-4);
}

.briefing-highlights {
  margin-bottom: var(--space-4);
}

.briefing-highlights h4,
.briefing-recommendations h4 {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-2);
}

.briefing-highlights-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.briefing-highlight {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
  font-size: var(--font-size-sm);
}

.briefing-highlight-success {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.briefing-highlight-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.briefing-highlight-critical {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.briefing-highlight-info {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.highlight-icon {
  font-size: 1rem;
}

.highlight-text {
  flex: 1;
}

.briefing-recommendations {
  margin-bottom: var(--space-4);
}

.briefing-recommendations-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.briefing-recommendation {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
}

.briefing-recommendation:last-child {
  border-bottom: none;
}

.recommendation-area {
  font-size: var(--font-size-xs);
  padding: var(--space-1) var(--space-2);
  border-radius: 4px;
  flex-shrink: 0;
}

.badge-high {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.badge-medium {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.badge-low {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

.recommendation-text {
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
}

.briefing-footer {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  text-align: right;
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}

/* ============================================================================
   PREDICTION PANEL
   ============================================================================ */

.prediction-panel {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.prediction-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.prediction-icon {
  font-size: 1.5rem;
}

.prediction-title {
  font-weight: var(--font-weight-semibold);
  flex: 1;
}

.prediction-horizon {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  background: var(--color-bg-tertiary);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}

.prediction-current {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
}

.prediction-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.prediction-value {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-text-primary);
}

.prediction-trend {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-left: auto;
}

.prediction-insights {
  margin-bottom: var(--space-3);
}

.prediction-insight {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-2);
}

.prediction-insight-positive {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.prediction-insight-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.prediction-insight-info {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.prediction-confidence {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.prediction-disclaimer {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  font-style: italic;
  margin: 0;
}

.prediction-error {
  color: #ef4444;
  padding: var(--space-3);
  background: rgba(239, 68, 68, 0.1);
  border-radius: var(--radius-md);
}

/* ============================================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================================ */

@media (max-width: 768px) {
  .alert-panel {
    padding: var(--space-3);
  }
  
  .alert-card {
    flex-direction: column;
    gap: var(--space-2);
  }
  
  .alert-card-time {
    align-self: flex-end;
  }
  
  .briefing-panel {
    padding: var(--space-3);
  }
  
  .briefing-header {
    flex-wrap: wrap;
  }
  
  .briefing-period {
    width: 100%;
    text-align: center;
    margin-top: var(--space-2);
  }
}
