/* ============================================================
   AiOps Glossary — Single Term Page v3.9
   ============================================================ */

:root {
  --st-font:    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --st-text:    #111827;
  --st-text2:   #4b5563;
  --st-muted:   #9ca3af;
  --st-border:  #e4e7ec;
  --st-surface: #ffffff;
  --st-bg:      #f4f6f9;
  --st-accent:  #2563eb;
  --st-radius:  12px;
  --st-shadow:  0 2px 12px rgba(0,0,0,.07);
}

/* ── Wrapper ─────────────────────────────────────────────── */
.aiops-single-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 28px 20px 80px;
  font-family: var(--st-font);
  color: var(--st-text);
}

/* ── Breadcrumb ──────────────────────────────────────────── */
.aiops-breadcrumb { margin-bottom: 20px; }
.aiops-breadcrumb-list {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
  list-style: none; margin: 0; padding: 0;
  font-size: 12px; color: var(--st-muted);
}
.aiops-breadcrumb-list li[aria-hidden] { color: #d1d5db; }
.aiops-breadcrumb-list a { color: var(--st-accent); text-decoration: none; }
.aiops-breadcrumb-list a:hover { text-decoration: underline; }
.aiops-breadcrumb-list [aria-current="page"] { color: var(--st-text); font-weight: 600; }

/* ── Main Card ───────────────────────────────────────────── */
.aiops-single-card {
  background: var(--st-surface);
  border: 1.5px solid var(--st-border);
  border-radius: var(--st-radius);
  overflow: hidden;
  box-shadow: var(--st-shadow);
}

/* ── Header ──────────────────────────────────────────────── */
.aiops-single-header {
  padding: 32px 36px 28px;
  background: linear-gradient(135deg, #f0f7ff 0%, #faf5ff 100%);
  border-bottom: 1.5px solid var(--st-border);
  position: relative;
}
.aiops-single-featured-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: linear-gradient(90deg, #f59e0b, #d97706); color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 20px; margin-bottom: 14px;
}
.aiops-single-meta-top {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap;
}
.aiops-single-category {
  font-size: 11px; font-weight: 700; background: #dbeafe; color: #1d4ed8;
  border-radius: 20px; padding: 3px 12px; text-transform: uppercase; letter-spacing: .04em;
}
.aiops-single-category a { color: inherit; text-decoration: none; }
.aiops-single-category a:hover { text-decoration: underline; }
.aiops-single-difficulty {
  font-size: 11px; font-weight: 700;
  color: var(--diff-color, #6b7280);
  border: 1.5px solid var(--diff-color, #6b7280);
  border-radius: 20px; padding: 2px 10px;
}
.aiops-single-title {
  font-size: clamp(24px, 4vw, 34px); font-weight: 800; color: #0f172a;
  margin: 0 0 6px; line-height: 1.15; letter-spacing: -.025em;
}
.aiops-single-acronym { font-size: 14px; color: var(--st-muted); margin: 0; font-style: italic; }

/* ── Sections ────────────────────────────────────────────── */
.aiops-single-section {
  padding: 28px 36px;
  border-bottom: 1px solid #f1f5f9;
}
.aiops-single-section:last-child { border-bottom: none; }
.aiops-single-section-title {
  font-size: 14px; font-weight: 700; color: var(--st-text2);
  margin: 0 0 14px; letter-spacing: -.01em; text-transform: uppercase; letter-spacing: .04em;
}

/* ── Definition ──────────────────────────────────────────── */
.aiops-single-definition {
  font-size: 16px; line-height: 1.8; color: #1e293b; margin: 0;
  background: #f8fafc;
  border-left: 4px solid var(--st-accent);
  padding: 16px 20px; border-radius: 0 8px 8px 0;
}

/* ── Content ─────────────────────────────────────────────── */
.aiops-single-content { font-size: 15px; line-height: 1.8; color: var(--st-text2); }
.aiops-single-content h2 {
  font-size: 16px; font-weight: 700; color: var(--st-text);
  margin: 20px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--st-border);
}
.aiops-single-content p { margin: 0 0 14px; }
.aiops-single-content p:last-child { margin-bottom: 0; }

/* Placeholder when no content */
.aiops-content-placeholder {
  text-align: center; padding: 40px 24px;
  background: var(--st-bg); border: 2px dashed var(--st-border); border-radius: 10px;
}
.aiops-placeholder-icon { font-size: 36px; margin-bottom: 10px; }
.aiops-content-placeholder p { color: var(--st-muted); font-size: 14px; margin: 0 0 16px; }
.aiops-gen-inline-btn {
  background: var(--st-accent); color: #fff; border: none; border-radius: 8px;
  padding: 10px 22px; font-size: 14px; font-weight: 600; cursor: pointer;
  font-family: var(--st-font); transition: opacity .15s;
}
.aiops-gen-inline-btn:hover { opacity: .85; }

.aiops-gen-loading {
  display: flex; flex-direction: column; align-items: center; padding: 40px 24px; gap: 14px;
}
.aiops-gen-spinner {
  width: 36px; height: 36px; border: 3px solid var(--st-border);
  border-top-color: var(--st-accent); border-radius: 50%;
  animation: st-spin .7s linear infinite;
}
@keyframes st-spin { to { transform: rotate(360deg); } }
.aiops-gen-loading p { color: var(--st-muted); font-size: 14px; margin: 0; }
.aiops-content-meta {
  font-size: 11px; color: var(--st-muted); margin: 14px 0 0; padding-top: 10px;
  border-top: 1px solid var(--st-border); font-style: italic;
}
.aiops-content-empty { color: var(--st-muted); font-size: 14px; font-style: italic; }

/* ── Use Cases ───────────────────────────────────────────── */
.aiops-single-use-cases {
  list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px;
}
.aiops-single-use-cases li {
  font-size: 14px; color: var(--st-text2); padding: 10px 14px;
  background: var(--st-bg); border-radius: 7px; border-left: 3px solid #059669;
  display: flex; align-items: flex-start; gap: 8px;
}
.aiops-single-use-cases li::before { content: "✓"; color: #059669; font-weight: 700; flex-shrink: 0; }

/* ── Reference ───────────────────────────────────────────── */
.aiops-single-ref-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--st-accent); font-size: 14px; word-break: break-all; text-decoration: none;
}
.aiops-single-ref-link:hover { text-decoration: underline; }

/* ── Vote Section ────────────────────────────────────────── */
.aiops-vote-section {
  background: var(--st-bg); border-radius: 10px; border: 1.5px solid var(--st-border);
}
.aiops-vote-desc { font-size: 13px; color: var(--st-text2); margin: 0 0 16px; }
.aiops-vote-group { display: flex; gap: 10px; flex-wrap: wrap; }
.aiops-vote-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--st-surface); border: 2px solid var(--st-border); border-radius: 10px;
  padding: 11px 22px; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all .15s; font-family: var(--st-font); color: var(--st-text2); min-width: 130px;
  justify-content: center;
}
.aiops-vote-btn:hover:not(:disabled) {
  border-color: #9ca3af; background: #f9fafb; transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.aiops-vote-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }
.aiops-vote-btn.voted-up   { background: #dcfce7; border-color: #86efac; color: #15803d; }
.aiops-vote-btn.voted-down { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }
.aiops-vote-count {
  background: rgba(0,0,0,.08); border-radius: 20px;
  padding: 1px 8px; font-size: 12px; font-weight: 700;
}
.aiops-vote-feedback {
  display: block; margin: 12px 0 0; font-size: 13px; color: var(--st-text); font-weight: 600;
}

/* Downvote reason panel */
.aiops-downvote-panel {
  margin-top: 16px; padding: 16px 18px;
  background: #faf5ff; border: 1.5px solid #e9d5ff; border-radius: 10px;
}
.aiops-downvote-prompt { font-size: 13px; font-weight: 600; color: #374151; margin: 0 0 10px; }
.aiops-reason-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.aiops-reason-chip {
  background: #fff; border: 1.5px solid #ddd6fe; border-radius: 20px;
  padding: 5px 14px; font-size: 12px; font-weight: 600; cursor: pointer; color: #6d28d9;
  font-family: var(--st-font); transition: all .1s;
}
.aiops-reason-chip:hover { border-color: #7c3aed; background: #faf5ff; }
.aiops-reason-chip.selected { background: #7c3aed; border-color: #7c3aed; color: #fff; }
.aiops-improve-submit {
  background: #7c3aed; color: #fff; border: none; border-radius: 8px;
  padding: 9px 18px; font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: var(--st-font); transition: opacity .1s;
}
.aiops-improve-submit:hover { opacity: .85; }
.aiops-improve-submit:disabled { opacity: .5; cursor: not-allowed; }
.aiops-improve-result {
  margin-top: 12px; padding: 12px; background: #fff;
  border: 1px solid #e9d5ff; border-radius: 7px;
  font-size: 13px; line-height: 1.6; color: var(--st-text2);
}

/* ── Share Bar ───────────────────────────────────────────── */
.aiops-single-share-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.aiops-share-input {
  flex: 1; min-width: 0; border: 1.5px solid var(--st-border); border-radius: 7px;
  padding: 8px 12px; font-size: 13px; color: var(--st-text2); background: var(--st-bg);
  cursor: text; font-family: var(--st-font);
}
.aiops-copy-btn {
  flex-shrink: 0; background: var(--st-accent); color: #fff; border: none;
  border-radius: 7px; padding: 9px 16px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .15s;
}
.aiops-copy-btn:hover { background: #1d4ed8; }
.aiops-copy-feedback { display: block; font-size: 12px; color: #059669; margin-top: 6px; min-height: 16px; }

/* ── Related Terms ───────────────────────────────────────── */
.aiops-single-related-section { margin-top: 40px; }
.aiops-single-related-heading {
  font-size: 18px; font-weight: 800; color: var(--st-text); margin: 0 0 18px; letter-spacing: -.02em;
}
.aiops-single-related-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px;
}
.aiops-related-card {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--st-surface); border: 1.5px solid var(--st-border); border-radius: 10px;
  padding: 18px; text-decoration: none; color: inherit;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.aiops-related-card:hover {
  border-color: var(--st-accent); box-shadow: 0 4px 16px rgba(37,99,235,.12);
  transform: translateY(-2px); color: inherit; text-decoration: none;
}
.aiops-related-card-cat {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--st-accent);
}
.aiops-related-card-title { font-size: 14px; font-weight: 700; color: var(--st-text); line-height: 1.3; }
.aiops-related-card-def { font-size: 12px; color: var(--st-muted); line-height: 1.5; margin: 0; flex: 1; }
.aiops-related-card-cta { font-size: 12px; color: var(--st-accent); font-weight: 600; margin-top: 4px; }

/* ── Back Button ─────────────────────────────────────────── */
.aiops-single-back-wrap { margin-top: 32px; text-align: center; }
.aiops-single-back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--st-bg); color: var(--st-text2); border: 1.5px solid var(--st-border);
  border-radius: 8px; padding: 10px 22px; font-size: 14px; font-weight: 600;
  text-decoration: none; transition: background .15s, border-color .15s;
}
.aiops-single-back-btn:hover {
  background: #e2e8f0; border-color: #cbd5e1; color: var(--st-text); text-decoration: none;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .aiops-single-header, .aiops-single-section { padding-left: 20px; padding-right: 20px; }
  .aiops-single-related-grid { grid-template-columns: 1fr; }
  .aiops-vote-btn { min-width: 100px; padding: 10px 16px; }
}
