/**
 * RUA Report Renderer Styles — Dark Theme
 * Styles for the HTML generated by rua-report-renderer.js
 */

/* Report container */
.rua-report {
  max-width: 100%;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #e6edf3;
}

/* Header bar */
.report-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.report-user-name {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: #e6edf3;
}

.report-user-upn {
  color: #8b949e;
  font-size: 0.9rem;
}

.report-date {
  color: #6e7681;
  font-size: 0.8rem;
  text-align: right;
}

/* Risk gauges */
.risk-gauges {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.gauge-box {
  flex: 1;
  text-align: center;
  padding: 20px;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
}

.gauge-label {
  font-size: 0.75rem;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gauge-score {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 8px 0;
  line-height: 1;
}

.gauge-score.ok { color: #3fb950; }
.gauge-score.low { color: #58a6ff; }
.gauge-score.medium { color: #58a6ff; }
.gauge-score.high { color: #d29922; }
.gauge-score.critical { color: #f85149; }

.gauge-desc {
  font-size: 0.8rem;
  color: #8b949e;
}

/* Report cards */
.report-card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 12px;
}

.report-card.compact-ok {
  padding: 14px 20px;
}

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.compact-ok .card-header-row {
  margin-bottom: 0;
}

.card-header-row h3 {
  font-size: 1rem;
  margin: 0;
  color: #e6edf3;
}

/* Status & Action badges */
.status-badge,
.action-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-badge.ok,
.action-badge.ok {
  background: rgba(63, 185, 80, 0.15);
  color: #3fb950;
}

.status-badge.warn,
.action-badge.low {
  background: rgba(210, 153, 34, 0.15);
  color: #d29922;
}

.status-badge.critical,
.action-badge.critical {
  background: rgba(248, 81, 73, 0.15);
  color: #f85149;
}

.action-badge.high {
  background: rgba(219, 109, 40, 0.15);
  color: #db6d28;
}

.action-badge.medium {
  background: rgba(88, 166, 255, 0.15);
  color: #58a6ff;
}

/* OK state */
.ok-message {
  color: #8b949e;
  font-size: 0.9rem;
  margin-top: 6px;
}

.ok-icon {
  color: #3fb950;
}

/* Action row */
.action-row {
  background: #0d1117;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.action-label {
  font-weight: 600;
  color: #e6edf3;
}

/* Stats row */
.stats-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  background: #0d1117;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.stat-item {
  text-align: center;
  min-width: 60px;
}

.stat-value {
  font-size: 1.3rem;
  font-weight: 600;
  display: block;
  color: #e6edf3;
}

.stat-value.critical { color: #f85149; }
.stat-value.high { color: #d29922; }
.stat-value.ok { color: #3fb950; }

.stat-label {
  font-size: 0.7rem;
  color: #6e7681;
  text-transform: uppercase;
}

/* Info grid */
.info-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.info-cell {
  display: flex;
  flex-direction: column;
}

.info-label {
  font-size: 0.7rem;
  color: #6e7681;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.info-value {
  font-size: 0.9rem;
  color: #e6edf3;
}

.info-text {
  font-size: 0.85rem;
  color: #8b949e;
  margin-bottom: 8px;
}

/* Alert boxes */
.alert-box {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  margin-bottom: 12px;
  border-left: 3px solid;
}

.alert-box.critical {
  background: rgba(248, 81, 73, 0.1);
  color: #f85149;
  border-left-color: #f85149;
}

.alert-box.warn {
  background: rgba(210, 153, 34, 0.1);
  color: #d29922;
  border-left-color: #d29922;
}

.alert-box.high {
  background: rgba(219, 109, 40, 0.1);
  color: #db6d28;
  border-left-color: #db6d28;
}

.alert-box.info,
.info-box {
  background: rgba(88, 166, 255, 0.08);
  color: #8b949e;
  border-left: 3px solid #30363d;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

/* Data tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table th,
.data-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #21262d;
}

.data-table th {
  font-size: 0.7rem;
  color: #6e7681;
  text-transform: uppercase;
  font-weight: 600;
  background: #0d1117;
}

.data-table td {
  color: #c9d1d9;
}

.data-table tr:hover td {
  background: rgba(88, 166, 255, 0.04);
}

.data-table code {
  font-family: 'SF Mono', 'Consolas', monospace;
  font-size: 0.8rem;
  background: #0d1117;
  padding: 2px 6px;
  border-radius: 4px;
  color: #79c0ff;
}

/* Risk tags */
.risk-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.risk-tag.critical {
  background: rgba(248, 81, 73, 0.15);
  color: #f85149;
}

.risk-tag.high {
  background: rgba(219, 109, 40, 0.15);
  color: #db6d28;
}

.risk-tag.medium {
  background: rgba(88, 166, 255, 0.15);
  color: #58a6ff;
}

.risk-tag.low {
  background: rgba(63, 185, 80, 0.15);
  color: #3fb950;
}

/* Method tags (MFA) */
.method-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  background: #21262d;
  color: #c9d1d9;
  margin: 2px 4px 2px 0;
}

.methods-label {
  font-size: 0.8rem;
  color: #6e7681;
  margin-right: 8px;
}

.methods-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

/* Factors grid */
.factors-grid {
  display: flex;
  gap: 16px;
  margin-top: 12px;
}

.factor-col {
  flex: 1;
  background: #0d1117;
  padding: 12px 16px;
  border-radius: 6px;
}

.factor-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6e7681;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.factor-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.85rem;
  color: #8b949e;
}

.factor-list li {
  margin-bottom: 4px;
}

/* Factor items (clickable) */
.factor-item {
  padding: 8px 12px;
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 0.85rem;
  color: #c9d1d9;
}

.factor-item.clickable {
  cursor: pointer;
  transition: border-color 0.2s;
}

.factor-item.clickable:hover {
  border-color: #58a6ff;
}

.factor-info {
  font-size: 0.8rem;
  color: #6e7681;
  margin-top: 4px;
}

/* Factor modal */
.factor-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.factor-modal-content {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 12px;
  max-width: 560px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.factor-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #21262d;
}

.factor-modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #e6edf3;
}

.factor-modal-close {
  background: none;
  border: none;
  color: #8b949e;
  cursor: pointer;
  font-size: 1.5rem;
  padding: 0;
  line-height: 1;
}

.factor-modal-close:hover {
  color: #e6edf3;
}

.factor-modal-body {
  padding: 20px;
}

.factor-modal-section {
  margin-bottom: 16px;
}

.factor-modal-label {
  font-size: 0.75rem;
  color: #6e7681;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.factor-modal-desc {
  font-size: 0.9rem;
  color: #c9d1d9;
  line-height: 1.5;
}

.factor-modal-action {
  font-size: 0.9rem;
  color: #58a6ff;
}

/* Finding title */
.finding-title {
  font-weight: 600;
  color: #e6edf3;
  margin-bottom: 8px;
}

/* Event details (expandable) */
.event-details {
  padding: 12px;
  background: #0d1117;
  border-radius: 6px;
  margin-top: 8px;
  font-size: 0.85rem;
  color: #8b949e;
}

/* Report footer */
.report-footer {
  text-align: center;
  padding: 16px;
  color: #6e7681;
  font-size: 0.8rem;
  border-top: 1px solid #21262d;
  margin-top: 20px;
}

/* Responsive */
@media (max-width: 600px) {
  .risk-gauges {
    flex-direction: column;
  }

  .info-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .factors-grid {
    flex-direction: column;
  }

  .stats-row {
    justify-content: space-around;
  }

  .report-header-bar {
    flex-direction: column;
  }

  .report-date {
    text-align: left;
  }
}
