/* CNE Trialer — custom styles (Tailwind handles most via CDN) */

/* ── Spinner ──────────────────────────────────────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid #e5e7eb;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-sm {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  border: 2px solid #d1d5db;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}

/* ── Form inputs ──────────────────────────────────────────────────────────── */
.input-field {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.5rem;
  color: #111827;
  background-color: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.input-field:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.input-field::placeholder {
  color: #9ca3af;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.25rem;
  background-color: #6366f1;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s;
}
.btn-primary:hover:not(:disabled) { background-color: #4f46e5; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.75rem;
  background-color: #f9fafb;
  color: #374151;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 0.375rem;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  transition: background-color 0.15s;
}
.btn-secondary:hover { background-color: #f3f4f6; }

.btn-download {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  background-color: #eff6ff;
  color: #3b82f6;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 0.375rem;
  border: 1px solid #bfdbfe;
  cursor: pointer;
  transition: background-color 0.15s;
  white-space: nowrap;
}
.btn-download:hover:not(:disabled) { background-color: #dbeafe; }
.btn-download:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-delete-asset {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  background-color: #fff1f2;
  color: #e11d48;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 0.375rem;
  border: 1px solid #fecdd3;
  cursor: pointer;
  transition: background-color 0.15s;
  white-space: nowrap;
}
.btn-delete-asset:hover:not(:disabled) { background-color: #ffe4e6; }
.btn-delete-asset:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-view-key {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  background-color: #f5f3ff;
  color: #7c3aed;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 0.375rem;
  border: 1px solid #ddd6fe;
  cursor: pointer;
  transition: background-color 0.15s;
  white-space: nowrap;
}
.btn-view-key:hover { background-color: #ede9fe; }

/* ── Tab bar ──────────────────────────────────────────────────────────────── */
.tab-btn {
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  border-bottom: 2px solid transparent;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.tab-btn:hover { color: #374151; }
.tab-btn.active {
  color: #6366f1;
  border-bottom-color: #6366f1;
}

/* ── File tree ────────────────────────────────────────────────────────────── */
.file-tree {
  font-size: 0.875rem;
}

.tree-dir {
  border-bottom: 1px solid #f3f4f6;
}
.tree-dir:last-child { border-bottom: none; }

.tree-dir-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  cursor: pointer;
  user-select: none;
  background-color: #f9fafb;
  list-style: none;
}
.tree-dir-label::-webkit-details-marker { display: none; }
.tree-dir-label:hover { background-color: #f3f4f6; }

.tree-icon {
  display: inline-block;
  font-size: 0.6rem;
  color: #9ca3af;
  transition: transform 0.15s;
  width: 0.75rem;
}
details[open] > summary .tree-icon { transform: rotate(90deg); }

.tree-folder-icon { font-size: 0.9rem; }

.tree-children {
  padding-left: 1.5rem;
  border-left: 2px solid #f3f4f6;
  margin-left: 1.75rem;
}

.tree-file-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #f9fafb;
}
.tree-file-row:last-child { border-bottom: none; }
.tree-file-row:hover { background-color: #fafafa; }

.tree-file-icon { font-size: 0.85rem; shrink: 0; }

/* ── Scrollbar (file tree area) ───────────────────────────────────────────── */
.file-tree::-webkit-scrollbar { width: 6px; }
.file-tree::-webkit-scrollbar-track { background: #f9fafb; }
.file-tree::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

/* ── Documentation tab ────────────────────────────────────────────────────── */

.doc-section {
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  overflow: hidden;
}

.doc-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  background-color: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  padding: 0.6rem 1.25rem;
}

.doc-endpoint {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f3f4f6;
}
.doc-endpoint:last-child { border-bottom: none; }

.doc-endpoint-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}
.doc-endpoint-header code {
  font-size: 0.85rem;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  color: #111827;
}

.doc-auth-badge {
  font-size: 0.7rem;
  font-weight: 500;
  color: #92400e;
  background-color: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
}

.doc-p {
  font-size: 0.875rem;
  color: #4b5563;
  margin-bottom: 0.6rem;
  line-height: 1.6;
}
.doc-p:last-child { margin-bottom: 0; }

.doc-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
  margin-top: 0.75rem;
  margin-bottom: 0.3rem;
}

.doc-pre {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  color: #1f2937;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  margin-bottom: 0.5rem;
}

.doc-code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.8em;
  color: #4f46e5;
  background-color: #eef2ff;
  border-radius: 0.25rem;
  padding: 0.1em 0.35em;
}

.doc-table {
  width: 100%;
  font-size: 0.825rem;
  border-collapse: collapse;
  margin-bottom: 0.5rem;
}
.doc-table thead tr {
  background-color: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}
.doc-table th {
  text-align: left;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  padding: 0.4rem 0.75rem;
}
.doc-table td {
  padding: 0.45rem 0.75rem;
  color: #374151;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: top;
}
.doc-table tr:last-child td { border-bottom: none; }
.doc-table tbody tr:hover { background-color: #fafafa; }

/* HTTP method badges */
.method-get, .method-post, .method-delete {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 0.3rem;
  padding: 0.15rem 0.5rem;
  min-width: 3.5rem;
  justify-content: center;
}
.method-get    { background-color: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.method-post   { background-color: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }
.method-delete { background-color: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
