/* ===== DSL Language Guide ===== */

.guide {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  font-size: var(--text-xs);
  line-height: 1.6;
  color: var(--color-text);
}

/* Search */
.searchBox {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
  flex-shrink: 0;
}

.searchInput {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: var(--text-xs);
  color: var(--color-text);
  font-family: inherit;
}

.searchInput::placeholder {
  color: var(--color-text-muted);
}

.searchClear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.searchClear:hover {
  color: var(--color-text);
  background: var(--color-bg-tertiary);
}

/* Sections */
.section {
  border-bottom: 1px solid var(--color-border);
}

.sectionHeader {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  width: 100%;
  padding: 0.625rem 0.75rem;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text);
  text-align: left;
  transition: background var(--transition-fast);
}

.sectionHeader:hover {
  background: var(--color-bg-tertiary);
}

.sectionChevron {
  font-size: 0.625rem;
  color: var(--color-text-muted);
  width: 10px;
  text-align: center;
  flex-shrink: 0;
}

.sectionIcon {
  font-size: 0.75rem;
  flex-shrink: 0;
}

.sectionTitle {
  flex: 1;
}

.sectionBody {
  padding: 0 0.75rem 0.75rem;
}

.hint {
  margin: 0 0 0.5rem;
  color: var(--color-text-secondary);
  font-size: 0.6875rem;
  line-height: 1.5;
}

.hint code {
  background: var(--color-bg-tertiary);
  padding: 0.1rem 0.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.625rem;
}

.hint strong {
  color: var(--color-text);
  font-weight: 600;
}

/* Code blocks */
.codeBlock {
  position: relative;
  margin: 0.5rem 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg-secondary);
}

.codeLabel {
  padding: 0.25rem 0.5rem;
  font-size: 0.5625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  background: var(--color-bg-tertiary);
  border-bottom: 1px solid var(--color-border);
}

.codeContent {
  padding: 0.5rem 0.625rem;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  line-height: 1.5;
  color: var(--color-text);
  white-space: pre-wrap;
  word-break: break-all;
  overflow-x: auto;
  max-height: 300px;
  overflow-y: auto;
}

.insertBtn {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  padding: 0.125rem 0.375rem;
  font-size: 0.5625rem;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-bg);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition-fast), background var(--transition-fast);
}

.codeBlock:hover .insertBtn {
  opacity: 1;
}

.insertBtn:hover {
  background: var(--color-primary);
  color: var(--color-bg);
}

/* Snippet grid */
.snippetGrid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Field table */
.fieldTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.625rem;
  margin: 0.375rem 0;
}

.fieldTable th {
  text-align: left;
  padding: 0.25rem 0.375rem;
  font-weight: 600;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  font-size: 0.5625rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fieldTable td {
  padding: 0.25rem 0.375rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: top;
}

.fieldTable code {
  background: var(--color-bg-tertiary);
  padding: 0.05rem 0.2rem;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  white-space: nowrap;
}

.required {
  color: var(--color-danger);
  margin-left: 0.125rem;
  font-weight: 700;
}

.fieldType {
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.fieldOptions {
  color: var(--color-text-muted);
  font-size: 0.5625rem;
}

.fieldDesc {
  color: var(--color-text-muted);
}

.muted {
  color: var(--color-text-muted);
  font-style: italic;
  padding: 0.25rem 0;
}

/* Type items (expandable sub-items) */
.typeItem {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  margin: 0.25rem 0;
  overflow: hidden;
}

.typeHeader {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  width: 100%;
  padding: 0.375rem 0.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: var(--text-xs);
  color: var(--color-text);
  text-align: left;
  transition: background var(--transition-fast);
}

.typeHeader:hover {
  background: var(--color-bg-tertiary);
}

.typeChevron {
  font-size: 0.5625rem;
  color: var(--color-text-muted);
  width: 8px;
  text-align: center;
  flex-shrink: 0;
}

.typeName {
  background: var(--color-bg-tertiary);
  padding: 0.1rem 0.3rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--color-primary);
  flex-shrink: 0;
}

.typeDesc {
  color: var(--color-text-muted);
  font-size: 0.625rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.typeBody {
  padding: 0.375rem 0.5rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
}

/* Subsections inside a section */
.subsection {
  margin: 0.75rem 0 0.25rem;
}

.subsection h4 {
  margin: 0 0 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--color-text);
}

/* Cheat sheet */
.cheatSheet {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.cheatItem {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 0.625rem;
}

.cheatItem span {
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.cheatSyntax {
  background: var(--color-bg-tertiary);
  padding: 0.1rem 0.3rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  color: var(--color-text);
  white-space: nowrap;
  flex-shrink: 0;
}
