/* === Meshery Schemas Site — Design System === */
:root {
  --color-primary: #00b39f;
  --color-primary-dark: #009985;
  --color-primary-light: #00d3a9;
  --color-bg: #ffffff;
  --color-bg-alt: #f7f8fa;
  --color-bg-code: #f0f2f5;
  --color-text: #1e2737;
  --color-text-muted: #5b6577;
  --color-border: #e1e4e8;
  --color-error: #d73a49;
  --color-success: #22863a;
  --color-warning: #e36209;
  --color-info: #0366d6;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1);
  --max-width: 1200px;
  --sidebar-width: 260px;
}

/* === Reset & Base === */
*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}
a {
  color: var(--color-primary-dark);
  text-decoration: none;
}
a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}
img {
  max-width: 100%;
  height: auto;
}
code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-bg-code);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}
pre {
  background: var(--color-bg-code);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.5;
}
pre code {
  background: none;
  padding: 0;
}
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}
th,
td {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--color-border);
  text-align: left;
}
th {
  background: var(--color-bg-alt);
  font-weight: 600;
}
tr:nth-child(even) {
  background: var(--color-bg-alt);
}
h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}
h1 {
  font-size: 2rem;
}
h2 {
  font-size: 1.5rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.3em;
}
h3 {
  font-size: 1.25rem;
}
blockquote {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--color-primary);
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
}

/* === Layout === */
.site-header {
  background: var(--color-text);
  color: #fff;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.site-header .wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 56px;
}
.site-title {
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff !important;
  text-decoration: none !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.site-title:hover {
  color: var(--color-primary-light) !important;
}
.site-title img {
  height: 28px;
  width: auto;
}
.site-nav {
  margin-left: auto;
  display: flex;
  gap: 0.25rem;
}
.site-nav a {
  color: rgba(255, 255, 255, 0.85);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s;
}
.site-nav a:hover,
.site-nav a.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  text-decoration: none;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
    margin-left: auto;
  }
  .site-nav {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--color-text);
    flex-direction: column;
    padding: 0.5rem;
    box-shadow: var(--shadow-lg);
  }
  .site-nav.open {
    display: flex;
  }
  .site-nav a {
    padding: 0.6rem 1rem;
  }
}

.page-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.site-footer a {
  color: var(--color-primary-dark);
}

/* === Guide pages with sidebar === */
.guide-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
@media (max-width: 768px) {
  .guide-layout {
    grid-template-columns: 1fr;
  }
}
.guide-sidebar {
  position: sticky;
  top: 72px;
  align-self: start;
  max-height: calc(100vh - 88px);
  overflow-y: auto;
}
.guide-sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.guide-sidebar li {
  margin: 0;
}
.guide-sidebar a {
  display: block;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  color: var(--color-text-muted);
  font-size: 0.9rem;
}
.guide-sidebar a:hover {
  background: var(--color-bg-alt);
  color: var(--color-text);
  text-decoration: none;
}
.guide-sidebar a.active {
  background: rgba(0, 179, 159, 0.1);
  color: var(--color-primary-dark);
  font-weight: 600;
}
.guide-sidebar .section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  padding: 0.75rem 0.75rem 0.25rem;
  margin-top: 0.5rem;
}
.guide-content {
  min-width: 0;
}

/* === Cards Grid === */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}
.card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition:
    box-shadow 0.15s,
    border-color 0.15s;
}
.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary);
}
.card h3 {
  margin-top: 0;
  font-size: 1.1rem;
}
.card p {
  margin: 0.5rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}
.card .badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15em 0.5em;
  border-radius: 3px;
  background: var(--color-bg-code);
  color: var(--color-text-muted);
  margin-right: 0.35rem;
}
.card .badge.current {
  background: rgba(0, 179, 159, 0.12);
  color: var(--color-primary-dark);
}

/* === Hero === */
.hero {
  text-align: center;
  padding: 3rem 1rem 2rem;
}
.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}
.hero .lead {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  max-width: 680px;
  margin: 0 auto 2rem;
}
.hero-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none !important;
  transition:
    background 0.15s,
    transform 0.1s;
}
.btn:active {
  transform: scale(0.98);
}
.btn-primary {
  background: var(--color-primary);
  color: #fff !important;
}
.btn-primary:hover {
  background: var(--color-primary-dark);
}
.btn-outline {
  border: 2px solid var(--color-border);
  color: var(--color-text) !important;
  background: #fff;
}
.btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary-dark) !important;
}

/* === Sections === */
.section {
  margin: 3rem 0;
}
.section-header {
  text-align: center;
  margin-bottom: 1.5rem;
}
.section-header h2 {
  border: none;
}
.section-header p {
  color: var(--color-text-muted);
}

/* === Callouts === */
.callout {
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  border-left: 4px solid;
  font-size: 0.95rem;
}
.callout-info {
  border-color: var(--color-info);
  background: #f1f8ff;
}
.callout-warning {
  border-color: var(--color-warning);
  background: #fff8f1;
}
.callout-error {
  border-color: var(--color-error);
  background: #ffeef0;
}
.callout-success {
  border-color: var(--color-success);
  background: #f0fff4;
}
.callout strong {
  display: block;
  margin-bottom: 0.25rem;
}

/* === Construct browser === */
.version-filter {
  margin-bottom: 1.5rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.version-filter button {
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
}
.version-filter button:hover {
  border-color: var(--color-primary);
}
.version-filter button.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* === Validator === */
.validator-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}
@media (max-width: 768px) {
  .validator-container {
    grid-template-columns: 1fr;
  }
}
.validator-input,
.validator-output {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.validator-input label,
.validator-output label {
  display: block;
  padding: 0.5rem 0.75rem;
  background: var(--color-bg-alt);
  font-weight: 600;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--color-border);
}
.validator-input textarea {
  width: 100%;
  min-height: 350px;
  border: none;
  padding: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  resize: vertical;
  outline: none;
}
.validator-controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.validator-controls select {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.9rem;
}
.validation-result {
  padding: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  min-height: 350px;
  overflow-y: auto;
  white-space: pre-wrap;
}
.validation-result .error {
  color: var(--color-error);
}
.validation-result .success {
  color: var(--color-success);
}

/* === Property Table === */
.prop-table {
  font-size: 0.85rem;
}
.prop-table code {
  font-size: 0.8rem;
}
.prop-required {
  color: var(--color-error);
  font-weight: 600;
  font-size: 0.75rem;
}

/* === Tabs === */
.tabs {
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 1rem;
  display: flex;
  gap: 0;
}
.tab-btn {
  padding: 0.5rem 1rem;
  border: none;
  background: none;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s;
}
.tab-btn:hover {
  color: var(--color-text);
}
.tab-btn.active {
  color: var(--color-primary-dark);
  border-bottom-color: var(--color-primary);
}
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* === Version badge === */
.version-badge {
  display: inline-block;
  padding: 0.2em 0.6em;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 3px;
  background: rgba(0, 179, 159, 0.12);
  color: var(--color-primary-dark);
}
.version-badge.deprecated {
  background: rgba(215, 58, 73, 0.1);
  color: var(--color-error);
}

/* === Copy button for code blocks === */
.code-wrapper {
  position: relative;
}
.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.code-wrapper:hover .copy-btn {
  opacity: 1;
}

/* === Right vs Wrong comparison === */
.comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}
@media (max-width: 768px) {
  .comparison {
    grid-template-columns: 1fr;
  }
}
.comparison-wrong,
.comparison-right {
  border-radius: var(--radius);
  overflow: hidden;
}
.comparison-wrong {
  border: 1px solid var(--color-error);
}
.comparison-right {
  border: 1px solid var(--color-success);
}
.comparison-wrong .comparison-label {
  background: #ffeef0;
  color: var(--color-error);
  padding: 0.35rem 0.75rem;
  font-weight: 600;
  font-size: 0.8rem;
}
.comparison-right .comparison-label {
  background: #f0fff4;
  color: var(--color-success);
  padding: 0.35rem 0.75rem;
  font-weight: 600;
  font-size: 0.8rem;
}
.comparison pre {
  margin: 0;
  border: none;
  border-radius: 0;
}

/* === Construct Detail Page === */
.endpoint-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  background: var(--color-bg);
  box-shadow: var(--shadow);
}
.endpoint-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.endpoint-method {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  text-transform: uppercase;
}
.endpoint-method--get    { background: var(--color-info); }
.endpoint-method--post   { background: var(--color-success); }
.endpoint-method--put    { background: var(--color-warning); }
.endpoint-method--patch  { background: #6f42c1; }
.endpoint-method--delete { background: var(--color-error); }

.endpoint-path {
  font-size: 0.95rem;
  word-break: break-all;
}
.endpoint-summary {
  margin: 0.5rem 0 0.25rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}
.endpoint-meta {
  margin: 0.25rem 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.endpoint-details {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}
.endpoint-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--color-primary-dark);
  padding: 0.25rem 0;
}
.endpoint-details .prop-table {
  margin-top: 0.5rem;
}

.response-code {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-mono);
}
.response-code--2 { background: #f0fff4; color: var(--color-success); }
.response-code--3 { background: #fff8e1; color: #795548; }
.response-code--4 { background: #fff3e0; color: var(--color-warning); }
.response-code--5 { background: #ffeef0; color: var(--color-error); }

.schema-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  background: var(--color-bg-alt);
}
.schema-card h4 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.prop-required {
  display: inline-block;
  background: rgba(0,179,159,.12);
  color: var(--color-primary-dark);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: 600;
}
#construct-header {
  margin-bottom: 1.5rem;
}
#construct-header h1 {
  margin: 0.25rem 0 0.5rem;
}
#construct-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.text-muted {
  color: var(--color-text-muted);
}
.error {
  color: var(--color-error);
}

