/* Risk Monitoring Dashboard Styles */

:root {
  --bg-main: #0a0e27;
  --bg-card: #151b2d;
  --bg-input: #0a0e27;
  --border: #2d3748;
  --border-light: #3a4657;
  
  /* Risk Colors */
  --critical: #b91c1c;
  --critical-bg: rgba(220, 38, 38, 0.1);
  --high: #d97706;
  --high-bg: rgba(217, 119, 6, 0.1);
  --medium: #eab308;
  --medium-bg: rgba(234, 179, 8, 0.1);
  --low: #22c55e;
  --low-bg: rgba(34, 197, 94, 0.1);
  
  /* Text */
  --text-main: #f1f5f9;
  --text-muted: #cbd5e1;
  --text-dim: #94a3b8;
  
  /* Accents */
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
}

/* Dashboard Layout */
.risk-dashboard {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.dashboard-header {
  background: linear-gradient(135deg, #1a1f3a 0%, #151b2d 100%);
  border-bottom: 1px solid var(--border);
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.header-left h1 {
  font-size: 28px;
  font-weight: 700;
  color: #ef4444;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-dim);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 6px #ef4444;
  animation: pulse 2s infinite;
}

.status-dot.active {
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

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

.divider {
  color: var(--border);
}

.header-right {
  display: flex;
  gap: 12px;
}

.btn-export, .btn-settings {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
}

.btn-export:hover, .btn-settings:hover {
  border-color: #ef4444;
  color: #ef4444;
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  gap: 4px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.3s;
}

.tab-btn:hover {
  border-color: var(--text-dim);
  color: var(--text-main);
}

.tab-btn.active {
  background: #ef4444;
  border-color: #ef4444;
  color: white;
}

/* Content Area */
.dashboard-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Alerts Container */
.alerts-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.alerts-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--medium);
  border-radius: 12px;
  overflow: hidden;
}

.alerts-section.critical {
  border-left-color: var(--critical);
  background: rgba(220, 38, 38, 0.05);
}

.alerts-section.high {
  border-left-color: var(--high);
  background: rgba(217, 119, 6, 0.05);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.3);
}

.section-header h2 {
  font-size: 16px;
  font-weight: 600;
}

.alert-stats {
  display: flex;
  gap: 12px;
}

.count {
  background: var(--critical);
  color: white;
  padding: 4px 12px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 14px;
}

.alerts-list, .alerts-timeline {
  padding: 16px;
  max-height: 600px;
  overflow-y: auto;
}

.alert-item {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--medium);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  transition: all 0.3s;
}

.alert-item.severity-critical {
  border-left-color: var(--critical);
  background: rgba(220, 38, 38, 0.08);
}

.alert-item.severity-high {
  border-left-color: var(--high);
  background: rgba(217, 119, 6, 0.08);
}

.alert-item.severity-medium {
  border-left-color: var(--medium);
  background: rgba(234, 179, 8, 0.08);
}

.alert-item:hover {
  border-color: #ef4444;
}

.alert-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.alert-badge {
  background: var(--critical);
  color: white;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.alert-time {
  font-size: 12px;
  color: var(--text-dim);
}

.alert-player {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.alert-description {
  font-size: 14px;
  color: var(--text-main);
  margin-bottom: 10px;
}

.alert-actions {
  display: flex;
  gap: 8px;
}

.btn-small {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-small:hover {
  background: #ef4444;
  border-color: #ef4444;
}

/* Timeline */
.timeline-item {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  margin-top: 4px;
  flex-shrink: 0;
}

.timeline-content {
  flex: 1;
}

.timeline-time {
  font-size: 12px;
  color: var(--text-dim);
}

.timeline-type {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.timeline-text {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Risk Scores */
.risk-scores-container {
  display: grid;
  gap: 24px;
}

.risk-distribution {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.risk-distribution h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

.distribution-chart {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chart-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bar-label {
  min-width: 60px;
  font-weight: 600;
  font-size: 13px;
}

.bar-container {
  flex: 1;
  height: 30px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  overflow: hidden;
}

.bar {
  height: 100%;
  transition: width 0.3s;
}

.bar-value {
  min-width: 40px;
  text-align: right;
  font-weight: 600;
  font-size: 13px;
}

.top-risk-players {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.top-risk-players h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

/* Tables */
.risk-table, .locations-table, .collusion-table, .reports-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table thead {
  background: rgba(0, 0, 0, 0.3);
}

table th {
  padding: 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}

table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

table tr.risk-critical {
  background: rgba(220, 38, 38, 0.05);
}

table tr.risk-high {
  background: rgba(217, 119, 6, 0.05);
}

table tr.risk-medium {
  background: rgba(234, 179, 8, 0.05);
}

.score-badge {
  background: var(--critical);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 700;
}

.severity-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
}

.severity-badge.critical {
  background: var(--critical-bg);
  color: #fca5a5;
  border: 1px solid var(--critical);
}

.severity-badge.high {
  background: var(--high-bg);
  color: #fdba74;
  border: 1px solid var(--high);
}

.severity-badge.medium {
  background: var(--medium-bg);
  color: #fcd34d;
  border: 1px solid var(--medium);
}

.severity-badge.low {
  background: var(--low-bg);
  color: #86efac;
  border: 1px solid var(--low);
}

.action-btn {
  background: var(--error);
  color: white;
}

.action-btn:hover {
  background: #dc2626;
  border-color: #dc2626;
}

.info-btn {
  background: #3b82f6;
  color: white;
}

.info-btn:hover {
  background: #2563eb;
  border-color: #2563eb;
}

/* Geographic */
.geographic-container {
  display: grid;
  gap: 24px;
}

.locations-section, .impossible-travel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.impossible-item {
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.item-player {
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.item-route {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.item-distance {
  font-size: 12px;
  color: var(--critical);
  font-weight: 500;
}

/* Patterns */
.patterns-container {
  display: grid;
  gap: 24px;
}

.anomalies-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.anomalies-section h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

.anomalies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.anomaly-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  transition: all 0.3s;
}

.anomaly-card:hover {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.anomaly-type {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.anomaly-count {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.anomaly-severity {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.anomaly-severity.critical {
  background: var(--critical-bg);
  color: #fca5a5;
}

.anomaly-severity.high {
  background: var(--high-bg);
  color: #fdba74;
}

.anomaly-severity.medium {
  background: var(--medium-bg);
  color: #fcd34d;
}

.collusion-cases {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.badge-status {
  background: var(--warning);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

/* Reports */
.reports-container {
  display: grid;
  gap: 24px;
}

.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.report-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  transition: all 0.3s;
}

.report-card:hover {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
}

.report-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.report-title {
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.report-description {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.btn-generate {
  background: #ef4444;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  width: 100%;
}

.btn-generate:hover {
  background: #dc2626;
}

.recent-reports {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.recent-reports h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

/* Notifications */
.alert-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 16px 24px;
  border-radius: 8px;
  display: none;
  z-index: 1000;
  animation: slideIn 0.3s ease-out;
}

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

.alert-notification.success {
  background: #10b981;
  color: white;
}

.alert-notification.error {
  background: #ef4444;
  color: white;
}

.alert-notification.info {
  background: #3b82f6;
  color: white;
}

.alert-notification.warning {
  background: #f59e0b;
  color: white;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
  font-size: 14px;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

/* Responsive */
@media (max-width: 1024px) {
  .anomalies-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
  
  .reports-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

@media (max-width: 768px) {
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .nav-tabs {
    flex-wrap: wrap;
  }
  
  .dashboard-content {
    padding: 16px;
  }
  
  .reports-grid, .anomalies-grid {
    grid-template-columns: 1fr;
  }
}
