/* API Integration Block — стили под rab2 (rb-section, тёмная тема) */
.rb-section.api-integration-section {
  padding: 4rem 0;
}

.api-integration-wrapper {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 3rem;
  align-items: center;
}

.api-integration-content {
  padding-right: 1rem;
}

.api-integration-section .api-integration-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.api-integration-section .api-integration-title span {
  color: #635bff;
}

.api-integration-section .api-integration-text {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  opacity: 0.9;
}

.api-integration-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
}

.api-integration-bullets li {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.9375rem;
  margin-bottom: 0.5rem;
}

.api-integration-bullets li svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.api-integration-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  min-width: 160px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.2s;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.api-integration-btn:hover {
  opacity: 0.9;
}

.api-code-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.api-code-window {
  background: #1a1a1a;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  position: relative;
  height: 420px;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.api-code-window-dots {
  position: absolute;
  top: 16px;
  left: 18px;
  display: flex;
  gap: 6px;
  z-index: 2;
}

.api-code-window-dots .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.api-code-window-dots .dot-red {
  background: #ff5f57;
}

.api-code-window-dots .dot-yellow {
  background: #febc2e;
}

.api-code-window-dots .dot-green {
  background: #28c840;
}

.api-code-header {
  padding: 14px 20px 10px 76px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.api-code-lang {
  color: #9ca3af;
  font-size: 13px;
  font-weight: 500;
}

.api-code-copy {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 6px;
  font-size: 16px;
  transition: color 0.2s;
}

.api-code-copy:hover {
  color: #fff;
}

.api-tabs-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px 12px;
}

.api-tabs-label {
  font-size: 13px;
  color: #6b7280;
}

.api-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.api-tab {
  padding: 6px 14px;
  font-size: 12px;
  background: #2d2d2d;
  color: #9ca3af;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.api-tab:hover {
  color: #fff;
  background: #3d3d3d;
}

.api-tab.active {
  background: #635bff;
  color: #fff;
}

.api-code-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overflow-x: hidden;
  padding: 0 20px 20px;
  width: 100%;
  box-sizing: border-box;
}

.api-code-content {
  display: none;
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
  white-space: pre;
  font-family: 'Courier New', Courier, monospace;
  color: #d4d4d4;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.api-code-content code {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: break-word;
  word-wrap: break-word;
  white-space: inherit;
}

.api-code-content.is-active {
  display: block;
}

.api-request-response .api-method {
  color: #60a5fa;
}

.api-request-response .api-path {
  color: #60a5fa;
}

.api-request-response .api-key {
  color: #98c379;
}

.api-request-response .api-str {
  color: #ce9178;
}

.api-request-response .api-num {
  color: #d19a66;
}

.api-code-body::-webkit-scrollbar {
  width: 8px;
}

.api-code-body::-webkit-scrollbar-track {
  background: #2d2d2d;
}

.api-code-body::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 4px;
}

.api-code-body::-webkit-scrollbar-thumb:hover {
  background: #666;
}

@media (max-width: 991px) {
  .api-integration-wrapper {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .api-integration-content {
    padding-right: 0;
    text-align: center;
  }

  .api-integration-bullets {
    text-align: left;
    display: inline-block;
  }

  .api-code-window {
    height: 380px;
  }
}

@media (max-width: 767px) {
  .rb-section.api-integration-section {
    padding: 2.5rem 0;
  }

  .api-integration-section .api-integration-title {
    font-size: 1.5rem;
  }

  .api-code-window {
    height: 360px;
  }

  .api-tabs-row {
    flex-wrap: wrap;
  }
}
