/* ========================================
   56k Knowledge Hub - Shared Components
   Cards, badges, footer, utility surfaces
   ======================================== */

/* Cards */
.card, .config-card, .feature-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border);
  border-radius: 12px;
  position: relative;
  transition: var(--transition);
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.card:hover, .config-card:hover, .feature-card:hover {
  box-shadow: 0 4px 14px -2px rgba(0,0,0,0.15);
}

/* Config card body wrapper (already in markup as .config-body) */
.config-card { margin-bottom: 20px; }
.config-card .config-header { display:flex; justify-content:space-between; align-items:center; padding:15px 20px; background: var(--light); border-bottom:1px solid var(--border); border-radius:12px 12px 0 0; }
.config-card .config-body { padding:20px; }

/* Feature cards keep original padding overrides */
.feature-card { padding:25px; cursor:pointer; }

/* Badges */
.status-badge, .badge {
  display:inline-block;
  font-size:12px;
  padding:4px 10px;
  border-radius:12px;
  font-weight:500;
  letter-spacing:.25px;
  background: var(--border);
  color: var(--text-secondary);
  line-height:1.1;
}
.status-badge.success, .badge-success { background:#D1FAE5; color:#065F46; }
.status-badge.error, .badge-danger { background:#FEE2E2; color:#991B1B; }
.status-badge.warning, .badge-warning { background:#FEF3C7; color:#92400E; }
.status-badge.info, .badge-info { background:#DBEAFE; color:#1E3A8A; }

/* Footer */
.app-footer {
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:6px 12px;
  font-size:12px;
  color: var(--text-secondary);
  border-top:1px solid var(--border);
  margin-top:4px;
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(6px);
}

/* Dark mode component adjustments */
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .config-card,
:root[data-theme="dark"] .feature-card { background: #1F2430; border-color:#2F3846; box-shadow:0 2px 6px rgba(0,0,0,0.4); }
:root[data-theme="dark"] .config-card .config-header { background:#232a36; border-color:#2F3846; }
:root[data-theme="dark"] .status-badge, :root[data-theme="dark"] .badge { background:#2F3846; color:#CBD5E1; }
:root[data-theme="dark"] .status-badge.success, :root[data-theme="dark"] .badge-success { background:rgba(16,185,129,0.15); color:#34D399; }
:root[data-theme="dark"] .status-badge.warning, :root[data-theme="dark"] .badge-warning { background:rgba(245,158,11,0.15); color:#FBBF24; }
:root[data-theme="dark"] .status-badge.error, :root[data-theme="dark"] .badge-danger { background:rgba(239,68,68,0.18); color:#F87171; }
:root[data-theme="dark"] .status-badge.info, :root[data-theme="dark"] .badge-info { background:rgba(59,130,246,0.18); color:#60A5FA; }
:root[data-theme="dark"] .app-footer { background:rgba(31,36,48,0.85); color:#94A3B8; }

/* Utility */
.hide { display:none !important; }

/* RAG Result Blocks */
.rag-result { border:1px solid var(--border); background: var(--card-bg,#fff); border-radius:12px; padding:16px 18px; margin:8px 0 12px; font-size:14px; line-height:1.45; }
.rag-result h4 { margin:8px 0 6px; font-size:13px; text-transform:uppercase; letter-spacing:.5px; color: var(--text-secondary); }
.rag-section { margin-bottom:14px; }
.rag-conclusion { padding:8px 10px; border:1px solid var(--border); border-radius:10px; background: var(--light); margin-bottom:8px; position:relative; }
.rag-conclusion-meta { position:absolute; top:6px; right:8px; font-size:11px; color: var(--text-secondary); }
.rag-support { border-left:3px solid var(--primary); padding:8px 10px 8px 14px; background: var(--light); border-radius:6px; margin-bottom:8px; }
.rag-support-title { font-weight:600; font-size:12px; margin-bottom:4px; color: var(--primary-dark,#4c1d95); }
.rag-support-body mark { background: #fde68a; color:#92400e; padding:0 2px; border-radius:3px; }
.rag-tools { display:flex; gap:8px; }
.rag-tools .btn { font-size:12px; padding:6px 10px; }

:root[data-theme="dark"] .rag-result { background:#1F2430; border-color:#2F3846; }
:root[data-theme="dark"] .rag-conclusion { background:#232a36; border-color:#2F3846; }
:root[data-theme="dark"] .rag-support { background:#232a36; border-color:#2F3846; }
:root[data-theme="dark"] .rag-support-body mark { background:#b45309; color:#fff; }

/* Intent & entity badges */
.intent-badge-bar { display:flex; flex-wrap:wrap; gap:4px; margin:2px 0 6px 48px; }
.badge-intent { background:#4a63e7; color:#fff; padding:2px 6px; border-radius:4px; font-size:11px; font-weight:600; letter-spacing:.5px; text-transform:uppercase; }
.badge-time { background:#2f855a; color:#fff; padding:2px 6px; border-radius:4px; font-size:11px; font-weight:500; }
.badge-entity { background:#e2e8f0; color:#1a202c; padding:2px 6px; border-radius:4px; font-size:11px; font-weight:500; }
:root[data-theme='dark'] .badge-entity { background:#2d3748; color:#edf2f7; }
.badge-entity.client { background:#f6ad55; color:#3d2e00; }
:root[data-theme='dark'] .badge-entity.client { background:#dd6b20; color:#fff; }
