.api-test-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: #5865f2;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-left: 8px;
  vertical-align: middle;
  transition: background 0.2s;
}
.api-test-btn:hover { background: #4752c4; }
.api-test-btn svg { width: 14px; height: 14px; }

/* Modal overlay */
.api-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}
.api-modal-overlay.active { display: flex; }

/* Modal */
.api-modal {
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: 12px;
  width: 720px;
  max-width: 95vw;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.api-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #313244;
}
.api-modal-header h3 {
  margin: 0;
  font-size: 15px;
  color: #cdd6f4;
}
.api-modal-close {
  background: none;
  border: none;
  color: #6c7086;
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
}
.api-modal-close:hover { color: #f38ba8; }

.api-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

/* Method + URL row */
.api-url-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.api-method-badge {
  padding: 8px 14px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  display: flex;
  align-items: center;
  white-space: nowrap;
}
.api-method-badge.GET { background: #40a02b; }
.api-method-badge.POST { background: #df8e1d; }
.api-method-badge.PUT { background: #1e66f5; }
.api-method-badge.DELETE { background: #d20f39; }
.api-method-badge.PATCH { background: #8839ef; }

.api-url-input {
  flex: 1;
  padding: 8px 12px;
  background: #181825;
  border: 1px solid #313244;
  border-radius: 6px;
  color: #cdd6f4;
  font-family: monospace;
  font-size: 13px;
}

/* Tabs */
.api-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #313244;
  margin-bottom: 12px;
}
.api-tab {
  padding: 8px 16px;
  font-size: 13px;
  color: #6c7086;
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.api-tab:hover { color: #cdd6f4; }
.api-tab.active {
  color: #89b4fa;
  border-bottom-color: #89b4fa;
}

.api-tab-content { display: none; }
.api-tab-content.active { display: block; }

/* Headers table */
.api-headers-table {
  width: 100%;
  border-collapse: collapse;
}
.api-headers-table input {
  width: 100%;
  padding: 6px 10px;
  background: #181825;
  border: 1px solid #313244;
  border-radius: 4px;
  color: #cdd6f4;
  font-size: 12px;
  font-family: monospace;
}
.api-headers-table td { padding: 3px; }
.api-add-header {
  background: none;
  border: 1px dashed #313244;
  color: #6c7086;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  margin-top: 8px;
}
.api-add-header:hover { border-color: #89b4fa; color: #89b4fa; }
.api-remove-header {
  background: none;
  border: none;
  color: #6c7086;
  cursor: pointer;
  font-size: 16px;
  padding: 0 6px;
}
.api-remove-header:hover { color: #f38ba8; }

/* Body editor */
.api-body-editor {
  width: 100%;
  min-height: 150px;
  padding: 12px;
  background: #181825;
  border: 1px solid #313244;
  border-radius: 6px;
  color: #a6e3a1;
  font-family: monospace;
  font-size: 13px;
  resize: vertical;
}

/* Send button */
.api-send-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: #5865f2;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
  transition: background 0.2s;
}
.api-send-btn:hover { background: #4752c4; }
.api-send-btn:disabled { background: #45475a; cursor: not-allowed; }
.api-send-btn .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: none;
}
.api-send-btn.loading .spinner { display: block; }
.api-send-btn.loading .btn-text { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* Response */
.api-response {
  margin-top: 16px;
  border-top: 1px solid #313244;
  padding-top: 16px;
  display: none;
}
.api-response.active { display: block; }

.api-response-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 8px;
}
.api-response-status.success { background: #1e3a2f; color: #40a02b; }
.api-response-status.error { background: #3a1e1e; color: #d20f39; }

.api-response-time {
  font-size: 12px;
  color: #6c7086;
  margin-left: 8px;
}

.api-response-body {
  background: #181825;
  border: 1px solid #313244;
  border-radius: 6px;
  padding: 12px;
  font-family: monospace;
  font-size: 13px;
  color: #cdd6f4;
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
