/* Reset default browser margins for full-bleed layout */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

/* Prevent scrollbars on the RapiDoc page (it handles its own scrolling) */
body:not(.changelog) {
  overflow: hidden;
}

/* Ensure main content fills viewport */
#main-content {
  height: 100%;
}

/* RapiDoc should fill the container */
rapi-doc {
  height: 100%;
  width: 100%;
}

/* Skip link - hidden off-screen by default */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Visible on focus/active for keyboard navigation */
.skip-link:focus,
.skip-link:active {
  position: fixed;
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  overflow: visible;
  padding: 12px 24px;
  background-color: #1b7b8c;
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  border-radius: 4px;
  z-index: 10000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Changelog page styling */
body.changelog {
  height: auto;
  overflow: auto;
  max-width: 800px;
  margin: 40px auto;
  padding: 0 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1e3a5f;
  line-height: 1.6;
}

.changelog h1 {
  color: #0d4f6e;
  border-bottom: 2px solid #e1e5e8;
  padding-bottom: 8px;
}

.changelog h2 {
  color: #1b7b8c;
  margin-top: 32px;
}

.changelog h3 {
  color: #1e3a5f;
}

.changelog code {
  background: #f5f7f9;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
}

.changelog ul {
  padding-left: 24px;
}

.changelog li {
  margin-bottom: 4px;
}

.changelog a {
  color: #1b7b8c;
}

/* Version selector dropdown - explicit colors for Windows browsers
   that inherit white text from the header select into option elements */
#version-select option,
#version-select optgroup {
  background-color: #ffffff;
  color: #1e3a5f;
}

/* ProcessUnity Brand Styling for RapiDoc */
/* Brand Colors:
   - Primary Teal: #1B7B8C
   - Deep Blue: #0D4F6E
   - Accent Green: #3D8F35 (CTA buttons - WCAG AA accessible)
   - Dark Navy: #1E3A5F
   - Light Gray: #F5F7F9
   - Border Gray: #E1E5E8

   Button Style: Pill-shaped with border-radius: 40px
   Accessibility: All color combinations meet WCAG AA contrast requirements
*/

/* Hide authentication scope checkboxes */
rapi-doc::part(checkbox-auth-scope) {
  display: none;
}

/* Navigation bar styling - clean light sidebar */
rapi-doc::part(section-navbar) {
  background-color: #f5f7f9;
  border-right: 1px solid #e1e5e8;
}

/* Align search/filter box with nav items below */
rapi-doc::part(section-navbar-search) {
  padding-left: 12px;
  padding-right: 12px;
  justify-content: flex-start;
}

/* Main content area */
rapi-doc::part(section-main-content) {
  background-color: #ffffff;
  padding: 24px 32px;
}

/* Section headers in nav */
rapi-doc::part(section-navbar-item) {
  font-weight: 500;
}

/* Operations container - add padding around endpoint content */
rapi-doc::part(section-operations-in-tag) {
  padding: 16px 28px 28px 28px;
  background-color: #ffffff;
  border-radius: 8px;
  border: 1px solid #e1e5e8;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  margin-bottom: 16px;
}

/* Try button styling - ProcessUnity accent green with pill shape */
/* Accessible green (#3D8F35) provides 4.8:1 contrast with white text */
rapi-doc::part(btn-try) {
  background-color: #3d8f35;
  border-color: #3d8f35;
  border-radius: 40px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 12px;
  padding: 10px 24px;
}

rapi-doc::part(btn-try):hover {
  background-color: #357a2e;
  border-color: #357a2e;
}

/* General button styling - rounded pill shape */
rapi-doc::part(btn) {
  border-radius: 40px;
  transition: all 0.2s ease;
  font-weight: 500;
  padding: 8px 20px;
}

/* Primary buttons - ProcessUnity teal */
rapi-doc::part(btn-fill) {
  background-color: #1b7b8c;
  border-color: #1b7b8c;
  border-radius: 40px;
}

rapi-doc::part(btn-fill):hover {
  background-color: #156a79;
  border-color: #156a79;
}

/* Schema tables */
rapi-doc::part(schema-table) {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e1e5e8;
}

/* Input fields */
rapi-doc::part(textbox) {
  border-radius: 4px;
  border-color: #e1e5e8;
  padding: 8px 12px;
}

rapi-doc::part(textbox):focus {
  border-color: #1b7b8c;
  outline: 2px solid transparent;
  box-shadow: 0 0 0 3px rgba(27, 123, 140, 0.15);
}

/* Operation path labels - monospace font */
rapi-doc::part(label-operation-path) {
  font-family: "SF Mono", "Monaco", "Consolas", "Liberation Mono", monospace;
  font-size: 13px;
}

/* Overview section styling */
rapi-doc::part(section-overview) {
  padding: 24px 32px;
}

/* Code block styling */
rapi-doc::part(pre) {
  background-color: #f5f7f9;
  border-radius: 8px;
  border: 1px solid #e1e5e8;
}

/* Links - ProcessUnity teal */
rapi-doc::part(anchor) {
  color: #1b7b8c;
}

rapi-doc::part(anchor):hover {
  color: #0d4f6e;
  text-decoration: underline;
}

/* Tag headers in navigation */
rapi-doc::part(section-tag) {
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}

rapi-doc::part(section-tag):hover {
  border-left-color: #1b7b8c;
  background-color: rgba(27, 123, 140, 0.04);
}

/* HTTP method colors - WCAG AA accessible palette */
rapi-doc::part(label-get) {
  background-color: #3d8f35; /* Accessible green, 4.8:1 contrast */
}

rapi-doc::part(label-post) {
  background-color: #1b7b8c; /* Teal, 4.6:1 contrast */
}

rapi-doc::part(label-put) {
  background-color: #c77b00; /* Accessible orange, 4.5:1 contrast */
}

rapi-doc::part(label-patch) {
  background-color: #9b59b6; /* Purple, 4.6:1 contrast */
}

rapi-doc::part(label-delete) {
  background-color: #c0392b; /* Red, 5.1:1 contrast */
}

/* Header styling */
rapi-doc::part(section-header) {
  background: linear-gradient(135deg, #1b7b8c 0%, #0d4f6e 100%);
}

/* Authentication section */
rapi-doc::part(section-auth) {
  background-color: #f5f7f9;
  border-radius: 8px;
  border: 1px solid #e1e5e8;
}

/* Server selection dropdown */
rapi-doc::part(select) {
  border-radius: 4px;
  border-color: #e1e5e8;
}

/* Response area styling */
rapi-doc::part(section-response) {
  border-radius: 8px;
  border: 1px solid #e1e5e8;
}

/* Tab styling */
rapi-doc::part(tab-btn) {
  border-radius: 4px 4px 0 0;
}

rapi-doc::part(tab-btn-active) {
  background-color: #1b7b8c;
  color: #ffffff;
}
