/* Minimal reset (replaces Tailwind preflight) */
*, *::before, *::after {
  box-sizing: border-box;
}

h1, h2, h3, h4, h5, h6, p {
  margin: 0;
}

/* Voenino shell.js integration */
body {
  padding-top: 56px;
  font-family: "DM Sans", system-ui, sans-serif;
  background: #FAF9F7;
}

#root {
  flex: 1;
}

/* --- Layout --- */

.bee-layout {
  padding: 1rem;
}

.bee-container {
  max-width: 64rem;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* --- Shared card style --- */

.bee-card {
  background-color: #fff;
  border-radius: 1rem;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  padding: 1rem;
  border: 1px solid #fef3c7;
}

.bee-card-title {
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 600;
  color: #92400e;
  margin-bottom: 0.75rem;
}

/* --- Canvas section --- */

.bee-canvas-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.bee-coords {
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: #d97706;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background-color: #fffbeb;
  padding: 0.25rem 0.75rem;
  border-radius: 0.5rem;
}

.bee-canvas-wrapper {
  display: flex;
  justify-content: center;
}

.bee-canvas {
  border: 2px solid #fde68a;
  border-radius: 0.75rem;
  max-width: 100%;
  height: auto;
}

.bee-running {
  margin-top: 0.75rem;
  text-align: center;
  color: #d97706;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* --- Terminal + Reference row --- */

.bee-main-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 768px) {
  .bee-main-row {
    flex-direction: row;
  }
}

/* --- Terminal --- */

.bee-terminal {
  flex: 1 1 0%;
}

.bee-code-input {
  width: 100%;
  height: 12rem;
  padding: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 1rem;
  line-height: 1.5rem;
  background-color: rgb(255 251 235 / 0.5);
  border: 1px solid #fde68a;
  border-radius: 0.75rem;
  resize: none;
  box-sizing: border-box;
}

.bee-code-input:focus {
  border-color: #fbbf24;
  outline: none;
}

/* --- Error display --- */

.bee-error {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.75rem;
  color: #b91c1c;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.bee-error-title {
  font-weight: 600;
}

.bee-error-msg {
  margin-top: 0.25rem;
}

.bee-error-hint {
  margin-top: 0.25rem;
  color: #ef4444;
  font-size: 0.75rem;
  line-height: 1rem;
}

/* --- Button row --- */

.bee-btn-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.bee-btn {
  padding: 0.625rem 1rem;
  color: #fff;
  font-weight: 600;
  border-radius: 9999px;
  font-size: 1rem;
  line-height: 1.5rem;
  border: none;
  cursor: pointer;
  transition-property: color, background-color, border-color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.bee-btn:disabled {
  background-color: #d1d5db;
  cursor: default;
}

.bee-btn-run {
  flex: 1 1 0%;
  background-color: #d97706;
}

.bee-btn-run:hover:not(:disabled) {
  background-color: #b45309;
}

.bee-btn-stop {
  background-color: #78716c;
}

.bee-btn-stop:hover:not(:disabled) {
  background-color: #57534e;
}

.bee-btn-clear {
  background-color: #a8a29e;
}

.bee-btn-clear:hover:not(:disabled) {
  background-color: #78716c;
}

/* --- Speed slider --- */

.bee-speed {
  margin-top: 1rem;
}

.bee-speed-label {
  display: block;
  color: #92400e;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.bee-speed-slider {
  width: 100%;
  height: 0.5rem;
  background-color: #fef3c7;
  border-radius: 0.5rem;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  accent-color: #f59e0b;
}

/* --- Quick Reference --- */

.bee-reference {
  width: 100%;
}

@media (min-width: 768px) {
  .bee-reference {
    width: 24rem;
    flex-shrink: 0;
  }
}

.bee-ref-list {
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: #57534e;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.bee-ref-list > * + * {
  margin-top: 0.25rem;
}

.bee-ref-cmd {
  font-weight: 700;
  color: #92400e;
}

/* --- Colors section --- */

.bee-color-section {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #fef3c7;
}

.bee-color-title {
  font-weight: 600;
  color: #92400e;
  font-size: 0.875rem;
  line-height: 1.25rem;
  margin-bottom: 0.25rem;
}

.bee-color-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 0.75rem;
  row-gap: 0.125rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color: #57534e;
}

.bee-color-swatch {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 0.25rem;
  margin-right: 0.25rem;
  vertical-align: middle;
}

/* --- Examples section --- */

.bee-examples-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  overflow-x: auto;
}

@media (min-width: 768px) {
  .bee-examples-grid {
    flex-wrap: nowrap;
  }
}

/* --- Example cards (built by JS) --- */

.bee-example-card {
  flex: 1;
  min-width: 140px;
  padding: 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid #fef3c7;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bee-example-card:hover {
  border-color: #fcd34d;
  background: rgba(255, 251, 235, 0.5);
}

.bee-example-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.bee-example-name {
  font-weight: 600;
  color: #92400e;
  font-size: 0.875rem;
}

.bee-badge {
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
}

.bee-badge-beginner {
  background: #f0fdf4;
  color: #16a34a;
}

.bee-badge-intermediate {
  background: #fffbeb;
  color: #d97706;
}

.bee-badge-advanced {
  background: #fff7ed;
  color: #ea580c;
}

.bee-example-desc {
  font-size: 0.75rem;
  color: #78716c;
  margin-top: 0.25rem;
}
