/* ============================================================
   Declarative WebMCP Demo
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: #242424;
  background: #f9f9f9;
  -webkit-font-smoothing: antialiased;
}

/* ---- Layout ---- */

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 2rem 3rem;
}

/* ---- Page header ---- */

.page-header {
  margin-bottom: 1.25rem;
}

.page-header h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  color: #242424;
}

.page-header p {
  margin: 0;
  color: #616161;
  font-size: 0.8125rem;
  line-height: 1.5;
}

/* ---- Tab bar (Fluent pivot style) ---- */

.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 1rem;
}

.tab-button {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.625rem 1rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 400;
  color: #616161;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.tab-button:hover {
  color: #242424;
}

.tab-button.active {
  color: #0078d4;
  font-weight: 600;
  border-bottom-color: #0078d4;
}

/* ---- Tab panels ---- */

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.panel-description {
  margin: 0 0 1rem;
  color: #616161;
  font-size: 0.8125rem;
  line-height: 1.55;
}

.panel-description code {
  background: #f0f0f0;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.75rem;
}

/* ---- Split layout ---- */

.split-layout {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 1.25rem;
  align-items: start;
}

/* ---- Browser chrome (around form) ---- */

.browser-chrome {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #d0d0d0;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.browser-toolbar {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  background: #f0f0f0;
  border-bottom: 1px solid #d0d0d0;
  user-select: none;
}

.browser-dots {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.browser-dots i {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.browser-dots i:nth-child(1) { background: #ff5f57; }
.browser-dots i:nth-child(2) { background: #febc2e; }
.browser-dots i:nth-child(3) { background: #28c840; }

.browser-url {
  flex: 1;
  background: #fff;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  padding: 4px 10px;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 11px;
  color: #616161;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Inner site header inside browser chrome */

.site-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-logo {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: #0078d4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.site-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #242424;
}

/* Separator under site header */

.site-header {
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid #eaeaea;
}

/* Form area inside browser chrome */

.browser-body {
  padding: 0.75rem 1.25rem 1.25rem;
}

.form-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #242424;
  margin: 0 0 0.625rem;
}

/* Attribute annotation badges */

.attr-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.75rem;
}

.attr-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: "Cascadia Code", "Consolas", "Courier New", monospace;
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.4;
}

.attr-badge.new {
  background: rgba(0, 120, 212, 0.1);
  color: #0078d4;
  border: 1px solid rgba(0, 120, 212, 0.25);
}

.attr-badge.new::before {
  content: "+";
  font-weight: 700;
  font-size: 11px;
}

.attr-badge.base {
  background: #f5f5f5;
  color: #777;
  border: 1px solid #e0e0e0;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #424242;
}

.form-group input,
.form-group select {
  padding: 7px 10px;
  border: 1px solid #d1d1d1;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.8125rem;
  color: #242424;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input::placeholder {
  color: #999;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #0078d4;
  box-shadow: 0 0 0 1px #0078d4;
}

/* Submit row */

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.375rem;
}

.btn-submit {
  background: #0078d4;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 8px 20px;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-submit:hover {
  background: #006cbe;
}

.btn-submit:active {
  background: #005a9e;
}

/* Toast message */

.toast {
  font-size: 0.75rem;
  color: #0e7a0d;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s;
}

.toast.visible {
  opacity: 1;
}

/* ---- Code block (no chrome, just dark box) ---- */

.code-pane {
  background: #1e1e1e;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #333;
}

pre.code-block,
pre.code-block code {
  font-family: "Cascadia Code", "Consolas", "Courier New", monospace;
  font-size: 12px;
}

.code-block {
  background: #1e1e1e;
  color: #d4d4d4;
  border-radius: 0;
  padding: 0.875rem 1rem;
  overflow: auto;
  max-height: 520px;
  line-height: 1.6;
  margin: 0;
  tab-size: 2;
  scrollbar-color: #555 #1e1e1e;
}

.code-block::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.code-block::-webkit-scrollbar-track {
  background: #1e1e1e;
}

.code-block::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 4px;
}

.code-block::-webkit-scrollbar-thumb:hover {
  background: #666;
}

.code-block code {
  background: none;
  padding: 0;
}

/* ---- Syntax coloring (VS Code dark theme) ---- */

.t-tag { color: #569cd6; }
.t-attr,
.t-prop { color: #9cdcfe; }
.t-str { color: #ce9178; }
.t-punc { color: #808080; }
.t-cmt { color: #6a9955; font-style: italic; }
.t-kw { color: #569cd6; }
.t-fn { color: #dcdcaa; }
.t-num { color: #b5cea8; }
.t-op { color: #d4d4d4; }

/* Highlighted lines */

.hl {
  padding: 1px 3px;
  border-radius: 3px;
  background: rgba(0, 120, 212, 0.18);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Dimmed lines (context, not the focus) */

.dim {
  opacity: 0.58;
}

/* ---- API Reference section ---- */

.api-reference {
  margin-top: 2.5rem;
  border-top: 1px solid #e0e0e0;
  padding-top: 1.5rem;
}

.api-reference h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: #242424;
}

.api-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.api-table th,
.api-table td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #e8e8e8;
  vertical-align: top;
}

.api-table th {
  font-weight: 600;
  color: #424242;
  background: #f5f5f5;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.api-table td {
  color: #424242;
}

.api-table code {
  background: #f0f0f0;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.75rem;
}

.api-table tr:last-child td {
  border-bottom: none;
}

.api-group-label {
  font-weight: 600;
  color: #242424;
  background: #fafafa;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* ---- Responsive ---- */

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

@media (max-width: 768px) {
  .container {
    padding: 1rem 1rem 2rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .tab-button {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
  }
}
