/* AdmiralCloud API Documentation Styles */

.admiralcloud-api-docs {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
  color: #333;
  background-color: #fff;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  margin: 20px 0;
  padding: 20px;
  max-width: 100%;
  overflow: hidden;
}

/* Method header */
.method-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e8e8e8;
}

.http-method {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 14px;
  text-transform: uppercase;
  margin-right: 10px;
}

.method-get {
  background-color: #61affe;
  color: white;
}

.method-post {
  background-color: #49cc90;
  color: white;
}

.method-put {
  background-color: #fca130;
  color: white;
}

.method-delete {
  background-color: #f93e3e;
  color: white;
}

.method-patch {
  background-color: #50e3c2;
  color: white;
}

.api-path {
  font-family: monospace;
  font-size: 16px;
  font-weight: 600;
}

/* IAM Permissions  */
.iam-permissions-section {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e8e8e8;
}

.iam-permissions-title {
  font-size: 14px;
  font-weight: 600;
  color: #555;
  margin-bottom: 10px;
}

.iam-permissions-content {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.iam-permission-badge {
  display: inline-block;
  background-color: #5c6bc0;
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: monospace;
}

/* Combined IAM permissions table */
.iam-combined-permissions-table {
  width: auto;
  border-collapse: separate;
  border-spacing: 0 4px;
  margin: 0;
  font-size: 13px;
}

.iam-combined-permissions-table td {
  padding: 3px 12px 3px 0;
  border: none;
  vertical-align: middle;
}

.iam-row-label {
  font-size: 11px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  white-space: nowrap;
  padding-right: 12px !important;
  letter-spacing: 0.04em;
}

.iam-row-content {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.iam-field-arrow {
  color: #aaa;
  font-size: 13px;
  margin: 0 2px;
}

.iam-field-name {
  display: inline-block;
  background-color: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 1px 7px;
  font-family: monospace;
  font-size: 12px;
  color: #444;
}

/* Description */
.method-description {
  margin-bottom: 25px;
  line-height: 1.5;
  color: #555;
}

/* Section styles */
.section {
  margin-bottom: 30px;
}

.section .header3 {
  font-size: 18px;
  margin-bottom: 15px;
  color: #333;
  font-weight: 600;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

/* Tables */
.admiralcloud-api-docs table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 14px;
}

.admiralcloud-api-docs thead {
  background-color: #f5f5f5;
}

.admiralcloud-api-docs th {
  text-align: left;
  padding: 12px 15px;
  font-weight: 600;
  border-bottom: 2px solid #ddd;
}

.admiralcloud-api-docs td {
  padding: 10px 15px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}

.admiralcloud-api-docs tr:hover {
  background-color: #f9f9f9;
}

/* Required fields */
.admiralcloud-api-docs td strong {
  font-weight: 800;
}

/* Response field levels */
.level-0 .level-1 .level-2 .level-3 {
  font-weight: 200;
}

.level-1 td:first-child {
  padding-left: 25px;
}

.level-2 td:first-child {
  padding-left: 45px;
}

.level-3 td:first-child {
  padding-left: 65px;
}

/* Enhanced Badge Styles with text content support */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 5px;
  margin-bottom: 3px;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  cursor: help; /* Shows a help cursor to indicate there might be more info on hover */
}

/* Add a box-shadow on hover to enhance visibility */
.badge:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  max-width: none; /* Allow full text to be visible on hover */
  white-space: normal; /* Allow text wrapping on hover */
  z-index: 100;
  position: relative;
}

.deprecated {
  background-color: #f93e3e !important;
  color: white !important;
}

.beta {
  background-color: #5c6bc0 !important;
  color: white !important;
}

.experimental {
  background-color: #8e44ad !important; 
  color: white !important;
}

.retired {
  background-color: #ff9800 !important;
  color: white !important;
}

.iam-field-badge {
  background-color: #5c6bc0 !important;
  color: white !important;
  font-family: monospace;
}

/* Add a tooltip style for longer badge texts */
@media (min-width: 768px) {
  .badge[title]:hover::after {
    content: attr(title);
    position: absolute;
    left: 0;
    top: 100%;
    background: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    white-space: normal;
    max-width: 300px;
    z-index: 200;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    margin-top: 5px;
  }
}

/* Range and Enum Styles */
.field-constraints {
  margin-top: 5px;
  font-size: 12px;
  font-family: monospace;
  line-height: 1.4;
}

.range-constraint {
  display: inline-flex;
  align-items: center;
  background-color: #f0f8ff;
  border: 1px solid #d1e8ff;
  border-radius: 3px;
  padding: 2px 6px;
  margin-right: 6px;
  margin-bottom: 5px;
  color: #0066cc;
}

.enum-constraint {
  display: inline-block;
  margin-top: 5px;
}

.enum-values {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.enum-value {
  display: inline-block;
  background-color: #f3f0ff;
  border: 1px solid #e2d7ff;
  border-radius: 3px;
  padding: 2px 6px;
  color: #5a3ca5;
  font-family: monospace;
  font-size: 11px;
}

.range-icon, .enum-icon {
  margin-right: 5px;
  font-size: 11px;
}

/* Examples section */
.example {
  background-color: #fafafa;
  border: 1px solid #eee;
  border-radius: 4px;
  padding: 15px;
  margin-bottom: 20px;
}

.example .header4 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 16px;
  font-weight: 600;
}

.example .header5 {
  font-size: 14px;
  margin: 10px 0;
  color: #555;
}

.example-request, .example-response {
  margin-bottom: 15px;
}

.example pre {
  background-color: #f0f0f0;
  padding: 12px;
  border-radius: 4px;
  overflow-x: auto;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
  font-size: 12px;
  line-height: 1.4;
  color: #333;
  margin: 0;
}

/* Editor styles */
.api-docs-preview {
  padding: 15px;
  background: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.loading-message, .error-message, .empty-message {
  padding: 15px;
  text-align: center;
  font-style: italic;
  color: #666;
}

.error-message {
  color: #d32f2f;
}

/* Mobile responsiveness */
@media screen and (max-width: 768px) {
  .admiralcloud-api-docs {
    padding: 15px;
  }
  
  .admiralcloud-api-docs table {
    display: block;
    overflow-x: auto;
  }
  
  .method-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .http-method {
    margin-bottom: 10px;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .admiralcloud-api-docs {
    background-color: #1e1e1e;
    color: #e0e0e0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  }
  
  .method-header {
    border-bottom-color: #333;
  }
  
  .method-description {
    color: #bbb;
  }
  
  .admiralcloud-api-docs thead {
    background-color: #2a2a2a;
  }
  
  .admiralcloud-api-docs th {
    border-bottom-color: #444;
  }
  
  .admiralcloud-api-docs td {
    border-bottom-color: #333;
  }
  
  .admiralcloud-api-docs tr:hover {
    background-color: #252525;
  }
  
  .example {
    background-color: #252525;
    border-color: #333;
  }
  
  .example pre {
    background-color: #2a2a2a;
    color: #e0e0e0;
  }
  
  .section .header3 {
    color: #e0e0e0;
    border-bottom-color: #333;
  }
  
  .range-constraint {
    background-color: #1a2736;
    border-color: #234766;
    color: #6bb5ff;
  }
  
  .enum-value {
    background-color: #232036;
    border-color: #362f59;
    color: #b39dff;
  }
  
  .iam-permissions-section {
    border-bottom-color: #333;
  }
  
  .iam-permissions-title {
    color: #bbb;
  }
  
  .iam-permission-badge {
    background-color: #3f51b5;
  }

  .iam-field-badge {
    background-color: #3f51b5 !important;
  }

  .iam-row-label {
    color: #666;
  }

  .iam-field-arrow {
    color: #555;
  }

  .iam-field-name {
    background-color: #2a2a2a;
    border-color: #444;
    color: #ccc;
  }
  
  .badge[title]:hover::after {
    background: #444;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
  }
}
