/* ── KNTIC Intelligence Style System ──
   Adopted from kntic.ai design language
*/

/* ── Base ── */
html, body {
  background: #0a0a0a;
  color: #ffffff;
  overflow-x: clip;
  width: 100%;
  max-width: 100vw;
  margin: 0;
  padding: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

* {
  box-sizing: border-box;
}

a {
  color: #ffffff;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #FF4500;
}

/* ── Noise overlay ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.045;
  pointer-events: none;
  z-index: 9999;
}

/* ── Layout ── */
.app-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* ── Header ── */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
  margin-bottom: 32px;
  position: sticky;
  top: 12px;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(14px);
  border: 1px solid #27272a;
  border-radius: 12px;
  z-index: 10;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand strong {
  font-size: 1.1rem;
  font-weight: 600;
}

.brand span {
  color: #71717a;
  font-size: 0.85rem;
}

/* ── Navigation ── */
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-link,
.quick-link,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #27272a;
  background: #171717;
  color: #ffffff;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.nav-link:hover,
.quick-link:hover,
.pill:hover {
  border-color: #FF4500;
  color: #FF4500;
}

.nav-link.active {
  border-color: #FF4500;
  background: rgba(255, 69, 0, 0.08);
  color: #FF4500;
}

/* ── Hero Section ── */
.hero {
  padding: 40px 32px;
  margin-bottom: 32px;
  background: rgba(10, 10, 10, 0.6);
  border: 1px solid #27272a;
  border-radius: 16px;
}

.hero h1,
.page-intro h1,
.page-section h2 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.05;
  font-weight: 700;
}

.hero h1 .gradient-text,
.page-intro h1 .gradient-text {
  background: linear-gradient(135deg, #ffffff 0%, #FF4500 60%, #ff8c00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p,
.page-intro p {
  max-width: 70ch;
  color: #a1a1aa;
  margin: 0;
}

/* ── Page Sections ── */
.page-section {
  padding: 24px;
  margin-bottom: 24px;
  background: rgba(10, 10, 10, 0.6);
  border: 1px solid #27272a;
  border-radius: 16px;
}

.section-header,
.row-between,
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

/* ── Cards & Grid ── */
.grid {
  display: grid;
  gap: 16px;
}

.grid.cards,
.capability-grid,
.agent-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  padding: 20px;
  background: rgba(23, 23, 23, 0.6);
  border: 1px solid #27272a;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.card:hover {
  border-color: #FF4500;
  box-shadow: 0 0 0 1px #FF4500, 0 0 24px 2px rgba(255, 69, 0, 0.08);
}

.card h3,
.card h2 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.1rem;
}

/* ── Tables ── */
.table-wrap {
  overflow: hidden;
  background: rgba(10, 10, 10, 0.6);
  border: 1px solid #27272a;
  border-radius: 16px;
  margin-bottom: 24px;
}

.table-scroll {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid #27272a;
  vertical-align: top;
}

.table th {
  font-weight: 600;
  color: #a1a1aa;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.02);
}

.table tbody tr:hover {
  background: rgba(255, 69, 0, 0.04);
}

/* ── Badges & Pills ── */
.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 0.85rem;
  border: 1px solid #27272a;
}

.boolean-badge,
.diff-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.85rem;
}

.boolean-badge::before,
.diff-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.boolean-badge.true::before,
.diff-badge.positive::before {
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.4);
}

.boolean-badge.false::before {
  background: #71717a;
}

.diff-badge.negative::before {
  background: #FF4500;
}

/* ── Status Pills ── */
.status-ok {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.08);
  border-color: rgba(74, 222, 128, 0.2);
}

.status-warn {
  color: #FF4500;
  background: rgba(255, 69, 0, 0.08);
  border-color: rgba(255, 69, 0, 0.2);
}

.status-idle {
  color: #71717a;
  background: rgba(113, 113, 122, 0.08);
  border-color: rgba(113, 113, 122, 0.2);
}

/* ── Forms & Inputs ── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-size: 0.85rem;
  color: #a1a1aa;
  font-weight: 500;
}

.field input,
.field select {
  background: rgba(23, 23, 23, 0.8);
  color: #ffffff;
  border: 1px solid #27272a;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: #FF4500;
  box-shadow: 0 0 0 2px rgba(255, 69, 0, 0.1);
}

/* ── Buttons ── */
.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #27272a;
  background: #171717;
  color: #ffffff;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.button:hover,
.icon-button:hover {
  border-color: #FF4500;
  background: rgba(255, 69, 0, 0.08);
  color: #FF4500;
}

.button.primary {
  background: linear-gradient(135deg, #FF4500 0%, #ff8c00 100%);
  border-color: #FF4500;
}

.button.primary:hover {
  box-shadow: 0 0 24px 4px rgba(255, 69, 0, 0.2);
}

/* ── Metrics ── */
.metric {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 69, 0, 0.12);
  color: #FF4500;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid rgba(255, 69, 0, 0.2);
}

/* ── Code ── */
code,
.code-block {
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.9em;
}

code.inline {
  background: rgba(23, 23, 23, 0.8);
  border: 1px solid #27272a;
  border-radius: 6px;
  padding: 2px 6px;
  color: #FF4500;
}

/* ── Notices & Toasts ── */
.notice,
.toast {
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.notice.warning {
  border: 1px solid rgba(255, 69, 0, 0.3);
  background: rgba(255, 69, 0, 0.05);
}

.toast-stack {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

/* ── Footer ── */
footer.page-footer {
  padding: 24px 0 36px;
  color: #71717a;
  text-align: center;
  border-top: 1px solid #27272a;
  margin-top: 40px;
}

/* ── Utility Classes ── */
.muted,
.table-caption,
.empty-state,
.label-hint,
.provider-name,
.vendor-name {
  color: #71717a;
}

.glow-hover {
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.glow-hover:hover {
  box-shadow: 0 0 0 1px #FF4500, 0 0 24px 2px rgba(255, 69, 0, 0.14);
  border-color: #FF4500 !important;
}

.gradient-text {
  background: linear-gradient(135deg, #ffffff 0%, #FF4500 60%, #ff8c00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* ── Scrollbar ── */
.dash-scroll::-webkit-scrollbar,
.table-scroll::-webkit-scrollbar {
  width: 3px;
  height: 3px;
}

.dash-scroll::-webkit-scrollbar-track,
.table-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.dash-scroll::-webkit-scrollbar-thumb,
.table-scroll::-webkit-scrollbar-thumb {
  background: #27272a;
  border-radius: 2px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .app-shell {
    padding: 16px;
  }

  .site-header {
    position: static;
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-start;
  }

  .hero,
  .page-section {
    padding: 20px;
  }

  .hero h1,
  .page-intro h1 {
    font-size: 1.75rem;
  }

  .table th,
  .table td {
    padding: 12px 10px;
    font-size: 0.85rem;
  }
}
