/* Hear-C IDE - Faust IDE Inspired Layout */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', sans-serif;
  background: #2d2d30;
  color: #cccccc;
  height: 100vh;
  overflow: hidden;
}

/* Main IDE Layout */
.ide-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Header */
.header {
  background: #1e1e1e;
  border-bottom: 1px solid #444;
  padding: 12px 20px;
  text-align: center;
  position: relative;
}

.header h1 {
  font-size: 18px;
  font-weight: 500;
  color: #ffffff;
  margin: 0;
}

.header-logo {
  position: absolute;
  top: 50%;
  left: 20px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 4px;
}

.github-link {
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  color: #8b949e;
  text-decoration: none;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 6px;
}

.github-link:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-50%) scale(1.1);
}

.github-icon {
  width: 24px;
  height: 24px;
  transition: all 0.2s ease;
}

.github-link:hover .github-icon {
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.3));
}

/* Main Content Area */
.main-content {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-width: 0;
}

/* Center: Editor Section */
.editor-section {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #1e1e1e;
  border-right: 1px solid #444;
}

.editor-header {
  background: #2d2d30;
  border-bottom: 1px solid #444;
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 35px;
}

.editor-title {
  font-size: 13px;
  font-weight: 500;
  color: #cccccc;
}

.editor-status {
  font-size: 11px;
  color: #4ec9b0;
}

#monaco-editor {
  flex: 1;
  background: #1e1e1e;
  overflow: hidden;
  position: relative;
  height: 0;
}

/* Right Panel: Controls */
.right-panel {
  flex: 0 0 280px;
  max-width: 280px;
  min-width: 240px;
  background: #252526;
  border-left: 1px solid #444;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.panel-section {
  border-bottom: 1px solid #444;
  padding: 16px;
}

.panel-section h3 {
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  padding-bottom: 4px;
  border-bottom: 1px solid #444;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panel-button {
  background: #0e639c;
  border: none;
  border-radius: 3px;
  color: #ffffff;
  padding: 10px 16px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
}

.panel-button:hover {
  background: #1177bb;
}

.panel-button:disabled {
  background: #3c3c3c;
  color: #6d6d6d;
  cursor: not-allowed;
}

.panel-button.save {
  background: #16825d;
}

.panel-button.save:hover {
  background: #1e9973;
}

.panel-button.reset {
  background: #a1260d;
}

.panel-button.reset:hover {
  background: #c72e0d;
}

.panel-button.audio {
  background: #6f42c1;
}

.panel-button.audio:hover {
  background: #8a63d2;
}

/* Bottom Panel: Console */
.bottom-panel {
  height: 200px;
  background: #1e1e1e;
  border-top: 1px solid #444;
  display: flex;
  flex-direction: column;
}

.console-header {
  background: #2d2d30;
  border-bottom: 1px solid #444;
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 35px;
}

.console-header h3 {
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.console-controls {
  display: flex;
  gap: 8px;
}

.console-button {
  background: #0e639c;
  border: none;
  border-radius: 3px;
  color: #ffffff;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.2s;
}

.console-button:hover {
  background: #1177bb;
}

.console-button:active {
  background: #0a4f7a;
}

.console-content {
  flex: 1;
  padding: 8px;
}

#output {
  width: 100%;
  height: 100%;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 3px;
  color: #c9d1d9;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 12px;
  padding: 12px;
  resize: none;
  outline: none;
  line-height: 1.4;
}

#output:focus {
  border-color: #58a6ff;
}

/* Error Container */
#error-container {
  position: fixed;
  bottom: 220px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 800px;
  width: 90%;
  background: #1e1e1e;
  border: 1px solid #f85149;
  border-radius: 6px;
  display: none;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

#error-container.visible {
  display: block;
}

.error-header {
  background: #f85149;
  color: #ffffff;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.error-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  transition: background-color 0.2s ease;
}

.error-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.error-content {
  padding: 16px;
  max-height: 200px;
  overflow-y: auto;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.4;
}

.error-line {
  margin: 2px 0;
  padding: 2px 0;
}

.error-line.error {
  color: #ff7b72;
}

.error-line.warning {
  color: #d29922;
}

/* Hidden elements */
.emscripten {
  display: none;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .right-panel {
    flex: 0 0 240px;
    max-width: 240px;
    min-width: 200px;
  }
  
  .bottom-panel {
    height: 180px;
  }
}

@media (max-width: 768px) {
  .main-content {
    flex-direction: column;
  }
  
  .right-panel {
    flex: 0 0 200px;
    max-width: 100%;
    min-width: 100%;
    height: 200px;
    order: 2;
  }
  
  .editor-section {
    order: 1;
    min-height: 300px;
  }
  
  .bottom-panel {
    height: 150px;
  }
}