/* Insight PDF slide deck viewer */

.insight-deck-viewer {
  width: 100%;
  max-width: 1120px;
  margin: 1.5rem auto 1.75rem;
  border: 1px solid var(--border, rgba(0, 229, 255, 0.12));
  border-radius: 12px;
  background: var(--bg-panel, #0d1420);
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}

.insight-deck-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border, rgba(0, 229, 255, 0.12));
  background: #0d1828;
}

.insight-deck-title {
  flex: 1;
  min-width: 14rem;
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--text, #e8f4ff);
}

.insight-deck-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.insight-deck-controls button,
.insight-deck-controls a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.38rem 0.72rem;
  border: 1px solid var(--border, rgba(0, 229, 255, 0.18));
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted, #8aaabb);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.insight-deck-controls button:hover:not(:disabled),
.insight-deck-controls a:hover {
  border-color: rgba(0, 229, 255, 0.55);
  color: var(--accent, #00e5ff);
  background: rgba(0, 229, 255, 0.08);
  text-decoration: none;
}

.insight-deck-controls button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.insight-deck-status {
  min-width: 4.2rem;
  text-align: center;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  color: var(--text-dim, #6b8aae);
}

.insight-deck-layout {
  display: grid;
  grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
}

.insight-deck-toc {
  padding: 0.9rem;
  border-right: 1px solid var(--border, rgba(0, 229, 255, 0.12));
  background: rgba(5, 8, 16, 0.34);
}

.insight-deck-toc h3 {
  margin: 0 0 0.65rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim, #6b8aae);
}

.insight-deck-toc ol {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: calc(100vh - 14rem);
  overflow: auto;
}

.insight-deck-toc button {
  width: 100%;
  padding: 0.45rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted, #8aaabb);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.78rem;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.insight-deck-toc button:hover {
  border-color: rgba(0, 229, 255, 0.22);
  background: rgba(0, 229, 255, 0.06);
  color: var(--text, #e8f4ff);
}

.insight-deck-toc button.is-active {
  border-color: rgba(0, 229, 255, 0.42);
  background: rgba(0, 229, 255, 0.1);
  color: var(--accent, #00e5ff);
  font-weight: 650;
}

.insight-deck-stage-wrap {
  min-width: 0;
  background: var(--bg, #050810);
}

.insight-deck-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(72vh, 760px);
  padding: 1rem;
  background-image:
    radial-gradient(ellipse 70% 55% at 50% 40%, rgba(0, 229, 255, 0.06), transparent 70%),
    linear-gradient(180deg, rgba(5, 8, 16, 0.98), rgba(13, 20, 32, 0.96));
}

.insight-deck-stage canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow:
    0 0 0 1px var(--border, rgba(0, 229, 255, 0.16)),
    0 12px 40px rgba(0, 0, 0, 0.55);
}

.insight-deck-loading,
.insight-deck-error {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 1.5rem;
  text-align: center;
  background: rgba(5, 8, 16, 0.92);
  color: var(--text-muted, #8aaabb);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
}

.insight-deck-loading[hidden],
.insight-deck-error[hidden] {
  display: none;
}

.insight-deck-note {
  margin: 0;
  padding: 0.85rem 0.95rem;
  border-top: 1px solid var(--border, rgba(0, 229, 255, 0.12));
  background: rgba(0, 229, 255, 0.035);
  color: var(--text-dim, #6b8aae);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  line-height: 1.55;
}

.insight-media {
  max-width: 760px;
  margin: 1.35rem auto 1.5rem;
}

.insight-media img {
  width: 100%;
  height: auto;
  display: block;
  margin: 0;
  border-radius: 12px;
  border: 1px solid var(--border, rgba(0, 229, 255, 0.12));
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
}

.insight-media-caption {
  margin: 0.55rem 0 0;
  color: var(--text-dim, #6b8aae);
  font-size: 0.82rem;
  line-height: 1.5;
}

@media (max-width: 860px) {
  .insight-deck-layout {
    grid-template-columns: 1fr;
  }

  .insight-deck-toc {
    border-right: 0;
    border-bottom: 1px solid var(--border, rgba(0, 229, 255, 0.12));
  }

  .insight-deck-toc ol {
    max-height: none;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
}

@media (max-width: 640px) {
  .insight-deck-toolbar {
    align-items: stretch;
  }

  .insight-deck-controls {
    width: 100%;
    justify-content: space-between;
  }

  .insight-deck-status {
    order: -1;
    width: 100%;
  }

  .insight-deck-stage {
    padding: 0.65rem;
    min-height: 60vh;
  }
}
