/* API 測試器樣式 */
.api-tester {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 24px;
  margin: 32px 0;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  color: #fff;
}

.api-tester-header {
  text-align: center;
  margin-bottom: 24px;
}

.api-tester-header h3 {
  font-size: 1.5rem;
  margin: 0 0 8px 0;
  font-weight: 700;
}

.api-tester-header p {
  margin: 0;
  opacity: 0.9;
  font-size: 0.95rem;
}

.api-tester-body {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 20px;
}

.api-params {
  display: grid;
  gap: 16px;
  margin-bottom: 20px;
}

.param-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.param-group label {
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.param-group .required {
  color: #ff6b6b;
  font-size: 1.1rem;
}

.param-group input,
.param-group select {
  padding: 12px 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.param-group input:focus,
.param-group select:focus {
  outline: none;
  border-color: #fff;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.param-group small {
  font-size: 0.85rem;
  opacity: 0.8;
  margin-top: -4px;
}

.api-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.api-btn {
  flex: 1;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.api-btn-primary {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
}

.api-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.api-btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.api-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.3);
}

.api-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.api-request-preview,
.api-response {
  margin-top: 20px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.api-request-preview h4,
.api-response h4 {
  margin: 0 0 12px 0;
  font-size: 1.1rem;
}

.code-block {
  background: #1e1e1e;
  border-radius: 8px;
  overflow: hidden;
}

.code-header {
  background: #2d2d2d;
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #3d3d3d;
}

.code-header span {
  font-size: 0.85rem;
  color: #aaa;
  font-weight: 600;
}

.copy-btn {
  background: #4CAF50;
  color: white;
  border: none;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.copy-btn:hover {
  background: #45a049;
}

.code-block pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
}

.code-block code {
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #d4d4d4;
}

.response-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-weight: 600;
}

.response-status.success {
  background: rgba(76, 175, 80, 0.2);
  border: 2px solid #4CAF50;
}

.response-status.error {
  background: rgba(244, 67, 54, 0.2);
  border: 2px solid #f44336;
}

.response-status .status-code {
  font-size: 1.2rem;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.api-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 40px;
  animation: fadeIn 0.3s ease;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.api-loading p {
  margin: 0;
  font-size: 1rem;
  opacity: 0.9;
}

/* 響應式設計 */
@media (max-width: 768px) {
  .api-tester {
    padding: 16px;
  }

  .api-actions {
    flex-direction: column;
  }

  .api-btn {
    width: 100%;
  }
}
