/*
 * Vibeship Design System
 * Extracted from spark-pulse, sparknet dashboard, and the-mind
 * CRITICAL: NO BORDER RADIUS - This is the Vibeship identity
 */

/* === CSS Variables === */
:root {
  /* Typography */
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --font-serif: "Instrument Serif", Georgia, serif;

  /* Backgrounds (dark layers) */
  --bg-primary: #0e1016;
  --bg-secondary: #151820;
  --bg-tertiary: #1c202a;
  --bg-elevated: #252a36;

  /* Borders */
  --border-color: #2a2f3a;
  --border-subtle: #1e222b;

  /* Text */
  --text-primary: #e8e8e8;
  --text-secondary: #a0a0a0;
  --text-muted: #666;

  /* Accents */
  --green-dim: #00C49A;
  --green-bright: #00FFD1;
  --orange: #D97757;
  --red: #FF4D4D;
  --violet: #9D8CFF;
  --blue: #4D9FFF;

  /* Shadows & Glows */
  --glow-green: 0 0 20px rgba(0, 196, 154, 0.3);
  --glow-orange: 0 0 20px rgba(217, 119, 87, 0.3);
  --glow-red: 0 0 20px rgba(255, 77, 77, 0.3);

  /* Transitions */
  --transition-fast: 150ms ease-out;
  --transition-normal: 200ms ease-out;
}

/* === Global Reset === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  /* CRITICAL: No border radius anywhere */
  border-radius: 0 !important;
}

html, body {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
}

#app {
  min-height: 100vh;
}

/* === Typography === */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 0.5em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

.label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

/* === Layout === */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

/* === Header === */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.header-title {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-title h1 {
  margin: 0;
}

.status-indicator {
  width: 10px;
  height: 10px;
  background: var(--green-dim);
  animation: pulse 2s infinite;
}

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

/* === Panels === */
.panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-tertiary);
}

.panel-header::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--green-dim);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

.panel-header h3 {
  margin: 0;
  font-size: 1rem;
}

.panel-body {
  padding: 1.25rem;
}

/* === Stats Cards === */
.stat-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.stat-value.green { color: var(--green-dim); }
.stat-value.orange { color: var(--orange); }
.stat-value.red { color: var(--red); }
.stat-value.violet { color: var(--violet); }

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

/* === Tabs === */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-color);
}

.tab {
  padding: 0.875rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  border-bottom: 2px solid transparent;
}

.tab:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.tab.active {
  color: var(--bg-primary);
  background: var(--green-dim);
  border-bottom-color: var(--green-dim);
}

/* === Spark Cards === */
.spark-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--green-dim);
  padding: 1.25rem;
  transition: all var(--transition-fast);
}

.spark-card:hover {
  border-color: var(--green-dim);
  box-shadow: var(--glow-green);
}

.spark-card.blocked {
  border-left-color: var(--red);
}

.spark-card.blocked:hover {
  border-color: var(--red);
  box-shadow: var(--glow-red);
}

.spark-card.warning {
  border-left-color: var(--orange);
}

.spark-card.warning:hover {
  border-color: var(--orange);
  box-shadow: var(--glow-orange);
}

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

.spark-type {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.spark-type::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--green-dim);
}

.spark-content {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: 1rem;
  word-break: break-word;
}

.spark-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.spark-meta span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* === Tags === */
.tag {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.tag.green {
  background: rgba(0, 196, 154, 0.15);
  border-color: var(--green-dim);
  color: var(--green-dim);
}

.tag.orange {
  background: rgba(217, 119, 87, 0.15);
  border-color: var(--orange);
  color: var(--orange);
}

.tag.red {
  background: rgba(255, 77, 77, 0.15);
  border-color: var(--red);
  color: var(--red);
}

.tag.violet {
  background: rgba(157, 140, 255, 0.15);
  border-color: var(--violet);
  color: var(--violet);
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.btn-primary {
  background: var(--green-dim);
  border-color: var(--green-dim);
  color: var(--bg-primary);
}

.btn-primary:hover {
  box-shadow: var(--glow-green);
  color: var(--bg-primary);
}

.btn-danger {
  background: transparent;
  border-color: var(--red);
  color: var(--red);
}

.btn-danger:hover {
  background: var(--red);
  color: var(--bg-primary);
  box-shadow: var(--glow-red);
}

.btn-warning {
  background: transparent;
  border-color: var(--orange);
  color: var(--orange);
}

.btn-warning:hover {
  background: var(--orange);
  color: var(--bg-primary);
  box-shadow: var(--glow-orange);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--bg-elevated);
  border-color: var(--border-color);
}

/* === Action Buttons Grid === */
.action-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}

/* === Alerts === */
.alert {
  padding: 1rem 1.25rem;
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--green-dim);
  background: var(--bg-tertiary);
  margin-bottom: 1rem;
}

.alert.warning {
  border-left-color: var(--orange);
  background: rgba(217, 119, 87, 0.1);
}

.alert.error {
  border-left-color: var(--red);
  background: rgba(255, 77, 77, 0.1);
}

.alert.info {
  border-left-color: var(--blue);
  background: rgba(77, 159, 255, 0.1);
}

/* === Scan Results === */
.scan-result {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.finding {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-elevated);
  margin-bottom: 0.5rem;
}

.finding-severity {
  flex-shrink: 0;
  padding: 0.25rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
}

.finding-severity.critical {
  background: var(--red);
  color: var(--bg-primary);
}

.finding-severity.high {
  background: var(--orange);
  color: var(--bg-primary);
}

.finding-severity.medium {
  background: var(--violet);
  color: var(--bg-primary);
}

.finding-severity.low {
  background: var(--text-muted);
  color: var(--bg-primary);
}

.finding-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* === Empty State === */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-muted);
}

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

.empty-state h3 {
  font-family: var(--font-serif);
  font-style: italic;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

/* === Loading === */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem;
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-color);
  border-top-color: var(--green-dim);
  animation: spin 1s linear infinite;
}

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

/* === Confidence Bar === */
.confidence-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.confidence-track {
  flex: 1;
  height: 4px;
  background: var(--bg-elevated);
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
  background: var(--green-dim);
  transition: width var(--transition-normal);
}

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

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

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

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* === Utility Classes === */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.text-green { color: var(--green-dim); }
.text-orange { color: var(--orange); }
.text-red { color: var(--red); }
.text-muted { color: var(--text-muted); }
