/* ============================================================
   Auto-Transfer Control Center — High-Craft Design System
   Cyber-Telemetry / Modern Dark Obsidian & Clean Slate
   Font: Plus Jakarta Sans + JetBrains Mono
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ── CSS Variables: Light Mode ─────────────────────────────── */
:root {
  --bg-base:        #f8fafc;
  --bg-surface:     #ffffff;
  --bg-subtle:      #f1f5f9;
  --bg-dark:        #cbd5e1;
  --bg-light:       #ffffff;
  --border-color:   #e2e8f0;
  --border-hover:   #cbd5e1;
  --text-main:      #0f172a;
  --text-muted:     #64748b;
  --shadow-card:    0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
  --shadow-hover:   0 4px 12px -2px rgba(0, 0, 0, 0.08);
}

/* ── CSS Variables: Dark Mode (Obsidian / Cyber Telemetry) ─── */
.dark {
  --bg-base:        #090a0f;
  --bg-surface:     #11141e;
  --bg-subtle:      #161a26;
  --bg-dark:        #06070a;
  --bg-light:       #1b2030;
  --border-color:   rgba(255, 255, 255, 0.08);
  --border-hover:   rgba(255, 255, 255, 0.16);
  --text-main:      #f8fafc;
  --text-muted:     #94a3b8;
  --shadow-card:    0 4px 20px -2px rgba(0, 0, 0, 0.4);
  --shadow-hover:   0 8px 24px -4px rgba(0, 0, 0, 0.6);
}

/* ── Global Base ───────────────────────────────────────────── */
body {
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  background-color: var(--bg-base);
  color: var(--text-main);
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

/* ── Surface Containers (Bento Grid) ───────────────────────── */
.neu-flat {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  border-radius: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.neu-flat-sm {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  border-radius: 10px;
}

.neu-pressed {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

/* ── Modern Navigation Tabs ────────────────────────────────── */
.nav-tab-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  display: flex;
  width: 100%;
  justify-content: flex-start;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-muted);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.nav-tab-btn:hover {
  color: var(--text-main);
  border-color: var(--border-hover);
  background: var(--bg-subtle);
  transform: translateY(-1px);
}

.nav-tab-btn.active {
  color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.08) !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
  box-shadow: 0 0 16px -2px rgba(56, 189, 248, 0.15);
  font-weight: 700;
  transform: translateY(0);
}

.nav-tab-btn.active svg {
  color: #38bdf8 !important;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.4));
}

/* ── Interactive Buttons ───────────────────────────────────── */
.neu-btn,
.neu-btn-primary,
.neu-btn-success,
.neu-btn-danger,
.neu-btn-secondary {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 600 !important;
  font-size: 12px !important;
  letter-spacing: 0.01em !important;
  border-radius: 9px !important;
  padding: 0.5rem 0.85rem;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
  cursor: pointer !important;
  user-select: none !important;
  text-decoration: none !important;
}

.neu-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  color: var(--text-main);
}

.neu-btn:hover:not(:disabled) {
  border-color: var(--border-hover);
  background: var(--bg-subtle);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px -2px rgba(0, 0, 0, 0.1);
}

.neu-btn:active:not(:disabled),
.neu-btn-primary:active:not(:disabled),
.neu-btn-success:active:not(:disabled),
.neu-btn-danger:active:not(:disabled),
.neu-btn-secondary:active:not(:disabled) {
  transform: translateY(0) !important;
  box-shadow: none !important;
}

.neu-btn:disabled,
.neu-btn-primary:disabled,
.neu-btn-success:disabled,
.neu-btn-danger:disabled,
.neu-btn-secondary:disabled {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  filter: grayscale(0.5) !important;
  pointer-events: none !important;
}

.neu-btn-primary {
  background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 2px 8px -1px rgba(59, 130, 246, 0.35) !important;
}
.neu-btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #4338ca 0%, #2563eb 100%) !important;
  box-shadow: 0 4px 14px -1px rgba(59, 130, 246, 0.45) !important;
  transform: translateY(-1px);
}

.neu-btn-success {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 2px 8px -1px rgba(16, 185, 129, 0.3) !important;
}
.neu-btn-success:hover:not(:disabled) {
  background: linear-gradient(135deg, #047857 0%, #059669 100%) !important;
  box-shadow: 0 4px 14px -1px rgba(16, 185, 129, 0.45) !important;
  transform: translateY(-1px);
}

.neu-btn-danger {
  background: linear-gradient(135deg, #e11d48 0%, #f43f5e 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 2px 8px -1px rgba(244, 63, 94, 0.3) !important;
}
.neu-btn-danger:hover:not(:disabled) {
  background: linear-gradient(135deg, #be123c 0%, #e11d48 100%) !important;
  box-shadow: 0 4px 14px -1px rgba(244, 63, 94, 0.45) !important;
  transform: translateY(-1px);
}

.neu-btn-secondary {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-main) !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}
.neu-btn-secondary:hover:not(:disabled) {
  background: var(--bg-subtle) !important;
  border-color: var(--border-hover) !important;
  transform: translateY(-1px);
}

/* ── Form Controls (Inputs, Selects, Textareas) ────────────── */
.field-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

/* ── Modern Table Styles ───────────────────────────────────── */
table thead th {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}
table tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.15s ease;
}
table tbody tr:hover {
  background-color: var(--bg-subtle);
}
table td {
  color: var(--text-main);
}


.neu-input, .neu-select, .neu-textarea {
  display: block !important;
  width: 100% !important;
  background: var(--bg-subtle) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px !important;
  padding: 0.65rem 0.85rem !important;
  color: var(--text-main) !important;
  font-family: inherit;
  font-size: 13px !important;
  box-sizing: border-box !important;
  transition: border-color 0.18s ease, box-shadow 0.18s ease !important;
  box-shadow: none !important;
}

.neu-textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.5;
}

.neu-input:focus, .neu-select:focus, .neu-textarea:focus {
  outline: none !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15) !important;
}

.neu-select option {
  background: var(--bg-surface) !important;
  color: var(--text-main) !important;
}

/* ── Precision Status Badges ───────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
  box-shadow: none !important;
}

.badge-pending {
  color: #fbbf24 !important;
  background: rgba(245, 158, 11, 0.12) !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
}

.badge-processing {
  color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.12) !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
}

.badge-success {
  color: #34d399 !important;
  background: rgba(16, 185, 129, 0.12) !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
}

.badge-failed {
  color: #fb7185 !important;
  background: rgba(244, 63, 94, 0.12) !important;
  border: 1px solid rgba(244, 63, 94, 0.35) !important;
}

.badge-mismatch {
  color: #fb923c !important;
  background: rgba(249, 115, 22, 0.12) !important;
  border: 1px solid rgba(249, 115, 22, 0.35) !important;
}

/* ── Terminal Console View ─────────────────────────────────── */
#console-logs-container {
  font-family: 'JetBrains Mono', 'Fira Code', monospace !important;
  background: #06070a !important;
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.system-log { color: #38bdf8 !important; font-weight: 600; }
.scraper-log { color: #34d399 !important; font-weight: 600; }
.scraper-err { color: #f43f5e !important; font-weight: 700; }
.log-entry {
  color: #cbd5e1;
  word-break: break-all;
  line-height: 1.5;
  padding: 0.25rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 11.5px;
}
.log-entry:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* ── Toggle Switch ─────────────────────────────────────────── */
.switch-container {
  background: var(--bg-subtle) !important;
  border: 1px solid var(--border-color);
  box-shadow: none !important;
}
.switch-track {
  background: #cbd5e1 !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: none !important;
}
.dark .switch-track {
  background: #1e293b !important;
}
.switch-checkbox:checked + .switch-track {
  background: #10b981 !important;
}
.switch-thumb-el {
  background: #ffffff !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25) !important;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.switch-checkbox:checked + .switch-track .switch-thumb-el {
  transform: translateX(1.15rem);
}

/* ── Sidebar Collapsed / Icon-Only Precision Mode ──────────── */
#sidebar-nav.is-collapsed,
.sidebar-init-collapsed #sidebar-nav {
  width: 5rem !important;
  min-width: 5rem !important;
  max-width: 5rem !important;
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
}

#sidebar-nav.is-collapsed #sidebar-header,
.sidebar-init-collapsed #sidebar-nav #sidebar-header {
  justify-content: center !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

#sidebar-nav.is-collapsed .sidebar-label,
.sidebar-init-collapsed #sidebar-nav .sidebar-label {
  display: none !important;
}

#sidebar-nav.is-collapsed #sidebar-toggle-icon,
.sidebar-init-collapsed #sidebar-nav #sidebar-toggle-icon {
  transform: rotate(180deg);
  pointer-events: none;
}

#sidebar-toggle-icon {
  pointer-events: none;
}

#sidebar-nav.is-collapsed .nav-tab-btn,
.sidebar-init-collapsed #sidebar-nav .nav-tab-btn {
  justify-content: center !important;
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
  gap: 0 !important;
}

#sidebar-nav.is-collapsed .nav-tab-btn svg,
.sidebar-init-collapsed #sidebar-nav .nav-tab-btn svg {
  margin: 0 !important;
}

#sidebar-nav.is-collapsed #nav-watchlist-count,
.sidebar-init-collapsed #sidebar-nav #nav-watchlist-count {
  display: none !important;
}
