/**
 * --------------------------------------------------------------------
 * docmd : the zero-config documentation engine.
 *
 * @package     @docmd/core (and ecosystem)
 * @website     https://docmd.io
 * @repository  https://github.com/docmd-io/docmd
 * @license     MIT
 * @copyright   Copyright (c) 2025-present docmd.io
 *
 * [docmd-source] - Please do not remove this header.
 * --------------------------------------------------------------------
 */

/* OpenAPI Plugin Styles */

.oa-spec {
  margin: 1.5rem 0;
  max-width: 100%;
}

.oa-spec-header {
  border-bottom: 2px solid var(--border-color, #e5e7eb);
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
  max-width: 100%;
}

.oa-spec-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.75rem;
  font-weight: 700;
  word-break: break-word;
}

.oa-spec-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.oa-spec-version {
  font-size: 0.8rem;
  background: var(--code-bg, #f3f4f6);
  color: var(--text-muted, #4b5563);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
}

.oa-download-link {
  font-size: 0.8rem;
  color: var(--link-color, #2563eb);
  text-decoration: none;
}

.oa-download-link:hover {
  text-decoration: underline;
}

.oa-spec-description {
  color: var(--text-muted, #4b5563);
  margin-bottom: 1.5rem;
  max-width: 100%;
  word-break: break-word;
}

.oa-operation {
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  background: var(--bg-surface, #fff);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden; /* Prevent horizontal container blowout */
}

.oa-operation-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.oa-method {
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.oa-path {
  font-weight: 600;
  font-size: 1rem;
  word-break: break-all;
}

.oa-deprecated {
  font-size: 0.7rem;
  background: #fee2e2;
  color: #991b1b;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.oa-summary {
  font-weight: 600;
  margin-bottom: 0.5rem;
  word-break: break-word;
}

.oa-description {
  color: var(--text-muted, #4b5563);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  word-break: break-word;
}

.oa-operation h5 {
  margin: 1.25rem 0 0.5rem 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #6b7280);
}

.oa-content-type {
  font-size: 0.8rem;
  color: var(--text-muted, #4b5563);
  margin: 0.5rem 0;
}

/* Horizontal scroll wrapper for schema tables */
.oa-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1rem 0 0;
  box-sizing: border-box;
}

.oa-schema-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.9rem;
  box-sizing: border-box;
}

.oa-schema-table th, .oa-schema-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color, #eee);
  word-break: normal;
}

.oa-schema-table th {
  background: var(--code-bg, #f9fafb);
  font-weight: 600;
  color: var(--text-muted, #4b5563);
  white-space: nowrap;
}

/* Add .oa-no-hover to a .oa-schema-table to disable the theme's global
   tr:hover highlight */
.oa-schema-table.oa-no-hover tr:hover td {
  background-color: inherit;
}

/* Add .oa-hover to a nested .oa-schema-table */
.oa-schema-table.oa-hover tr:hover td {
  background-color: var(--sidebar-link-active-bg, rgba(0, 0, 0, 0.04));
}

.oa-required {
  color: #ef4444;
  margin-left: 0.25rem;
}

.oa-type {
  color: #0891b2;
  font-family: var(--font-family-mono, monospace);
  font-size: 0.85rem;
}

.oa-param-in {
  font-size: 0.75rem;
  background: var(--code-bg, #f3f4f6);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  color: var(--text-muted, #4b5563);
}

.oa-status-badge {
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.8rem;
}

.oa-status-ok { background: #d1fae5; color: #065f46; }
.oa-status-err { background: #fee2e2; color: #991b1b; }
.oa-status-other { background: #f3f4f6; color: #4b5563; }

.oa-response-detail-row td {
  padding: 0;
  border-bottom: 1px solid var(--border-color, #eee);
}

.oa-response-detail {
  margin: 0.5rem 1rem 1rem;
  border: 1px solid var(--border-color, #eee);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  max-width: calc(100% - 2rem);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.oa-response-detail summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted, #4b5563);
}

.oa-nested-schema {
  margin-top: 0.25rem;
  padding-left: 0.75rem;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.oa-nested-schema summary {
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--link-color, #3b82f6);
}

/* Indentation lives on the .oa-nested-schema wrapper (via padding-left) rather
   than the table itself, so nested tables keep full-width cells/padding at any
   depth instead of shrinking further with each level of nesting. */
.oa-nested-schema table {
  margin: 0.5rem 0;
  width: 100%;
}

.oa-additional-props {
  padding: 0 1rem;
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted, #4b5563);
}

.oa-variants {
  padding: 0 1rem;
  margin: 0.5rem 0;
  max-width: 100%;
  box-sizing: border-box;
}

.oa-variants-label {
  margin: 0 0 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
}

.oa-discriminator {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted, #6b7280);
}

.oa-variant {
  border: 1px solid var(--border-color, #eee);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  margin-bottom: 0.4rem;
  max-width: 100%;
  box-sizing: border-box;
}

.oa-variant summary {
  cursor: pointer;
}

.oa-examples-title {
  margin: 1.5rem 1rem 0.5rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #6b7280);
  font-weight: 700;
}

.oa-examples {
  padding: 0 1rem;
  max-width: 100%;
  box-sizing: border-box;
}

.oa-example {
  margin-bottom: 0.5rem;
  max-width: 100%;
  box-sizing: border-box;
}

.oa-example summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
}

.oa-example-description {
  margin: 0.25rem 0;
  color: var(--text-muted, #4b5563);
  font-size: 0.85rem;
}

.oa-example-value {
  background: var(--code-bg, #f9fafb);
  border: 1px solid var(--border-color, #eee);
  border-radius: 6px;
  padding: 0.75rem;
  overflow-x: auto;
  font-size: 0.85rem;
  max-width: 100%;
  box-sizing: border-box;
}

/* Dark Mode Overrides */
:root[data-theme=dark] .oa-type {
  color: #22d3ee;
}

:root[data-theme=dark] .oa-status-ok { background: #065f4633; color: #34d399; }
:root[data-theme=dark] .oa-status-err { background: #991b1b33; color: #f87171; }
:root[data-theme=dark] .oa-status-other { background: #27272a; color: #a1a1aa; }

.oa-error {
  padding: 1rem;
  background: #fef2f2;
  border: 1px solid #fee2e2;
  color: #991b1b;
  border-radius: 8px;
  margin: 1rem 0;
}

:root[data-theme=dark] .oa-error {
  background: #991b1b22;
  border-color: #991b1b44;
  color: #f87171;
}