body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f9fafb;
  color: #333;
}

.main-container {
  display: flex;
  height: 90vh;
  overflow: hidden; /* Prevent overall container overflow */
}

.left-column,
.right-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 1px solid #ccc;
  overflow: hidden; /* Prevent column overflow */
}

.header {
  padding: 10px 20px;
  border-bottom: 1px solid #ddd;
  flex-shrink: 0; /* Don't shrink header */
}

.content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  min-height: 0; /* Important for flex overflow */
}

.lesson-box {
  background: #fff9e5;
  padding: 15px;
  margin-bottom: 10px;
  border-radius: 10px;
}

.challenge-box {
  background: #e5f1ff;
  padding: 15px;
  border-radius: 10px;
}

.bottom-buttons {
  display: flex;
  justify-content: space-around;
  padding: 15px;
  border-top: 1px solid #ddd;
  flex-shrink: 0; /* Don't shrink buttons */
  flex-wrap: wrap;
  gap: 8px;
}

.bottom-buttons button {
  flex: 1;
  min-width: 100px;
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.bottom-buttons button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.right-column {
  background: white;
  border-left: 1px solid #ccc;
}

.toolbar {
  padding: 10px;
  border-bottom: 1px solid #ddd;
  flex-shrink: 0; /* Don't shrink toolbar */
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar button {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  background: #4caf50;
  color: white;
  transition: all 0.2s;
}

.toolbar button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

#blocklyDiv {
  flex: 1;
  min-height: 0; /* Important for flex child */
  overflow: hidden;
}

.console {
  background: #1e1e1e;
  padding: 10px;
  height: 150px;
  min-height: 150px;
  max-height: 200px;
  border-top: 1px solid #ddd;
  overflow-y: auto;
  flex-shrink: 0; /* Don't shrink console */
  display: flex;
  flex-direction: column;
}

.console p {
  color: #888;
  margin: 0 0 8px 0;
  font-size: 12px;
}

.console pre {
  color: #e0e0e0;
  margin: 0;
  white-space: pre-wrap; /* Wrap long lines */
  word-wrap: break-word; /* Break long words */
  overflow-wrap: break-word;
  font-family: "Courier New", Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  flex: 1;
  overflow-y: auto;
}

/* Custom scrollbar for console */
.console pre::-webkit-scrollbar {
  width: 8px;
}

.console pre::-webkit-scrollbar-track {
  background: #2a2a2a;
}

.console pre::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 4px;
}

.console pre::-webkit-scrollbar-thumb:hover {
  background: #666;
}

.footer {
  text-align: center;
  padding: 10px;
  background: #e5e7eb;
  font-size: 0.9em;
  flex-shrink: 0; /* Don't shrink footer */
}

/* Responsive design */
@media (max-width: 1024px) {
  .main-container {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  .left-column,
  .right-column {
    height: auto;
    min-height: 400px;
  }

  #blocklyDiv {
    height: 500px;
  }
}
