/* Reporting — match cse135project.online color scheme and cgi-bin panel layout */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #1e293b;
  background-color: #f1f5f9;
  line-height: 1.6;
}

a {
  color: #2563eb;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* Navbar — same as main site */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: #b3d9ff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.nav-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-title {
  font-weight: 600;
  color: #2563eb;
  white-space: nowrap;
}

/* Hero — same as main site */
.hero {
  min-height: 28vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 24px 32px;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.hero-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
  color: #2563eb;
}

.hero-sub {
  text-align: center;
  margin: 8px 0 0;
  font-size: 1rem;
  color: #64748b;
}

/* Content + split panel (cgi-bin style) */
.content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  padding-bottom: 60px;
}

.content h2 {
  margin: 0 0 8px;
  color: #2563eb;
  font-size: 1.35rem;
  font-weight: 700;
}

.content .resource-uri {
  margin: 0 0 20px;
  font-size: 0.9rem;
  color: #64748b;
}

.content .resource-uri code {
  background: #e2e8f0;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}

/* Editor container — two panels like cgi-bin */
.editor-container {
  display: flex;
  gap: 24px;
  margin-top: 16px;
}

.panel {
  flex: 1;
  border-radius: 12px;
  padding: 24px;
  min-width: 0;
}

.left-panel {
  background: #ffffff;
  border: 2px solid #60a5fa;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.right-panel {
  background: #ffffff;
  border: 2px solid #7c3aed;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.panel-header {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 10px;
  color: #1e293b;
}

.left-panel .panel-header {
  border-bottom: 2px solid #60a5fa;
  color: #2563eb;
}

.right-panel .panel-header {
  border-bottom: 2px solid #7c3aed;
  color: #6d28d9;
}

/* Forms — main site card style */
.api-forms {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.api-forms fieldset {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px 20px;
  margin: 0;
  background: #f8fafc;
}

.api-forms legend {
  font-weight: 600;
  color: #2563eb;
  padding: 0 8px;
}

.api-forms label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #334155;
  font-size: 0.9rem;
}

.api-forms input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.95rem;
  margin-bottom: 12px;
  background: #fff;
}

.api-forms input[type="text"]:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.api-forms p {
  margin: 0 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.api-forms p label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  cursor: pointer;
}

.api-forms input[type="radio"] {
  margin: 0;
}

.api-forms .field-hint {
  margin: -6px 0 12px;
  font-size: 0.8rem;
  color: #64748b;
  font-weight: normal;
}

.api-forms button {
  padding: 10px 20px;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.api-forms button:hover {
  background: #1d4ed8;
}

/* Response display — cgi-bin style */
#api-display {
  min-height: 240px;
  padding: 16px;
  background: #faf5ff;
  border: 1px solid #c4b5fd;
  border-radius: 8px;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  overflow: auto;
  max-height: 70vh;
}

#api-display .placeholder {
  color: #94a3b8;
  font-style: italic;
}

#api-display .status-line {
  margin-bottom: 12px;
  padding: 8px 12px;
  background: #e2e8f0;
  border-radius: 6px;
  font-weight: 600;
  color: #1e293b;
}

#api-display .status-line.ok {
  background: #d1fae5;
  color: #065f46;
}

#api-display .status-line.err {
  background: #fee2e2;
  color: #991b1b;
}

#api-display .json-block {
  margin: 0;
  color: #334155;
}

/* When JS enabled, optional: hide duplicate static forms note */
body.js-enabled .noscript-warning {
  display: none;
}

.noscript-warning {
  margin-top: 16px;
  padding: 12px;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 6px;
  color: #92400e;
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
  .editor-container {
    flex-direction: column;
  }

  .hero-title {
    font-size: 1.5rem;
  }
}
