/* API Playground Builder Styles */
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; line-height: 1.6; color: #1a1a1a; background: #fafafa; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

header { background: #fff; border-bottom: 1px solid #e5e5e5; position: sticky; top: 0; z-index: 10; }
header .container { display: flex; justify-content: space-between; align-items: center; padding: 1rem 0; }
header h1 { font-size: 1.5rem; font-weight: 600; margin: 0; }
nav a { margin-left: 1.5rem; font-size: 0.9rem; }

.hero { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; padding: 3rem 0 2rem; text-align: center; }
.hero h2 { font-size: 2rem; margin-bottom: 1rem; }
.hero p { font-size: 1.1rem; margin-bottom: 1.5rem; opacity: 0.95; }
.primary-btn { background: #fff; color: #667eea; border: none; padding: 0.75rem 1.5rem; font-size: 1rem; border-radius: 6px; cursor: pointer; font-weight: 500; }
.primary-btn:hover { background: #f0f0f0; }

.playground-layout { display: grid; grid-template-columns: 280px 1fr; gap: 2rem; padding: 2rem 0; }
.sidebar { background: #fff; border: 1px solid #e5e5e5; border-radius: 8px; padding: 1.5rem; height: fit-content; }
.sidebar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.sidebar-header h3 { font-size: 1rem; margin: 0; color: #333; }
#addProject { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #2563eb; }
.project-list, .template-list { list-style: none; padding: 0; margin: 0.5rem 0; }
.project-item, .template-item { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem; border-radius: 4px; cursor: pointer; }
.project-item:hover { background: #f5f5f5; }
.project-item.active { background: #eef2ff; font-weight: 500; }
.delete-project, .edit-template { background: none; border: none; color: #666; cursor: pointer; font-size: 1rem; opacity: 0; padding: 0 4px; }
.project-item:hover .delete-project, .project-item:hover .edit-template { opacity: 1; }

.templates-section h4 { font-size: 0.9rem; margin: 1rem 0 0.5rem; color: #666; }
.template-item { font-size: 0.9rem; }

.main-content { display: flex; flex-direction: column; gap: 1rem; }
.request-builder { background: #fff; border: 1px solid #e5e5e5; border-radius: 8px; padding: 1.5rem; }
.request-header { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 1rem; }
#methodSelect { padding: 0.5rem; border: 1px solid #d1d5db; border-radius: 4px; background: #fff; }
#urlInput { flex: 1; padding: 0.5rem; border: 1px solid #d1d5db; border-radius: 4px; font-size: 0.9rem; }
#saveRequest { background: #f3f4f6; border: 1px solid #d1d5db; border-radius: 4px; cursor: pointer; }

.request-body { display: flex; flex-direction: column; gap: 1rem; }
.section-group h4 { font-size: 0.9rem; margin: 0 0 0.5rem; color: #666; }
.key-value-group { display: flex; flex-direction: column; gap: 0.5rem; }
.kv-pair { display: flex; gap: 0.5rem; }
.kv-pair input { flex: 1; padding: 0.4rem; border: 1px solid #d1d5db; border-radius: 4px; font-size: 0.85rem; }
#addHeader { background: #f3f4f6; border: 1px solid #d1d5db; border-radius: 4px; padding: 0.3rem 0.7rem; cursor: pointer; font-size: 0.85rem; }
.textarea-wrapper { position: relative; }
#bodyInput { width: 100%; min-height: 120px; padding: 0.75rem; border: 1px solid #d1d5db; border-radius: 6px; font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace; font-size: 0.9rem; resize: vertical; background: #fafafa; }
#bodyInput:focus { outline: 2px solid #667eea; border-color: #667eea; background: #fff; }

.request-actions { display: flex; gap: 0.75rem; margin-top: 1rem; }
.small-btn { background: #f3f4f6; border: 1px solid #d1d5db; border-radius: 4px; padding: 0.3rem 0.7rem; cursor: pointer; font-size: 0.85rem; }
.secondary-btn { background: #f3f4f6; border: 1px solid #d1d5db; border-radius: 6px; padding: 0.5rem 1rem; cursor: pointer; }
.secondary-btn:hover { background: #e5e5e5; }

.response-panel { background: #fff; border: 1px solid #e5e5e5; border-radius: 8px; padding: 1.5rem; flex: 1; min-height: 300px; }
.response-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 0.75rem; border-bottom: 1px solid #f0f0f0; margin-bottom: 1rem; }
#responseStatus { font-size: 0.85rem; color: #666; }
.response-content { font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace; font-size: 0.85rem; background: #fafafa; padding: 1rem; border-radius: 4px; overflow-x: auto; max-height: 400px; }
.empty-state { text-align: center; color: #666; }
.empty-state p { margin: 0.5rem 0; }
.hint { font-size: 0.85rem; opacity: 0.7; }

.usage-guide, .examples, .tips { padding: 2rem 0; }
.usage-guide h2, .examples h2, .tips h2 { font-size: 1.75rem; margin-bottom: 1.5rem; color: #1a1a1a; }
.caveats-block { background: #fff0f0; border-left: 4px solid #dc2626; padding: 1rem; border-radius: 0 4px 4px 0; margin: 1.5rem 0; }
.caveats-block h4 { margin-top: 0; color: #991b1b; }
.caveats-block ul { margin: 0.5rem 0 0; padding-left: 1.2rem; }

.example-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }
.example-card { background: #f9fafb; border: 1px solid #e5e5e5; border-radius: 8px; padding: 1.25rem; }
.example-card h4 { font-size: 1rem; margin: 0 0 0.5rem; color: #1a1a1a; }
.example-card p { font-size: 0.85rem; color: #666; margin: 0; }

.tips-list { list-style: none; padding: 0; }
.tips-list li { padding: 0.75rem 0; border-bottom: 1px solid #f0f0f0; display: flex; align-items: flex-start; gap: 0.75rem; }
.tips-list li:last-child { border-bottom: none; }
.tips-list strong { color: #1a1a1a; }

footer { background: #fff; border-top: 1px solid #e5e5e5; padding: 1rem 0; margin-top: 2rem; font-size: 0.9rem; }
footer a { color: #666; }

@media (max-width: 768px) {
  .playground-layout { grid-template-columns: 1fr; }
  .sidebar { position: relative; z-index: 5; margin-bottom: 1rem; }
  .hero h2 { font-size: 1.5rem; }
  header .container { flex-direction: column; gap: 1rem; }
  nav a { margin-left: 0; margin-right: 1rem; }
}
@media (max-width: 480px) {
  .request-header { flex-direction: column; gap: 0.5rem; }
  .request-actions { flex-direction: column; }
  .example-grid { grid-template-columns: 1fr; }
}


/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
