/* ── tsParticles container ─────────────────────────────────────────────────── */
#tsparticles {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* ── GitHub activity feed ─────────────────────────────────────────────────── */
.gh-event {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(151, 190, 181, 0.08);
  font-size: 0.82rem;
}
.gh-type {
  background: rgba(88, 215, 255, 0.08);
  color: var(--teal, #58d7ff);
  border: 1px solid rgba(88, 215, 255, 0.15);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  min-width: 55px;
  text-align: center;
}
.gh-repo {
  color: var(--teal, #58d7ff);
  font-weight: 600;
  font-size: 0.78rem;
  white-space: nowrap;
}
.gh-detail {
  color: var(--muted, #94a59f);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gh-date {
  color: var(--dim, #5a716b);
  font-size: 0.72rem;
  white-space: nowrap;
}

/* ── Cytoscape network container ──────────────────────────────────────────── */
#cytoscape-network {
  width: 100%;
  height: 400px;
  background: var(--surface, rgba(18, 26, 33, 0.92));
  border: 1px solid var(--border, rgba(151, 190, 181, 0.1));
  border-radius: 14px;
}

/* ── Plotly containers ────────────────────────────────────────────────────── */
[data-plotly] {
  width: 100%;
  min-height: 300px;
  border-radius: 12px;
  overflow: hidden;
}

/* ── Pyodide Python runner ────────────────────────────────────────────────── */
.pyodide-runner {
  background: var(--surface, rgba(18, 26, 33, 0.92));
  border: 1px solid var(--border, rgba(151, 190, 181, 0.1));
  border-radius: 14px;
  overflow: hidden;
}
.pyodide-runner .runner-header {
  background: var(--surface2, rgba(24, 34, 44, 0.9));
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border, rgba(151, 190, 181, 0.1));
}
.pyodide-runner .runner-header span {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted, #94a59f);
}
#pyodide-run {
  background: rgba(88, 215, 255, 0.1);
  color: var(--teal, #58d7ff);
  border: 1px solid rgba(88, 215, 255, 0.2);
  border-radius: 6px;
  padding: 4px 14px;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
}
#pyodide-run:hover { background: rgba(88, 215, 255, 0.18); }
#pyodide-run:disabled { opacity: 0.5; cursor: wait; }
#pyodide-code {
  width: 100%;
  min-height: 120px;
  background: transparent;
  color: #a8d8a8;
  border: none;
  padding: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  line-height: 1.7;
  resize: vertical;
  outline: none;
}
#pyodide-output {
  padding: 12px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--green, #7bf0be);
  border-top: 1px solid var(--border, rgba(151, 190, 181, 0.1));
  min-height: 40px;
  white-space: pre-wrap;
}

/* ── Chatbot widget ───────────────────────────────────────────────────────── */
#chatbot-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #58d7ff, #7bf0be);
  border: none;
  cursor: pointer;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(88, 215, 255, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}
#chatbot-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(88, 215, 255, 0.45);
}

#chatbot-panel {
  position: fixed;
  bottom: 88px;
  right: 24px;
  z-index: 9998;
  width: 360px;
  max-height: 500px;
  background: var(--bg2, #111922);
  border: 1px solid var(--border, rgba(151, 190, 181, 0.1));
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.95);
  transition: opacity 0.25s, transform 0.25s;
}
#chatbot-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, rgba(151, 190, 181, 0.1));
}
.chatbot-header h4 {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text, #e9f0ec);
}
.chatbot-close {
  background: none;
  border: none;
  color: var(--muted, #94a59f);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
}

#chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
}
.chat-msg {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.84rem;
  line-height: 1.5;
  word-break: break-word;
}
.chat-user {
  align-self: flex-end;
  background: rgba(88, 215, 255, 0.12);
  color: var(--text, #e9f0ec);
  border-bottom-right-radius: 4px;
}
.chat-bot {
  align-self: flex-start;
  background: var(--surface, rgba(18, 26, 33, 0.92));
  color: var(--muted, #94a59f);
  border-bottom-left-radius: 4px;
}
.chat-typing {
  opacity: 0.6;
  font-style: italic;
}

.chatbot-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border, rgba(151, 190, 181, 0.1));
}
#chatbot-input {
  flex: 1;
  background: var(--surface, rgba(18, 26, 33, 0.92));
  border: 1px solid var(--border, rgba(151, 190, 181, 0.1));
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text, #e9f0ec);
  font-size: 0.84rem;
  outline: none;
}
#chatbot-input::placeholder { color: var(--dim, #5a716b); }
#chatbot-send {
  background: var(--teal, #58d7ff);
  color: #0a1116;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
}
#chatbot-send:hover { opacity: 0.85; }

/* ── Lottie containers ────────────────────────────────────────────────────── */
[data-lottie] {
  display: inline-block;
}

/* ── Mobile responsive ────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  #chatbot-panel { width: calc(100vw - 32px); right: 16px; bottom: 80px; }
  #cytoscape-network { height: 280px; }
}
