/* Custom CSS for MuscleLib API Documentation */
:root {
  --primary-color: #14c4ff;
  --hover-bg: #242835;
  --active-bg: #043aec;
  --dark-bg: #1a1a1a;
  --dark-border: #2c2c2c;
  --light-bg: #f7f9fc;

  /* Shared "surface" tokens (used for accordions / cards / code blocks) */
  --docs-surface: rgba(255, 255, 255, 0.90);
  --docs-surface-2: rgba(15, 23, 42, 0.04);
  --docs-surface-hover: rgba(15, 23, 42, 0.06);
  --docs-border: rgba(15, 23, 42, 0.12);
  --docs-text: #0f172a;
  --docs-muted: rgba(15, 23, 42, 0.72);
  --docs-shadow: 0 12px 32px rgba(15, 23, 42, 0.10);
  --docs-code-bg: rgba(15, 23, 42, 0.06);
}

body {
  padding-top: 72px; /* fixed topbar spacing */
}

body.light-theme {
  color-scheme: light;
  line-height: 1.6;
  background-color: #f7f9fc; /* Soft blue-gray background */
  color: #2d3436; /* Dark gray text for better readability */
}

body.dark-theme {
  color-scheme: dark;
  line-height: 1.6;
  background-color: var(--dark-bg);
  color: var(--light-bg);

  --docs-surface: rgba(0, 0, 0, 0.18);
  --docs-surface-2: rgba(255, 255, 255, 0.06);
  --docs-surface-hover: rgba(255, 255, 255, 0.10);
  --docs-border: rgba(255, 255, 255, 0.12);
  --docs-text: var(--light-bg);
  --docs-muted: rgba(255, 255, 255, 0.72);
  --docs-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --docs-code-bg: rgba(0, 0, 0, 0.35);
}

header {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  background-color: #ffffff; /* White background for the header */
  border-bottom: 1px solid #dfe6e9;
}

.navbar-brand {
  font-weight: bold;
  font-size: 1.5rem;
  color: #0984e3;
}

.navbar-docs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.docs-topbar {
  background: rgba(255, 255, 255, 0.86) !important;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-docs .navbar-brand {
  margin: 0;
  padding: 0;
  text-decoration: none;
}

.docs-brand {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.35rem;
  border-radius: 12px;
  transition: background-color 0.2s ease;
}

.docs-brand:hover {
  background: rgba(15, 23, 42, 0.06);
}

.brand-logo {
  display: block;
  height: 52px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}

.docs-icon-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.6);
  color: #0f172a;
}

.docs-icon-btn i,
.docs-action-btn i {
  font-size: 1.1rem;
}

.docs-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.6);
  color: #0f172a;
  padding: 0.5rem 0.75rem;
}

.docs-action-btn:hover,
.docs-icon-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(15, 23, 42, 0.18);
  color: #0f172a;
}

.docs-action-btn:focus,
.docs-icon-btn:focus {
  box-shadow: none;
}

.docs-dropdown {
  min-width: 12rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

.docs-dropdown .dropdown-item {
  border-radius: 10px;
}

.docs-action-btn.dropdown-toggle::after {
  margin-left: 0.35rem;
}

/* Offcanvas (mobile navigation) */
.offcanvas.offcanvas-start {
  width: min(78vw, 280px) !important;
  border-right: 1px solid rgba(15, 23, 42, 0.10);
  border-top-right-radius: 16px;
  border-bottom-right-radius: 16px;
  overflow: hidden;
}

.offcanvas-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e5e7eb;
}

.offcanvas-header .brand-logo {
  width: auto;
  max-width: 170px;
  height: 32px;
}

.offcanvas-body {
  overflow-y: auto;
  overscroll-behavior: contain;
}

.offcanvas-title {
  font-weight: 600;
}

.response-exemples {
  margin: 3em 0 4em 0;
}

/* Response example tabs */
.response-exemples .nav-tabs {
  border-bottom: 0;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.response-exemples .nav-link {
  border: 1px solid var(--docs-border) !important;
  color: var(--docs-text) !important;
  border-radius: 12px !important;
  padding: 0.55rem 0.75rem !important;
  font-size: 0.9rem;
  font-weight: 650;
}

.response-exemples .nav-link:hover {
  background: var(--docs-surface-hover) !important;
}

.response-exemples .nav-link.active {
  background: var(--docs-code-bg) !important;
  border-color: rgba(20, 196, 255, 0.40) !important;
}

.response-exemples .nav-link.all-200.active {
  border-color: rgba(25, 135, 84, 0.50) !important;
}

.response-exemples .nav-link.all-400.active {
  border-color: rgba(220, 53, 69, 0.50) !important;
}

.response-exemples .tab-content pre {
  border-radius: 16px;
  overflow: hidden;
}

.bi {
  transition: transform 0.3s ease-in-out;
}

.selectBox {
  user-select: all;
}

.response-samples {
  margin: 0 0 0.75rem 0;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--docs-text);
  border-bottom: 1px solid var(--docs-border);
  padding-bottom: 0.5rem;
}

.response-schema {
  margin: 1.25rem 0 0 0;
  padding: 1rem 1rem 1.25rem;
  border-radius: 16px;
  border: 1px solid var(--docs-border);
  background: var(--docs-surface);
  box-shadow: var(--docs-shadow);
}

.response-schema hr {
  margin: 0.6rem 0 0.85rem !important;
  opacity: 0.14;
}

.response-schema .disabled {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--docs-muted);
}

.nav-link {
  transition: color 0.3s ease;
}

.pass:hover {
  color: #00cec9;
}

main {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.docs-main {
  margin-top: 2rem;
  margin-bottom: 4rem;
}

h1, h2, h3, h4, h5 {
  font-weight: bold;
  color: #2d3436; /* Dark gray for headings */
}

pre {
  margin: 0;
  position: relative;
  border-radius: 5px;
  overflow-x: auto;
  border-radius: 2.2em;
}

.card-body {
  padding: 0;
}

.link {
  border: 1px solid #333333bd;
  margin: -6px -10px -5px -12px;
  padding-left: 15px;
}

.select-box {
  cursor: pointer;
}

.copy-button {
  position: absolute;
  top: 9px;
  right: 20px;
  background-color: #007bff;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 3px;
  cursor: pointer;
}

.copy-button:hover {
  background-color: #0056b3;
}

ul {
  padding-left: 1.5rem;
}

footer {
  background: rgba(0, 0, 0, 0.8)!important;
  padding: 2em 0;
  text-align: center;
  margin-top: 4em;
}

footer a {
  color: #fff;
  text-decoration: none;
  margin: 0 0.5em;
}

footer a:hover {
  color: var(--primary-color);
}

/* Estilo personalizado para o scrollbar */
.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: #272727;
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

/* Estilo para o modal */
.modal-content {
  border-radius: 12px;
}

.modal-header {
  background-color: #000;
  border-bottom: 1px solid #0f0f0f!important;
  color: #0dcaf0;
}

.modal-body {
  background-color: #000;
  color: #fff;
  max-height: 60vh;
  overflow-y: auto;
}

.modal-footer {
  background-color: #000!important;
  border-top: 1px solid #0f0f0f!important;
}

/* Nested navigation lives inside the offcanvas */
.nested-nav {
  width: 100%;
  max-width: 100%;
  height: auto;
  padding: 0;
  position: static;
}

.nested-link {
  color: #374151;
  font-weight: 500;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nested-link:hover {
  background: var(--hover-bg);
  color: var(--primary-color)!important;
  transform: translateX(4px);
}

.nested-link.active {
  background: var(--active-bg);
  color: var(--primary-color)!important;
  font-weight: 600;
}

.nested-link.sublink {
  padding-left: 2.5rem;
  font-size: 0.9em;
  color: #4b5563;
  position: relative;
}

.nested-link.sublink::before {
  content: "";
  position: absolute;
  left: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: #d1d5db;
  border-radius: 50%;
}

.nested-link[data-bs-toggle="collapse"]::after {
  content: "\F282";
  font-family: "bootstrap-icons";
  font-size: 0.8em;
  margin-left: auto;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nested-link[data-bs-toggle="collapse"][aria-expanded="true"]::after {
  transform: rotate(180deg);
  color: var(--primary-color);
}

.offcanvas-body,
.offcanvas-body_nested {
  margin: 0;
}

.offcanvas-body_nested {
  padding: 1rem;
}

.offcanvas {
  margin: 0;
}

.dropdown_nested {
  margin: 0;
}

@media (min-width: 992px) {
  /* Desktop: keep the drawer aligned to the viewport (avoid negative margins that crop the header/logo) */
  .offcanvas {
    margin: 0 !important;
  }
}

.theme-select {
  margin-top: 35px;
}

.theme-select-lg {
  margin-left: 40px;
  margin-right: 50px;
}

.lang-select {
  border: solid 1px var(--primary-color);
  border-radius: 10px;
  color: #000!important;
}

/* Buttons and links */
.btn {
  font-size: 1rem;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.docs-topbar .docs-icon-btn {
  padding: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.docs-topbar .docs-action-btn {
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
}

.btn-primary {
  background-color: #00cec9; /* Calm teal for buttons */
  border: none;
  color: #ffffff;
}

.btn-primary:hover {
  background-color: #0984e3; /* Darker teal on hover */
}

.router-get {
  margin-left: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-weight: 600;
  color: var(--docs-muted);
  word-break: break-word;
}

/* Request example accordion */
.docs-main .accordion {
  margin: 0.75rem 0 1rem;
  border: 1px solid var(--docs-border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--docs-surface);
  box-shadow: var(--docs-shadow);
}

.docs-main .accordion-item {
  border: 0;
  background: transparent;
}

.docs-main .accordion-button {
  background: var(--docs-surface-2) !important;
  color: var(--docs-text) !important;
  border: 0;
  box-shadow: none;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.docs-main .accordion-button:hover {
  background: var(--docs-surface-hover) !important;
}

.docs-main .accordion-button:focus {
  box-shadow: none;
}

.docs-main .accordion-button::after {
  filter: none;
  opacity: 0.6;
}

.docs-main .accordion-button:not(.collapsed)::after {
  opacity: 1;
}

.docs-main .accordion-collapse {
  border-top: 1px solid var(--docs-border);
}

.docs-main .accordion-collapse.collapsing {
  opacity: 0.75;
}

.docs-main .accordion-body {
  padding: 0.85rem 1rem 1rem;
}

.docs-main .accordion-body.selectBox {
  cursor: text;
}

.docs-main .accordion-body .link {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--docs-border);
  background: var(--docs-code-bg);
  color: var(--docs-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.925rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.navbar-fixed {
  display: flex;
  flex-wrap: nowrap;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1030;
  box-shadow: none;
}

/* Response schema toggles */
.response-schema .d-inline-flex {
  flex-wrap: wrap;
  gap: 0.5rem !important;
  margin: 0;
}

.toggleButton {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 12px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 650;
  border: 1px solid transparent;
  box-shadow: none !important;
}

.toggleButton .bi {
  transition: transform 0.18s ease;
}

.toggleButton[aria-expanded="true"] .bi {
  transform: rotate(90deg);
}

.response-schema .collapse {
  margin-top: 0.85rem;
}

.response-schema .card {
  border-radius: 14px;
  border: 1px solid var(--docs-border);
  background: var(--docs-surface-2);
}

.architecture-container {
  margin-top: 1rem;
}

.architecture-list {
  list-style: none;
  padding-left: 0;
}

.level-1, .level-2, .level-3 {
  position: relative;
  padding-left: 1.5rem;
  margin: 0.5rem 0;
}

.level-1::before,
.level-2::before,
.level-3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 10px;
  height: 100%;
  border-left: 1px solid #ccc;
}

.level-1::after,
.level-2::after,
.level-3::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 10px;
  height: 1px;
  border-bottom: 1px solid #ccc;
}

.level-1:last-child::before,
.level-2:last-child::before,
.level-3:last-child::before {
  height: 0.7em;
}

.property-name {
  font-weight: 600;
  color: #2c3e50;
}

.type-array,
.type-object,
.type-string {
  font-style: italic;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-left: 0.5rem;
}

.type-array {
  color: #27ae60;
  background-color: #e8f6ef;
}

.type-object {
  color: #8e44ad;
  background-color: #f5eef8;
}

.type-string {
  color: #c0392b;
  background-color: #fdedec;
}

.card-body {
  padding: 1rem;
}

.card {
  border: 1px solid #e5e5e5;
  border-radius: 8px;
}

.collapse {
  margin-top: 1rem;
}

.list {
  font-size: 2em;
  font-weight: bold;
}

.btn-group {
  display: block;
}

.response-schema .d-inline-flex {
  flex-wrap: wrap;
}

@media (max-width: 991.98px) {
  /* Make the offcanvas feel like a drawer/card instead of a full-height sheet */
  .offcanvas.offcanvas-start {
    height: auto;
    top: 0.75rem;
    bottom: 0.75rem;
    max-height: calc(100vh - 1.5rem);
    /* iOS safe-area fallback; supported browsers will use this value */
    top: calc(0.75rem + env(safe-area-inset-top));
    bottom: calc(0.75rem + env(safe-area-inset-bottom));
    max-height: calc(100vh - 1.5rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    border-radius: 16px;
  }

  .offcanvas-header {
    padding: 0.85rem 1rem;
  }

  .offcanvas-body {
    padding: 0.75rem 1rem 1rem;
  }

  .nested-link {
    padding: 0.65rem 0.9rem;
    white-space: normal;
  }

  .nested-link.sublink {
    padding-left: 2.25rem;
  }

  .nested-link.sublink::before {
    left: 1.25rem;
  }
}

@media (max-width: 991.98px) {
  .theme-select-lg {
    margin-left: 0;
    margin-right: 0;
  }
}

@media (max-width: 576px) {
  .brand-logo {
    height: 44px;
    max-width: 115px;
  }

  .docs-topbar .docs-icon-btn {
    width: 40px;
    height: 40px;
  }

  .docs-topbar .docs-action-btn {
    padding: 0.45rem 0.6rem;
  }

  .list {
    font-size: 1.6em;
  }

  .accordion-button {
    white-space: normal;
    align-items: flex-start;
  }

  .router-get {
    margin-left: 0.5rem;
    word-break: break-word;
  }

  .all-400,
  .all-200 {
    margin-left: 0 !important;
  }

  .response-exemples .nav-tabs {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .response-exemples .nav-link {
    width: 100%;
  }

  .link {
    margin: 0;
  }
}

/* Responsividade */
@media (max-width: 768px) {
  h1 {
      font-size: 25px;
      margin-top: 25px;
  }

  .response-schema {
      padding: 1rem;
  }

  .response-samples {
      font-size: 1rem;
  }
}

/* Estilo dos cards */
.card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin: 1rem 0;
}

.image-example {
  list-style: none;
  margin: 0 0 1.5rem 0;
  padding: 0;
}

.image-example pre {
  margin-top: 0.75rem;
}

.card-image {
  flex: 1 1 260px;
  max-width: 320px;
  width: 100%;
  aspect-ratio: 3 / 2;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  margin: 0;
  display: block;
}

/* Imagem de fundo dos cards */
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Garantir que a imagem cubra o espaço */
  transition: transform 0.3s ease; /* Efeito de zoom suave */
}

/* Overlay escuro ao passar o mouse */
.card-image::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5); /* Overlay escuro */
  opacity: 0; /* Inicialmente invisível */
  transition: opacity 0.3s ease; /* Transição suave */
}

/* Texto que aparece ao passar o mouse */
.card-image .card-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 1.5rem;
  font-weight: bold;
  opacity: 0; /* Inicialmente invisível */
  transition: opacity 0.3s ease; /* Transição suave */
  z-index: 2; /* Garantir que o texto fique acima do overlay */
}

/* Efeito ao passar o mouse */
.card-image:hover::after {
  opacity: 1; /* Mostrar overlay */
}

.card-image:hover .card-text {
  opacity: 1; /* Mostrar texto */
}

.card-image:hover img {
  transform: scale(1.1); /* Zoom na imagem */
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .nav-link {
      margin-right: 0;
      margin-bottom: 0.5rem;
  }

  header .navbar-collapse {
      text-align: center;
  }

  pre {
      font-size: 0.875rem;
  }
}

/* =========================
   Dark theme overrides
   ========================= */

body.dark-theme header {
  background-color: var(--dark-bg);
  border-bottom: 1px solid var(--dark-border);
}

body.dark-theme .docs-topbar {
  background: rgba(12, 18, 30, 0.86) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body.dark-theme .docs-brand:hover {
  background: rgba(255, 255, 255, 0.08);
}

body.dark-theme .docs-main .accordion-button::after {
  filter: invert(1);
  opacity: 0.75;
}

body.dark-theme .docs-icon-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.2);
  color: var(--light-bg);
}

body.dark-theme .docs-action-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.2);
  color: var(--light-bg);
}

body.dark-theme .docs-action-btn:hover,
body.dark-theme .docs-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--light-bg);
}

body.dark-theme .docs-dropdown {
  background: var(--dark-bg);
  border: 1px solid var(--dark-border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

body.dark-theme .docs-dropdown .dropdown-item {
  color: var(--light-bg);
}

body.dark-theme .docs-dropdown .dropdown-item:hover {
  background: var(--hover-bg);
  color: var(--primary-color);
}

body.dark-theme .offcanvas-header {
  border-bottom: 1px solid var(--dark-border);
}

body.dark-theme .offcanvas {
  background: linear-gradient(145deg, var(--dark-bg) 0%, var(--dark-border) 100%);
}

body.dark-theme .offcanvas .btn-close {
  filter: invert(1);
}

body.dark-theme h1,
body.dark-theme h2,
body.dark-theme h3,
body.dark-theme h4,
body.dark-theme h5 {
  color: #0984e3;
}

body.dark-theme .link {
  border: 1px solid var(--bs-blue);
  color: var(--light-bg);
  border-radius: 10px;
}

body.dark-theme footer {
  background: var(--dark-bg)!important;
  box-shadow: -5px -5px 6px rgb(87 87 87 / 20%);
}

body.dark-theme footer a {
  color: var(--light-bg);
}

body.dark-theme .offcanvas.offcanvas-start {
  border-right-color: var(--dark-border);
}

body.dark-theme .nested-link {
  color: var(--bs-blue);
}

body.dark-theme .nested-link.sublink {
  color: #0a67eb;
}

body.dark-theme .nested-link.sublink::before {
  background: var(--dark-bg);
}

body.dark-theme .collapse-nested {
  background: none!important;
}

body.dark-theme .lang-select {
  color: var(--primary-color)!important;
}

body.dark-theme .lang-select:hover {
  background: var(--primary-color);
  color: var(--dark-bg)!important;
}

body.dark-theme .theme-select-box {
  background: var(--dark-bg);
  color: var(--primary-color);
}

body.dark-theme .theme-select-text {
  color: var(--primary-color);
  border-radius: 10px;
}

body.dark-theme .theme-select-text:hover {
  color: var(--primary-color);
  background: var(--hover-bg);
}

body.dark-theme .btn-primary {
  color: var(--dark-bg);
}

body.dark-theme .level-1::before,
body.dark-theme .level-2::before,
body.dark-theme .level-3::before,
body.dark-theme .level-1::after,
body.dark-theme .level-2::after,
body.dark-theme .level-3::after {
  border-color: var(--dark-border);
}

body.dark-theme .list {
  color: #0984e3;
}
