/* Dark mode support */
body[data-jp-theme-light="false"],
body.vscode-dark {
  --primary-color: #111111;
  --secondary-color: #212121;
  --tertiary-color: #cfcdd6;
  --button-color: #111111;
  --text-color: #ffffff;
  --border-color: #444;
  --surface-color: #2e2e2e;
}

body {
  --primary-color: #ffffff;
  --secondary-color: #f5f5f5;
  --tertiary-color: #000000de;
  --button-color: #d1d5db;
  --text-color: #333;
  --border-color: #ddd;
  --surface-color: #f8f8f8;
}

.model-container {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  margin-bottom: 16px;
  overflow: hidden;
  background-color: var(--primary-color);
  color: var(--text-color);
}

.model-header {
  background-color: var(--secondary-color);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  font-size: 14px;
  color: var(--tertiary-color);
}

.model-content {
  padding: 16px;
}

.model-table {
  width: 100%;
  border-spacing: 0;
  border-collapse: collapse;
}

.model-table td {
  padding: 8px 4px;
  font-size: 14px;
  line-height: 1.5;
  vertical-align: top;
  border-top: 1px solid var(--border-color);
  text-align: left !important;
}

.model-table tr:first-child td {
  border-top: none;
}

/* Override Jupyter's alternating row colors */
.model-table tr {
  background-color: var(--primary-color) !important;
}

.model-table tr:nth-child(odd) {
  background-color: var(--secondary-color) !important;
}

/* Add hover effect */
.model-table tr:hover {
  background-color: var(--surface-color) !important;
}

.field-name {
  font-weight: 600;
  width: 140px;
  color: var(--tertiary-color);
  padding-right: 16px;
}

.field-value {
  word-break: break-all;
  color: var(--text-color);
  max-width: 0;
  width: 100%;
}

.code-section {
  margin-top: 16px;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

/* Style for the details summary (header) */
.code-section details summary {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--tertiary-color);
  cursor: pointer;
  user-select: none;
  list-style: none;
  outline: none;
}

/* Add custom arrow for the summary */
.code-section details summary::before {
  content: "▶";
  display: inline-block;
  margin-right: 8px;
  transition: transform 0.2s;
}

/* Rotate the arrow when details is open */
.code-section details[open] summary::before {
  transform: rotate(90deg);
}

.code-content {
  max-height: 300px;
  overflow-y: auto;
  padding: 12px;
  background-color: var(--surface-color);
  border-radius: 3px;
  border: 1px solid var(--border-color);
  font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  line-height: 1.4;
}

.code-content pre {
  margin: 0;
  background-color: var(--surface-color) !important;
  color: var(--text-color);
}

.path-text {
  word-break: break-all;
  width: 70%;
  overflow-wrap: anywhere;
}

.error-text {
  color: red;
}

.warning-text {
  color: #e67e00;
}
