/* ===== Lab Interactive Buttons ===== */

.lab-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0 0 0;
  padding: 0;
}

.lab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.85em;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
  font-family: inherit;
  white-space: nowrap;
}

.lab-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Colab button — Google Colab orange */
.lab-btn-colab {
  background: #F9AB00;
  color: #1a1a2e;
}
.lab-btn-colab:hover {
  background: #F09D00;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(249, 171, 0, 0.35);
}

/* Copy button — subtle blue */
.lab-btn-copy {
  background: var(--primary, #4F46E5);
  color: #fff;
}
.lab-btn-copy:hover {
  background: #4338CA;
  transform: translateY(-1px);
}

/* Download button — green */
.lab-btn-download {
  background: #10B981;
  color: #fff;
}
.lab-btn-download:hover {
  background: #059669;
  transform: translateY(-1px);
}

/* Run in browser button — purple */
.lab-btn-run {
  background: #8B5CF6;
  color: #fff;
}
.lab-btn-run:hover {
  background: #7C3AED;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
}
.lab-btn-run:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

/* Copied state */
.lab-btn-copy.copied {
  background: #10B981;
}

/* ===== Pyodide Output Area ===== */

.lab-output {
  margin-top: 12px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border, #e5e7eb);
}

.lab-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #1a1a2e;
  color: #e0e0e0;
  font-size: 0.8em;
  font-weight: 600;
}

.lab-output-header .lab-output-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lab-output-header .lab-output-clear {
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  font-size: 0.95em;
}
.lab-output-header .lab-output-clear:hover {
  opacity: 1;
}

.lab-output-body {
  background: #0d1117;
  color: #c9d1d9;
  padding: 14px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.85em;
  line-height: 1.6;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.lab-output-body .py-stdout { color: #c9d1d9; }
.lab-output-body .py-stderr { color: #f87171; }
.lab-output-body .py-error  { color: #f87171; font-weight: 600; }
.lab-output-body .py-info   { color: #60a5fa; }

/* Spinner */
.lab-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: lab-spin 0.6s linear infinite;
}

@keyframes lab-spin {
  to { transform: rotate(360deg); }
}

/* Pyodide loading bar */
.lab-pyodide-loading {
  padding: 20px 14px;
  text-align: center;
  color: #60a5fa;
  font-size: 0.85em;
}

/* Dark mode adjustments */
[data-theme="dark"] .lab-btn-colab {
  background: #F9AB00;
  color: #1a1a2e;
}
