/**
 * AFS AI Agent UI Styles
 *
 * Styling for AI agent analysis UI components
 *
 * Author: Kita Core Team
 * Created: 2026-01-15
 */

/* ===================================================================
   Analyze Button
   =================================================================== */
.afs-agent-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.afs-agent-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.afs-agent-btn svg {
  animation: rotate 2s linear infinite;
  animation-play-state: paused;
}

.afs-agent-btn:hover svg {
  animation-play-state: running;
}

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

/* ===================================================================
   Analysis Results Container
   =================================================================== */
.ai-analysis-results {
  padding: 20px;
  background: #ffffff;
  border-radius: 8px;
}

.ai-analysis-empty {
  text-align: center;
  padding: 60px 20px;
  color: #6c757d;
}

.ai-analysis-empty p:first-child {
  font-size: 1.2em;
  font-weight: 500;
  margin-bottom: 8px;
}

/* ===================================================================
   Analysis Header
   =================================================================== */
.analysis-header {
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.analysis-header h3 {
  margin: 0 0 12px 0;
  color: #212529;
  font-weight: 600;
}

.analysis-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===================================================================
   Financial Health Badge
   =================================================================== */
.financial-health-badge {
  padding: 16px 24px;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: 600;
  text-align: center;
  margin: 16px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.health-strong {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.health-adequate {
  background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.health-weak {
  background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
  color: #212529;
  box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.health-critical {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.health-unknown {
  background: #6c757d;
  color: white;
}

/* ===================================================================
   Analysis Sections
   =================================================================== */
.analysis-section {
  margin-bottom: 24px;
}

.analysis-section h4 {
  font-size: 1.3em;
  font-weight: 600;
  margin-bottom: 16px;
  color: #212529;
}

/* ===================================================================
   Narrative Report
   =================================================================== */
.narrative-report {
  background: #f8f9fa;
  border-left: 4px solid #007bff;
  padding: 24px;
  border-radius: 4px;
  line-height: 1.7;
}

.narrative-content h4 {
  color: #212529;
  font-weight: 600;
  margin: 24px 0 12px 0;
}

.narrative-content p {
  margin-bottom: 12px;
  color: #495057;
}

.narrative-content strong {
  color: #212529;
  font-weight: 600;
}

.narrative-content li {
  margin-left: 20px;
  margin-bottom: 8px;
}

/* ===================================================================
   Findings Sections
   =================================================================== */
.finding-section {
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 20px;
}

.finding-section h5 {
  font-weight: 600;
  margin-bottom: 16px;
  color: #212529;
  border-bottom: 1px solid #e9ecef;
  padding-bottom: 8px;
}

.compliance-item,
.anomaly-item {
  padding: 12px;
  margin-bottom: 12px;
  border-radius: 4px;
  background: #f8f9fa;
  border-left: 3px solid #6c757d;
}

.compliance-item.compliant {
  border-left-color: #28a745;
  background: #d4edda;
}

.compliance-item.non-compliant {
  border-left-color: #dc3545;
  background: #f8d7da;
}

.compliance-item.uncertain {
  border-left-color: #ffc107;
  background: #fff3cd;
}

.anomaly-item.impact-high {
  border-left-color: #dc3545;
  background: #f8d7da;
}

.anomaly-item.impact-medium {
  border-left-color: #ffc107;
  background: #fff3cd;
}

.anomaly-item.impact-low {
  border-left-color: #17a2b8;
  background: #d1ecf1;
}

/* ===================================================================
   Recommendations
   =================================================================== */
.recommendation-section {
  margin-bottom: 32px;
}

.recommendation-section h5 {
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid currentColor;
}

.recommendation-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  margin-bottom: 16px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #dee2e6;
  transition: all 0.2s ease;
}

.recommendation-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateX(4px);
}

.rec-number {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #007bff;
  color: white;
  border-radius: 50%;
  font-weight: 600;
}

.rec-content {
  flex: 1;
}

.rec-content strong {
  display: block;
  color: #212529;
  margin-bottom: 8px;
  font-size: 1.05em;
}

.rec-rationale {
  color: #495057;
  margin-bottom: 8px;
  font-size: 0.95em;
}

.rec-impact {
  color: #6c757d;
  font-size: 0.9em;
  margin: 0;
  font-style: italic;
}

/* ===================================================================
   Notification Toast
   =================================================================== */
.notification-toast {
  animation: slideIn 0.3s ease, slideOut 0.3s ease 4.7s;
}

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

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

/* ===================================================================
   Responsive Design
   =================================================================== */
@media (max-width: 768px) {
  .analysis-meta {
    flex-direction: column;
  }

  .recommendation-item {
    flex-direction: column;
    gap: 12px;
  }

  .rec-number {
    width: 28px;
    height: 28px;
    font-size: 0.9em;
  }

  .financial-health-badge {
    font-size: 1em;
    padding: 12px 16px;
  }
}

/* ===================================================================
   Print Styles
   =================================================================== */
@media print {
  .afs-agent-btn,
  .nav-pills,
  .notification-toast {
    display: none !important;
  }

  .narrative-report {
    background: white;
    border: 1px solid #000;
  }

  .recommendation-item {
    page-break-inside: avoid;
  }
}
