/* style.css – modernizat pentru noul layout */

body, html {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: Arial, sans-serif;
  background: #f5f6fa;
}

#top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #dce4ef;
  border-bottom: 1px solid #ccc;
  flex-wrap: wrap;
}

#layout {
  display: flex;
  height: calc(100% - 50px);
}

#fileTree {
  width: 200px;
  background: #eef3f9;
  border-right: 1px solid #ccc;
  padding: 10px;
  box-sizing: border-box;
  overflow-y: auto;
}

#fileTree ul {
  list-style: none;
  padding-left: 15px;
  display: block;
  margin: 0;
}

#fileTree li {
  list-style: disc;
  color: #333;
  margin: 4px 0;
  cursor: pointer;
}

#fileTree li.active {
  background-color: #4a74c9;
  color: white;
  padding: 2px 4px;
  border-radius: 4px;
}

#mainContent {
  display: flex;
  flex: 1;
  height: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

#editorPanel, #chatPanel {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 10px;
  box-sizing: border-box;
  min-width: 150px;
  overflow-x: auto;
}

#editorPanel {
  flex-grow: 1;
  flex-shrink: 1;
  flex-basis: 50%;
  border-right: 2px solid #ccc;
  resize: horizontal;
  overflow: auto;
}

#chatPanel {
  flex-grow: 1;
  flex-shrink: 1;
  flex-basis: 50%;
  overflow: auto;
}

#chatMessages {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  background: #f1f1f1;
  margin-bottom: 10px;
  border: 1px solid #ccc;
}

#prompt, #fileContent {
  width: 100%;
  font-family: monospace;
  resize: vertical;
  min-height: 400px;
  box-sizing: border-box;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

button {
  margin-top: 10px;
  padding: 6px 12px;
  background: #507dbc;
  border: none;
  color: white;
  cursor: pointer;
  border-radius: 4px;
  font-size: 14px;
  transition: background 0.2s ease-in-out;
}

button:hover {
  background: #3b5fa3;
}

.module-buttons button {
  background: #6c757d;
  color: white;
  margin-right: 5px;
}

.module-buttons button:hover {
  background: #5a6268;
}

#previewPopup, #sqlPopup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 80%;
  background: white;
  border: 2px solid #444;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
  display: none;
  flex-direction: column;
  z-index: 999;
  overflow: hidden;
}

#previewPopup iframe, #sqlPopupContent {
  flex: 1;
  border: none;
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
  overflow: auto;
}

#previewPopupHeader, #sqlPopupHeader {
  padding: 10px;
  background: #e9ecef;
  text-align: right;
  border-bottom: 1px solid #ccc;
}

#sqlPopupHeader button, #previewPopupHeader button {
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #333;
}

#sqlPopupHeader button:hover, #previewPopupHeader button:hover {
  color: red;
}

#sqlPopupContent textarea {
  width: 100%;
  height: 100px;
  font-family: monospace;
  padding: 10px;
  box-sizing: border-box;
  margin-bottom: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

#sqlPopupContent button {
  margin-bottom: 10px;
}

#sqlResult {
  background: #f8f9fa;
  padding: 10px;
  white-space: pre-wrap;
  font-family: monospace;
  border: 1px solid #ccc;
  border-radius: 4px;
  overflow-y: auto;
  height: 100%;
}

#chatPanel button {
  align-self: flex-start;
  background: #507dbc;
  font-size: 14px;
  padding: 6px 12px;
  margin-top: 10px;
}

#chatPanel button:hover {
  background: #3b5fa3;
}

#dragHandle {
  width: 5px;
  background-color: #ccc;
  cursor: ew-resize;
}

/* Stil minim pentru CodeMirror */
.cm-editor {
  height: 100%;
  border: 1px solid #ccc;
  font-family: monospace;
  font-size: 14px;
}

/* Ocupă toată înălțimea editorului */
#editorPanel {
  display: flex;
  flex-direction: column;
}

#codeEditor {
  flex: 1;
  min-height: 300px;
}
