/* ═══════════════════════════════════════════════════════════
   VEXOO QUANTIX — style-schema-dump.css
   Schema Viewer · Dump & Import
═══════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════
   SCHEMA VIEWER — LAYOUT
═══════════════════════════════════════════ */
.schema-layout {
  display: grid; grid-template-columns: 240px 1fr;
  gap: 0;
  height: calc(100vh - var(--topbar-h) - 56px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.schema-sidebar {
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.schema-db-list { padding: 8px 0; }

.schema-db-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; cursor: pointer;
  font-size: 0.88rem; font-weight: 600;
  transition: background 0.18s;
  border-left: 2px solid transparent;
}
.schema-db-item:hover { background: var(--panel2); }
.schema-db-item.active {
  background: var(--panel2);
  border-left-color: var(--accent);
  color: var(--accent);
}
.schema-db-item .sdi-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}

/* ── Schema sidebar group labels ── */
.schema-group { margin-bottom: 4px; }
.schema-group-label {
  padding: 10px 16px 4px;
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  font-family: var(--font-mono);
  opacity: 0.85;
}

/* ═══════════════════════════════════════════
   SCHEMA VIEWER — MAIN AREA
═══════════════════════════════════════════ */
.schema-main {
  overflow-y: auto; padding: 24px;
  background: var(--bg2);
}

.schema-placeholder {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 100%;
  color: var(--text3); gap: 12px;
}
.ph-icon { font-size: 3rem; opacity: 0.3; }

/* ── Schema DB header (title + meta + chat btn) ── */
.schema-db-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.schema-db-header-info {
  flex: 1;
  min-width: 0;
}

.schema-db-title {
  font-size: 1.2rem; font-weight: 800; margin-bottom: 6px;
}
.schema-db-meta {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--text3);
  margin-bottom: 0;
  word-break: break-all;
}

/* ── Chat button in Schema Viewer ── */
.schema-chat-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  background: rgba(0,229,255,0.08);
  border: 1px solid rgba(0,229,255,0.25);
  border-radius: var(--radius);
  color: var(--accent);
  font-size: 0.82rem; font-weight: 600;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}
.schema-chat-btn:hover {
  background: rgba(0,229,255,0.16);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 16px rgba(0,229,255,0.2);
}
.schema-chat-btn .chat-icon-svg {
  width: 16px; height: 16px;
  flex-shrink: 0;
}
.schema-chat-btn.loading {
  pointer-events: none; opacity: 0.7;
}
.schema-chat-btn.loading::after {
  content: '';
  width: 14px; height: 14px;
  border: 2px solid transparent;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: schemaBtnSpin 0.6s linear infinite;
  margin-left: 4px;
}
@keyframes schemaBtnSpin {
  to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════
   SCHEMA VIEWER — TABLE CARDS
═══════════════════════════════════════════ */
.tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.table-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
}
.table-card:hover { border-color: var(--border2); }

.tc-head {
  padding: 10px 14px;
  background: var(--panel2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.tc-icon { color: var(--accent); font-size: 0.9rem; }
.tc-name { font-weight: 700; font-size: 0.88rem; font-family: var(--font-mono); }
.tc-rows {
  margin-left: auto; font-family: var(--font-mono); font-size: 0.7rem;
  color: var(--text3); background: var(--bg3);
  border: 1px solid var(--border); border-radius: 20px; padding: 1px 8px;
}

.tc-fields { padding: 8px 0; }
.tc-field {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 14px; font-size: 0.78rem;
  border-bottom: 1px solid rgba(30,45,61,0.5);
}
.tc-field:last-child { border-bottom: none; }
.field-key { color: var(--accent3); font-size: 0.65rem; }
.field-name { font-family: var(--font-mono); color: var(--text); flex: 1; }
.field-type {
  font-family: var(--font-mono); font-size: 0.7rem; color: var(--text3);
  background: var(--bg3); border-radius: 3px; padding: 1px 6px;
}

/* ═══════════════════════════════════════════
   DUMP & IMPORT — DROP ZONE
═══════════════════════════════════════════ */
.drop-zone {
  margin: 20px;
  border: 2px dashed var(--border2);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  color: var(--text3);
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-glow);
  color: var(--text2);
}
.dz-icon { font-size: 2.5rem; margin-bottom: 10px; }
.drop-zone p { font-size: 0.92rem; margin-bottom: 8px; }
.drop-zone span { font-size: 0.78rem; color: var(--text3); display: block; margin-bottom: 14px; }

/* ═══════════════════════════════════════════
   DUMP & IMPORT — OUTPUT / FEEDBACK
═══════════════════════════════════════════ */
.dump-output {
  margin: 0 20px 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  font-family: var(--font-mono); font-size: 0.75rem;
  color: var(--accent);
  max-height: 200px; overflow-y: auto;
  white-space: pre-wrap; line-height: 1.6;
}

.import-feedback {
  margin: 0 20px 20px;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 0.85rem; font-family: var(--font-mono);
}
.import-feedback.success {
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.3);
  color: var(--health);
}
.import-feedback.error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: #ef4444;
}