/* ============================================================
   Humanizer Engine — Dashboard Styles
   LinkDaddy® LLC — FIF Protocol
   ============================================================ */

:root {
  --bg-base: #0a0a0f;
  --bg-surface: #111118;
  --bg-card: #16161f;
  --bg-card-hover: #1c1c28;
  --bg-input: #1a1a24;
  --border: #2a2a38;
  --border-focus: #5b4fff;
  --text-primary: #f0f0f8;
  --text-secondary: #9090b0;
  --text-muted: #5a5a78;
  --accent: #5b4fff;
  --accent-hover: #7060ff;
  --accent-glow: rgba(91, 79, 255, 0.25);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --transition: 0.18s ease;
}

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

html { scroll-behavior: smooth; }

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

/* ── Header ─────────────────────────────────────────────── */
.header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.logo-icon {
  font-size: 22px;
  filter: drop-shadow(0 0 8px var(--accent));
}

.logo-title {
  display: block;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.logo-sub {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-brand {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* ── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge-live {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-processing {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
  animation: pulse 1.5s infinite;
}

.badge-complete {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-failed {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

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

/* ── Main Layout ─────────────────────────────────────────── */
.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 24px;
  min-height: calc(100vh - 60px);
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color var(--transition);
}

.card:hover {
  border-color: rgba(91, 79, 255, 0.3);
}

.card-header {
  margin-bottom: 20px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(91, 79, 255, 0.3);
}

.card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── Form Elements ──────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}

.label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.label-opt {
  font-weight: 400;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
}

.label-req {
  color: var(--accent);
}

.input, .textarea, .select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 10px 12px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.input:focus, .textarea:focus, .select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.input::placeholder, .textarea::placeholder {
  color: var(--text-muted);
}

.textarea {
  resize: vertical;
  min-height: 100px;
}

.select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239090b0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 5px;
}

.mt-8 { margin-top: 8px; }

.divider-text {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  margin: 12px 0;
  position: relative;
}

/* ── Intensity Grid ─────────────────────────────────────── */
.intensity-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.intensity-option {
  cursor: pointer;
}

.intensity-option input[type="radio"] {
  display: none;
}

.intensity-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  transition: all var(--transition);
  cursor: pointer;
}

.intensity-option input:checked + .intensity-card,
.intensity-card.active {
  border-color: var(--accent);
  background: var(--accent-glow);
  box-shadow: 0 0 0 1px var(--accent);
}

.intensity-card:hover {
  border-color: rgba(91, 79, 255, 0.5);
}

.intensity-icon { font-size: 18px; margin-bottom: 4px; }
.intensity-name { font-size: 11px; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.intensity-desc { font-size: 10px; color: var(--text-muted); line-height: 1.3; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-lg {
  width: 100%;
  padding: 13px 20px;
  font-size: 14px;
  margin-top: 8px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 24px rgba(91, 79, 255, 0.4);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  width: 100%;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  margin-top: 8px;
}

.btn-secondary:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 6px 12px;
  font-size: 12px;
}

.btn-ghost:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { font-size: 12px; }

/* ── Upload Zone ─────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 16px;
}

.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.upload-icon { font-size: 32px; margin-bottom: 8px; }
.upload-text { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.upload-hint { font-size: 12px; color: var(--text-muted); }

.upload-queue {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.upload-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 12px;
}

.upload-item-name { flex: 1; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item-size { color: var(--text-muted); }
.upload-item-status { font-size: 14px; }

/* ── Pipeline Status ─────────────────────────────────────── */
.pipeline-stages {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 16px;
}

.stage {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.stage:last-child { border-bottom: none; }

.stage-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: all var(--transition);
}

.stage.active .stage-dot {
  background: var(--warning);
  box-shadow: 0 0 8px var(--warning);
  animation: pulse 1s infinite;
}

.stage.complete .stage-dot {
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}

.stage.failed .stage-dot {
  background: var(--danger);
}

.stage-info { flex: 1; }
.stage-name { display: block; font-size: 12px; font-weight: 600; color: var(--text-primary); }
.stage-desc { display: block; font-size: 11px; color: var(--text-muted); }

.stage-status {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.stage.active .stage-status { color: var(--warning); }
.stage.complete .stage-status { color: var(--success); }
.stage.failed .stage-status { color: var(--danger); }

.progress-bar-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #a78bfa);
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* ── Output ──────────────────────────────────────────────── */
.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: row;
  margin-bottom: 16px;
}

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

.output-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.meta-tag {
  font-size: 11px;
  padding: 3px 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.output-body {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-primary);
  white-space: pre-wrap;
  font-family: var(--font-sans);
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 8px;
}

.output-body::-webkit-scrollbar { width: 4px; }
.output-body::-webkit-scrollbar-track { background: var(--bg-input); }
.output-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.output-body h1 { font-size: 22px; font-weight: 800; margin-bottom: 12px; color: var(--text-primary); }
.output-body h2 { font-size: 17px; font-weight: 700; margin: 20px 0 8px; color: var(--text-primary); }
.output-body h3 { font-size: 15px; font-weight: 600; margin: 16px 0 6px; color: var(--text-secondary); }
.output-body p { margin-bottom: 12px; }
.output-body strong { color: #fff; font-weight: 700; }
.output-body em { color: var(--accent); font-style: normal; }

/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex: 1;
}

.empty-icon { font-size: 56px; margin-bottom: 20px; filter: grayscale(0.3); }
.empty-title { font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.empty-desc { font-size: 14px; color: var(--text-secondary); max-width: 480px; line-height: 1.7; margin-bottom: 28px; }

.empty-features {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.feature-pill {
  padding: 6px 14px;
  background: var(--accent-glow);
  border: 1px solid rgba(91, 79, 255, 0.3);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #a78bfa;
}

/* ── Toast Notifications ─────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: slideIn 0.2s ease;
  max-width: 360px;
  border-left: 3px solid;
}

.toast-success { background: #0f2318; color: #4ade80; border-color: var(--success); }
.toast-error { background: #1f0f0f; color: #f87171; border-color: var(--danger); }
.toast-info { background: #0f1a2f; color: #60a5fa; border-color: var(--info); }

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

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .main {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  .intensity-grid {
    grid-template-columns: 1fr;
  }
}
