.code-editor-panel {
  width: 0;
  height: 100vh;
  background-color: #f8f9fa;
  z-index: 100;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-left 0.3s ease;
  display: flex;
  flex-direction: column;
  color: #2d3748;
  font-family: 'Roboto', sans-serif;
  overflow: hidden;
  border-left: 0px solid #cbd5e0;
  flex-shrink: 0;
}

.code-editor-panel.open {
  width: 500px;
  border-left: 1px solid #cbd5e0;
}

.editor-header {
  padding: 16px 20px;
  background-color: #f1f3f5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.editor-header h3 {
  margin: 0;
  font-size: 18px;
  color: #1a202c;
}

#close-editor-btn {
  background: none;
  border: none;
  color: #718096;
  font-size: 24px;
  cursor: pointer;
  transition: color 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
}

#close-editor-btn:hover {
  color: #e53e3e;
  transform: scale(1.1);
}

.template-selector-wrap {
  padding: 12px 20px;
  background-color: #f8f9fa;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.template-selector-wrap label {
  font-size: 14px;
  color: #4a5568;
  font-weight: 500;
}

.template-selector-wrap select {
  flex: 1;
  background-color: #ffffff;
  color: #2d3748;
  border: 1px solid #cbd5e0;
  padding: 6px 10px;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.template-selector-wrap select:focus {
  border-color: #3182ce;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
}

.editor-textarea-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  background-color: #ffffff;
}

.CodeMirror {
  height: 100% !important;
  font-family: 'Fira Code', Consolas, Monaco, 'Courier New', Courier, monospace;
  font-size: 14px;
  line-height: 1.5;
  background-color: #ffffff !important;
  color: #2d3748 !important;
}

/* CodeMirror Light Theme customizations */
.CodeMirror-gutters {
  background-color: #f7fafc !important;
  border-right: 1px solid #edf2f7 !important;
}

.CodeMirror-linenumber {
  color: #a0aec0 !important;
}

/* Active line background */
.CodeMirror-activeline-background {
  background: #f7fafc !important;
}

/* Selection color */
.CodeMirror-selected {
  background: #e2e8f0 !important;
}

/* Syntax Highlighting overrides for light theme */
.cm-s-default span.cm-comment { color: #718096; font-style: italic; }
.cm-s-default span.cm-keyword { color: #805ad5; font-weight: bold; }
.cm-s-default span.cm-number { color: #dd6b20; }
.cm-s-default span.cm-string { color: #38a169; }
.cm-s-default span.cm-variable { color: #2d3748; }
.cm-s-default span.cm-variable-2 { color: #3182ce; }
.cm-s-default span.cm-def { color: #319795; font-weight: 600; }
.cm-s-default span.cm-operator { color: #d69e2e; }
.cm-s-default span.cm-property { color: #4a5568; }

.console-panel {
  height: 220px;
  background-color: #f7fafc;
  border-top: 1px solid #edf2f7;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.console-header {
  padding: 8px 20px;
  background-color: #edf2f7;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #4a5568;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 600;
}

.console-content {
  flex: 1;
  padding: 12px 20px;
  font-family: Consolas, Monaco, 'Courier New', Courier, monospace;
  font-size: 13px;
  overflow-y: auto;
  white-space: pre-wrap;
  color: #2d3748;
  line-height: 1.4;
}

.console-content.error {
  color: #e53e3e;
  background-color: rgba(229, 62, 62, 0.05);
}
