.agent-history-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.agent-history-widget .theia-select-component {
  margin: 10px 0;
  width: 80%;
}

.agent-history {
  width: calc(80% + 16px);
  display: flex;
  align-items: center;
  flex-direction: column;
}

.theia-card {
  background-color: var(--theia-sideBar-background);
  border: 1px solid var(--theia-sideBarSectionHeader-border);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  padding: 15px;
  margin: 10px 0;
  width: 100%;
  box-sizing: border-box;
}

.theia-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.9em;
  padding: var(--theia-ui-padding) 0;
}

.theia-card-content {
  color: var(--theia-font-color);
  margin-bottom: 10px;
}

.theia-card-content h3 {
  font-size: var(--theia-ui-font-size1);
  font-weight: bold;
}

.theia-card-content pre {
  border-radius: 4px;
  border: 1px solid var(--theia-sideBarSectionHeader-border);
  background-color: var(--theia-terminal-background);
  overflow: visible;
  padding: 10px;
  margin: 5px 0;
}

.theia-card-request-id,
.theia-card-timestamp {
  flex: 1;
  text-align: left;
}

.exchange-card {
  border-radius: 6px;
  transition: box-shadow 0.3s ease;
}

.requests-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
  overflow: visible;
}

/* Request Card Styles */
.request-card {
  background-color: var(--theia-editor-background);
  border: 1px solid var(--theia-sideBarSectionHeader-border);
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 15px;
  transition: box-shadow 0.3s ease;
}

.request-header {
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--theia-sideBarSectionHeader-border);
}

.request-header h3 {
  margin: 0 0 8px 0;
}

.request-info {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.request-id,
.request-agent,
.request-model,
.request-prompt-variant {
  font-size: 0.9em;
  color: var(--theia-descriptionForeground);
  white-space: nowrap;
  padding: 2px 6px;
  background-color: var(--theia-editor-inactiveSelectionBackground);
  border-radius: 3px;
}

.request-prompt-variant.customized {
  color: var(--theia-editorWarning-foreground);
  background-color: var(--theia-inputValidation-warningBackground);
  border: 1px solid var(--theia-editorWarning-foreground);
}

.request-content-container {
  width: 100%;
  overflow: visible;
}

.request-content-container details {
  margin-bottom: 10px;
  border: 1px solid var(--theia-editorWidget-border);
  border-radius: 4px;
}

.request-content-container summary {
  padding: 8px 12px;
  background-color: var(--theia-editorWidget-background);
  cursor: pointer;
  font-weight: bold;
  display: block; /* Make the entire summary clickable */
}

.request-content-container summary:hover {
  background-color: var(--theia-list-hoverBackground);
}

.request-content,
.response-content {
  padding: 10px;
  overflow: visible;
}

.request-content-container details {
  margin-bottom: 15px;
}

.request-content-container summary {
  padding: 10px 15px;
  font-size: 1em;
  transition: background-color 0.2s ease;
}

.stream-part {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--theia-sideBarSectionHeader-border);
}

.stream-part:last-child {
  border-bottom: none;
}

.compact-response {
  padding: 8px;
  background-color: var(--theia-editor-background);
  border-radius: 4px;
}

.formatted-json {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--theia-ui-font-family-monospace);
  font-size: var(--theia-code-font-size);
  line-height: var(--theia-code-line-height);
  color: var(--theia-editor-foreground);
}

.formatted-json.render-newlines {
  white-space: pre-wrap;
}

.request-content-container summary::before {
  content: '▶';
  display: inline-block;
  margin-right: 8px;
  transition: transform 0.2s;
  font-size: 0.8em;
}

.request-content-container details[open] summary::before {
  transform: rotate(90deg);
}

.theia-card-agent-id {
  flex: 1;
  text-align: right;
  font-weight: bold;
}

.request-card.different-agent-opacity {
  opacity: 0.7;
}

.request-agent.different-agent-name {
  font-style: italic;
  color: var(--theia-notificationsWarningIcon-foreground);
}

/* Request meta information */
.request-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85em;
  color: var(--theia-descriptionForeground);
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--theia-sideBarSectionHeader-border);
}

.no-content {
  padding: 15px;
  color: var(--theia-descriptionForeground);
  text-align: center;
  font-style: italic;
}

.request-timestamp {
  font-size: 0.85em;
  color: var(--theia-descriptionForeground);
}
