/* ============================================================================
   ANALYTICS COMPONENTS STYLES
   ============================================================================ */

/* Financial Dashboard */
.financial-dashboard {
  min-height: 500px;
}

.financial-dashboard.loading,
.financial-dashboard.error,
.financial-dashboard.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 3rem;
}

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.loading-spinner .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.dashboard-header {
  margin-bottom: 1.5rem;
}

.dashboard-header h2 {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 0.25rem;
}

.dashboard-header .subtitle {
  color: #6b7280;
  font-size: 0.875rem;
}

.dashboard-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.5rem;
}

.dashboard-tabs button {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  background: transparent;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dashboard-tabs button:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.dashboard-tabs button.active {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}

.dashboard-tabs .badge {
  background: #ef4444;
  color: white;
  font-size: 0.625rem;
  padding: 0.125rem 0.375rem;
  border-radius: 999px;
  font-weight: bold;
}

.dashboard-content {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 1rem;
  padding: 1.5rem;
}

/* Summary Cards */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.summary-cards .card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.summary-cards .card .label {
  font-size: 0.75rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summary-cards .card .value {
  font-size: 1.25rem;
  font-weight: bold;
  color: #fff;
}

/* Chart Container */
.chart-container {
  margin-bottom: 1.5rem;
}

.chart-container h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #fff;
}

/* Status Cards */
.status-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
}

.status-card.normal {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-card.suspicious {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-card .icon {
  font-size: 2rem;
}

.status-card .status-text h3 {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.status-card .status-text p {
  font-size: 0.875rem;
  color: #6b7280;
}

/* Explanation Card */
.explanation-card {
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.1);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.explanation-card h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #6366f1;
}

.explanation-card p {
  font-size: 0.875rem;
  color: #9ca3af;
  line-height: 1.5;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
}

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: #6b7280;
  max-width: 300px;
}

.empty-state.success {
  background: rgba(16, 185, 129, 0.05);
  border-radius: 1rem;
}

/* Alert Banner */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 0.5rem;
  color: #ef4444;
  font-weight: 500;
  margin-bottom: 1rem;
}

/* Anomaly Cards */
.anomalies-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.anomaly-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 1rem;
}

.anomaly-card.severity-critical {
  border-left: 4px solid #ef4444;
}

.anomaly-card.severity-high {
  border-left: 4px solid #f59e0b;
}

.anomaly-card.severity-medium {
  border-left: 4px solid #6366f1;
}

.anomaly-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.anomaly-header .score {
  font-weight: bold;
  color: #ef4444;
}

.anomaly-header .methods {
  font-size: 0.75rem;
  color: #6b7280;
}

.anomaly-reasons p {
  font-size: 0.875rem;
  color: #9ca3af;
}

/* Tables */
.predictions-table,
.vendors-table {
  margin-top: 1.5rem;
}

.predictions-table h4,
.vendors-table h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #9ca3af;
}

.predictions-table table,
.vendors-table table,
.bi-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.predictions-table th,
.vendors-table th,
.bi-table th {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #6b7280;
  font-weight: 500;
}

.predictions-table td,
.vendors-table td,
.bi-table td {
  padding: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #d1d5db;
}

.predictions-table td.amount,
.vendors-table td.amount,
.bi-table td.value {
  font-weight: 600;
  color: #10b981;
}

.predictions-table td.range {
  color: #6b7280;
  font-size: 0.75rem;
}

/* ============================================================================
   NETWORK GRAPH STYLES
   ============================================================================ */

.network-graph {
  min-height: 600px;
  position: relative;
}

.graph-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.graph-header h2 {
  font-size: 1.5rem;
  font-weight: bold;
}

.graph-header .stats {
  display: flex;
  gap: 1rem;
}

.graph-header .stat {
  font-size: 0.875rem;
  color: #6b7280;
}

.graph-header .stat strong {
  color: #fff;
}

.view-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.graph-content {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 1rem;
  min-height: 400px;
}

.graph-visualization svg {
  width: 100%;
  background: transparent;
}

.graph-visualization .node {
  cursor: pointer;
}

.graph-visualization .node:hover circle {
  filter: brightness(1.2);
}

.graph-visualization .node.selected circle {
  filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.8));
}

.node-details-panel {
  position: absolute;
  right: 1rem;
  top: 8rem;
  width: 280px;
  background: rgba(26, 26, 46, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-header .node-icon {
  font-size: 1.5rem;
}

.panel-header h3 {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
}

.panel-header .close-btn {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  font-size: 1.25rem;
}

.panel-content {
  padding: 1rem;
}

.panel-content .node-type {
  font-size: 0.75rem;
  color: #6b7280;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.panel-content .actions button {
  width: 100%;
  padding: 0.5rem 1rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: #6366f1;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
}

.panel-content .actions button:hover {
  background: rgba(99, 102, 241, 0.2);
}

.graph-legend {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  background: rgba(26, 26, 46, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
}

.graph-legend h4 {
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
}

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

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #9ca3af;
}

.legend-item .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* Hubs List */
.hubs-list .description {
  color: #6b7280;
  margin-bottom: 1rem;
}

.hubs-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hub-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.hub-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(99, 102, 241, 0.3);
}

.hub-card .rank {
  font-weight: bold;
  color: #6366f1;
  width: 2rem;
}

.hub-card .hub-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hub-card .hub-info .name {
  font-weight: 500;
}

.hub-card .mentions {
  text-align: right;
}

.hub-card .mentions .count {
  font-size: 1.25rem;
  font-weight: bold;
  color: #10b981;
}

.hub-card .mentions .label {
  font-size: 0.625rem;
  color: #6b7280;
  display: block;
}

/* Conflicts List */
.conflicts-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.conflict-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 1rem;
}

.conflict-card.severity-high {
  border-left: 4px solid #ef4444;
}

.conflict-card.severity-medium {
  border-left: 4px solid #f59e0b;
}

.conflict-card.severity-low {
  border-left: 4px solid #6366f1;
}

.conflict-header .severity-badge {
  font-size: 0.625rem;
  font-weight: bold;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.conflict-path {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0;
  font-size: 0.875rem;
}

.conflict-path .entity {
  font-weight: 600;
  color: #6366f1;
}

.conflict-path .arrow {
  color: #6b7280;
}

.conflict-path .steps {
  font-size: 0.75rem;
  color: #6b7280;
}

.conflict-card .description {
  font-size: 0.875rem;
  color: #9ca3af;
}

/* ============================================================================
   CHAT BI RENDERER STYLES
   ============================================================================ */

.chat-bi-container {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-top: 0.5rem;
}

.bi-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #fff;
}

.bi-chart-container {
  margin-bottom: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0.5rem;
  padding: 0.5rem;
}

.bi-summary {
  color: #d1d5db;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.bi-insights {
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.1);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
}

.bi-insights h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #6366f1;
}

.bi-insights ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.bi-insights li {
  font-size: 0.875rem;
  color: #9ca3af;
  padding: 0.25rem 0;
  padding-left: 1rem;
  position: relative;
}

.bi-insights li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: #6366f1;
}

.bi-table-container {
  overflow-x: auto;
}

/* ============================================================================
   VERTICAL INSIGHT CARDS STYLES
   ============================================================================ */

.vertical-insights-container {
  margin-top: 1rem;
}

.vertical-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 999px;
  margin-bottom: 1rem;
}

.vertical-badge .vertical-icon {
  font-size: 1rem;
}

.vertical-badge .vertical-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6366f1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.medical-insights,
.finance-insights,
.banking-insights,
.legal-insights,
.real-estate-insights,
.hr-insights,
.generic-insights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.insight-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 1rem;
}

.insight-card h4 {
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.insight-card p {
  font-size: 0.875rem;
  color: #d1d5db;
  line-height: 1.5;
}

.insight-card.warning-card {
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.05);
}

.insight-card.warning-card h4 {
  color: #f59e0b;
}

.insight-card.alert-card,
.insight-card.critical-card {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.05);
}

.insight-card.alert-card h4,
.insight-card.critical-card h4 {
  color: #ef4444;
}

.insight-card.urgent-card {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.1);
}

.insight-card .amount-value,
.insight-card .price-value {
  font-size: 1.25rem;
  font-weight: bold;
  color: #10b981;
}

.insight-card .risk-score {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #ef4444;
  font-weight: bold;
}

.insight-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.insight-card ul li {
  font-size: 0.813rem;
  color: #9ca3af;
  padding: 0.25rem 0;
}
