.code-sandbox-wrapper,
.mysql-sandbox-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 1.5rem 0;
  width: 100%;
}

/* MySQL Status Badge */
.mysql-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background-color: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.mysql-status-badge.ready {
  background-color: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

[data-theme="dark"] .mysql-status-badge,
body.dark .mysql-status-badge {
  background-color: rgba(217, 119, 6, 0.15);
  border-color: rgba(217, 119, 6, 0.3);
  color: #fbbf24;
}

[data-theme="dark"] .mysql-status-badge.ready,
body.dark .mysql-status-badge.ready {
  background-color: rgba(220, 38, 38, 0.18);
  color: #f87171;
  border-color: rgba(220, 38, 38, 0.35);
}

.mysql-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
}

/* MySQL Island Container */
.mysql-island {
  display: flex;
  flex-direction: column;
  width: 100%;
  background-color: #ffffff;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  margin: 0;
  overflow: hidden;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.08);
  box-sizing: border-box;
}

[data-theme="dark"] .mysql-island,
body.dark .mysql-island {
  background-color: #0b1320;
  color: #f1f5f9;
  border-color: #1e293b;
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.55);
}

.mysql-island-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background-color: #f1f5f9;
  border-bottom: 1px solid #cbd5e1;
}

[data-theme="dark"] .mysql-island-header,
body.dark .mysql-island-header {
  background-color: #0f172a;
  border-color: #1e293b;
}

.mysql-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mysql-island-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #dc2626;
}

[data-theme="dark"] .mysql-island-title,
body.dark .mysql-island-title {
  color: #f87171;
}

/* Island Body */
.mysql-island-body {
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Terminal Panel: Pinned Scrollbars at the bottom/right edges */
.mysqlterm {
  width: 100%;
  background-color: #090d16 !important;
  padding: 14px 16px;
  height: 270px;
  max-height: 270px;
  overflow-y: scroll !important;
  overflow-x: auto !important;
  border-bottom: 1px solid #1e293b;
  box-sizing: border-box;
  display: block;
}

/* Pinned Custom Scrollbars */
.mysqlterm::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.mysqlterm::-webkit-scrollbar-track {
  background: #090d16;
}

.mysqlterm::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}

.mysqlterm::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

.mysqlterm pre {
  margin: 0;
  padding: 0;
  font-family: "JetBrains Mono", "Fira Code", Consolas, Monaco, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  color: #f87171 !important;
  background: transparent !important;
  min-width: 100%;
  display: inline-block;
}

.mysql-err {
  color: #ff4d4f !important;
  font-weight: 600;
}

/* Line Edit Container & Dynamic Textarea */
.mysqlsource {
  width: 100%;
  display: flex;
  background-color: #f8fafc;
  border-bottom: 1px solid #cbd5e1;
  box-sizing: border-box;
}

[data-theme="dark"] .mysqlsource,
body.dark .mysqlsource {
  background-color: #050a12;
  border-bottom-color: #1e293b;
}

.mysqlsource textarea.mysql-line-edit {
  width: 100%;
  min-height: 46px;
  max-height: 180px;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: #0f172a;
  font-family: "JetBrains Mono", "Fira Code", Consolas, Monaco, monospace;
  font-size: 0.88rem;
  line-height: 1.5;
  resize: none;
  outline: none;
  box-sizing: border-box;
  overflow-y: auto;
  white-space: pre-wrap;
}

[data-theme="dark"] .mysqlsource textarea.mysql-line-edit,
body.dark .mysqlsource textarea.mysql-line-edit {
  color: #f1f5f9;
}

.mysqlsource textarea.mysql-line-edit::placeholder {
  color: #94a3b8;
}

/* Bottom Actions Bar */
.mysql-island-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 10px 16px;
  background-color: #f1f5f9;
  box-sizing: border-box;
}

[data-theme="dark"] .mysql-island-footer,
body.dark .mysql-island-footer {
  background-color: #0f172a;
}

.mysql-footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Buttons */
.mysql-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 90px;
  height: 34px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

/* Matching Red Enter Button */
.mysql-enter-btn {
  background-color: #dc2626 !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.25);
}

.mysql-enter-btn:hover {
  background-color: #b91c1c !important;
  transform: translateY(-1px);
}

.mysql-enter-btn:disabled {
  background-color: #94a3b8 !important;
  cursor: not-allowed;
  transform: none;
  opacity: 0.7;
}

/* Clear Button */
.mysql-clear-btn {
  background-color: #e2e8f0;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.mysql-clear-btn:hover {
  background-color: #cbd5e1;
  color: #0f172a;
  transform: translateY(-1px);
}

[data-theme="dark"] .mysql-clear-btn,
body.dark .mysql-clear-btn {
  background-color: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .mysql-clear-btn:hover,
body.dark .mysql-clear-btn:hover {
  background-color: #334155;
  color: #f8fafc;
}