/* =========================================================
   ZEBRA LOGS CONSOLE - MODERN DARK THEME
   ========================================================= */

:root {
  --bg-darker: #080c14;
  --bg-dark: #0f172a;
  --bg-card: rgba(20, 29, 47, 0.85);
  --bg-card-hover: rgba(28, 41, 66, 0.95);
  --bg-input: #151f33;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(59, 130, 246, 0.3);

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --accent-purple: #a855f7;
  --accent-green: #10b981;
  --accent-green-bg: rgba(16, 185, 129, 0.15);
  --accent-green-border: rgba(16, 185, 129, 0.35);

  --accent-red: #ef4444;
  --accent-red-bg: rgba(239, 68, 68, 0.15);
  --accent-red-border: rgba(239, 68, 68, 0.35);

  --accent-amber: #f59e0b;
  --accent-amber-bg: rgba(245, 158, 11, 0.15);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Menlo, monospace;
}

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

body {
  background-color: var(--bg-darker);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 90%, rgba(139, 92, 246, 0.08) 0%, transparent 40%);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-darker);
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* -------------------------------------------------------------
   HEADER
   ------------------------------------------------------------- */
.app-header {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 28px;
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-badge {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: white;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 8px;
  letter-spacing: 1px;
  box-shadow: 0 0 15px rgba(37, 99, 235, 0.4);
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-text h1 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-text p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 9999px;
  background: var(--accent-green-bg);
  color: #34d399;
  border: 1px solid var(--accent-green-border);
}

.live-indicator.disconnected {
  background: var(--accent-red-bg);
  color: #f87171;
  border-color: var(--accent-red-border);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Stats Pill Bar */
.header-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.stat-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.stat-pill .label {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-pill .value {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-main);
}

.stat-pill.error-pill .value {
  color: var(--accent-red);
}

/* Header Action Buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  font-family: var(--font-sans);
}

.btn:hover {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  border-color: #38bdf8;
  color: white;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #0369a1, #1d4ed8);
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.4);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
  color: white;
}

.btn-warning {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fcd34d;
}
.btn-warning:hover {
  background: rgba(245, 158, 11, 0.3);
  color: white;
}

/* -------------------------------------------------------------
   TOOLBAR & FILTERS
   ------------------------------------------------------------- */
.toolbar-section {
  padding: 14px 28px;
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
  max-width: 480px;
}

.search-box input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 9px 14px 9px 36px;
  border-radius: 8px;
  font-size: 13px;
  font-family: var(--font-mono);
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.15);
}

.search-box .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-select {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  outline: none;
  cursor: pointer;
}

.view-toggle {
  display: flex;
  background: var(--bg-input);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.view-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.view-btn.active {
  background: #2563eb;
  color: white;
  font-weight: 600;
}

/* -------------------------------------------------------------
   MAIN CONTAINER & LIST
   ------------------------------------------------------------- */
.main-content {
  flex: 1;
  padding: 24px 28px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 70px 20px;
  border: 2px dashed rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.3);
  margin-top: 20px;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.8;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-main);
}

.empty-state p {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 500px;
  line-height: 1.6;
  margin-bottom: 20px;
}

/* -------------------------------------------------------------
   SESSION CARD (GROUPED VIEW)
   ------------------------------------------------------------- */
.session-cards-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.session-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 18px 22px;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.session-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

.session-card.has-error {
  border-left: 4px solid var(--accent-red);
}
.session-card.completed-ok {
  border-left: 4px solid var(--accent-green);
}
.session-card.in-progress {
  border-left: 4px solid var(--accent-cyan);
}

.session-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.session-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tracking-badge {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 5px 12px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.session-meta-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.session-status-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-family: var(--font-mono);
}

.status-badge-ok {
  background: var(--accent-green-bg);
  color: #34d399;
  border: 1px solid var(--accent-green-border);
}
.status-badge-error {
  background: var(--accent-red-bg);
  color: #f87171;
  border: 1px solid var(--accent-red-border);
}
.status-badge-pending {
  background: rgba(6, 182, 212, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.35);
}

/* Pipeline Flow */
.pipeline-track {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 0 6px 0;
}

.pipeline-step-node {
  flex: 1;
  min-width: 250px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.pipeline-step-node:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(30, 41, 59, 0.8);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.pipeline-step-node.step-success {
  border-top: 3px solid var(--accent-green);
}

.pipeline-step-node.step-error {
  border-top: 3px solid var(--accent-red);
}

.pipeline-step-node.step-waiting {
  border-top: 3px dashed var(--text-dim);
  opacity: 0.55;
  cursor: default;
}
.pipeline-step-node.step-waiting:hover {
  transform: none;
  background: rgba(15, 23, 42, 0.7);
}

.step-node-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.step-number {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.http-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.http-200 {
  background: var(--accent-green-bg);
  color: #34d399;
}
.http-error {
  background: var(--accent-red-bg);
  color: #f87171;
}
.http-waiting {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
}

.step-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.step-url-snippet {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.step-node-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.pipeline-arrow {
  color: var(--text-dim);
  font-size: 16px;
  flex-shrink: 0;
}

/* -------------------------------------------------------------
   CHRONOLOGICAL FLAT VIEW
   ------------------------------------------------------------- */
.chrono-table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.chrono-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.chrono-table th {
  background: rgba(15, 23, 42, 0.95);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.chrono-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.chrono-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* -------------------------------------------------------------
   INSPECTOR MODAL / DRAWER
   ------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #0d131f;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  width: 100%;
  max-width: 1150px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  transform: scale(0.97);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-header {
  padding: 18px 24px;
  background: #131b2e;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.modal-title-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-title-area h2 {
  font-size: 17px;
  font-weight: 700;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}
.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.modal-meta-bar {
  background: #0f172a;
  padding: 10px 24px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
}

.modal-meta-bar strong {
  color: var(--text-main);
}

.modal-body-split {
  padding: 20px 24px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  flex: 1;
}

@media (max-width: 900px) {
  .modal-body-split {
    grid-template-columns: 1fr;
  }
}

.inspector-pane {
  background: #080c14;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pane-header {
  background: #111827;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pane-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}

.btn-copy {
  background: #1f2937;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-mono);
}
.btn-copy:hover {
  background: #374151;
  color: white;
}

.pane-details {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  word-break: break-all;
}

.code-viewer {
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: #e2e8f0;
  max-height: 380px;
  overflow-y: auto;
  background: #05080f;
  margin: 0;
}

/* JSON Highlighting Colors */
.json-key {
  color: #38bdf8;
  font-weight: 600;
}
.json-string {
  color: #34d399;
}
.json-number {
  color: #f59e0b;
}
.json-boolean {
  color: #a78bfa;
}
.json-null {
  color: #f43f5e;
  font-style: italic;
}

/* Toast Notification */
.toast-notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: white;
  border: 1px solid var(--accent-cyan);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 200;
}

.toast-notice.show {
  transform: translateY(0);
  opacity: 1;
}
