/* Run button on command blocks */
.command-block {
  position: relative;
  background: #1a1a1a;
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin: 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 13px;
  color: #e8e8e8;
  overflow-x: auto;
}

.command-text {
  flex: 1;
  white-space: nowrap;
}

.run-btn {
  flex-shrink: 0;
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 11px;
  padding: 4px 12px;
  background: #cc1f1f;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.run-btn:hover {
  background: #a01818;
}

.run-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.run-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Copy button */
.copy-btn {
  flex-shrink: 0;
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 11px;
  padding: 4px 10px;
  background: transparent;
  color: #888;
  border: 1px solid #333;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.copy-btn:hover {
  color: #e8e8e8;
  border-color: #666;
}

/* Toast notification */
.run-btn-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 13px;
  z-index: 9999;
  transition: opacity 0.3s ease;
  max-width: 90vw;
  text-align: center;
}

.run-btn-toast.success {
  background: #10b981;
  color: white;
}

.run-btn-toast.warning {
  background: #f59e0b;
  color: white;
}

.run-btn-toast.info {
  background: #1a1a1a;
  color: #e8e8e8;
  border: 1px solid #333;
}

.run-btn-toast.fade-out {
  opacity: 0;
}

/* Shell-tab code wraps in challenge builder preview */
.code-wrap .run-btn {
  position: absolute;
  top: 0.4rem;
  right: 3.6rem;
  z-index: 2;
}

.code-wrap .copy-btn--shell {
  z-index: 2;
}

/* Mobile */
@media (max-width: 480px) {
  .command-block {
    flex-wrap: wrap;
  }
  .command-text {
    width: 100%;
    white-space: normal;
    word-break: break-all;
  }
  .run-btn,
  .copy-btn {
    font-size: 14px;
    padding: 8px 16px;
    min-height: 44px;
  }
}
