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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Courier New', monospace;
    background-color: #1e1e1e;
    color: #ffffff;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-section-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100px;
    overflow: hidden;
}

.editor-header {
    display:flex;
    justify-content: flex-end;
    align-items: center;
    padding: 5px 15 px;
    background-color: #252526;
    border-top: 1px solid #333;
}
#runBtn {
    background-color: #4CAF50;
    color: white;
    padding: 5px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}
#runBtn:hover {
    background-color: #45a049;
}
.main-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

.left-panel {
    width: 250px;
    background-color: #252526;
    border-right: 1px solid #333;
    padding: 15px;
    overflow-y: auto;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.left-panel h3 {
    color: #cccccc;
    margin-bottom: 15px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.new-file-btn {
    background-color: purple;
    color: white;
    border: none;
    border-radius: 4px;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.new-file-btn:hover {
    background-color: purple;
}

.file-item {
    padding: 8px 12px;
    background-color: #2d2d30;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
}

.file-item:hover {
    background-color: #37373d;
}

.editor-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

h1 {
    text-align: center;
    padding: 15px;
    justify-content: center;
    background-color: #2d2d2d;
    color: #61dafb;
    border-bottom: 1px solid #333;
    margin: 0;
}

.editor-container {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.CodeMirror {
    flex: 1;
    height: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
}
.CodeMirror-hints {
    position: absolute;
    z-index: 10;
    overflow: hidden;
    list-style: none;
    margin: 0;
    padding: 2px;
    box-shadow: 2px 3px 5px rgba(0,0,0,0.2);
    border-radius: 3px;
    border: 1px solid #333;
    background: #282a36;
    font-size: 90%;
    font-family: 'Courier New', Courier, monospace;
}

.CodeMirror-hint {
    margin: 0;
    padding:2px 4px;
    border-radius: 2px;
    white-space: pre;
    color: #f8f8f2;
    cursor: pointer;
}

li.CodeMirror-hint-active {
    background: #44475a;
    color: #f8f8f2;
}

#codeEditor {
    width: 100%;
    height: 100%;
    background-color: #1e1e1e;
    color: #ffffff;
    border: none;
    padding: 20px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    outline: none;
}

#codeEditor::placeholder {
    color: #888;
}

#codeEditor:focus {
    background-color: #1e1e1e;
}
.empty-message {
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 20px 10px;
    font-size: 13px;
}
.file-item.active {
    background-color: #0e639c;
    color: white;
}

.file-item.editing {
    padding: 4px 8px;
    flex-direction: column;
    align-items: stretch;
}

.file-item input {
    background: transparent;
    border: 1px solid #0e639c;
    color: white;
    padding: 4px;
    font-size: 14px;
    width: 100%;
    border-radius: 2px;
    font-family: 'Courier New', Courier, monospace;
}
.file-item input:focus {
    outline: none;
    border-color: #1177bb
}

.helper-text {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
}

.helper-text.error{
    color: #f44336;
}

.context-menu {
    position: absolute;
    z-index: 1000;
    display: none;
    min-width: 120px;
    background-color: #2d2d30;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 5px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); 
}

.context-menu-item {
    padding: 8px 12px;
    color: #cccccc;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}
.context-menu-item:hover {
    background-color: #0e639c;
}
.context-menu-item.delete {
    color: #f44336;
}
.context-menu-item.delete:hover {
    background-color: #c93c3c;
    color: white;
}

.file-item {
    padding: 8px 12px;
    background-color: #2d2d30;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.file-item img {
    width: 16px;
    height: 16px;
    margin-right: 8px;
}
.file-item:hover {
    background-color: #37373d;
}

.editor-placeholder {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #888;
    padding: 20px;
}
.tabs-container {
    display: flex;
    background-color: #252526;
    padding: 5px 5px 0 5px;
    gap: 2px;
    flex-shrink: 0;
}

.tab-item{
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background-color: #2d2d30;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: #ccc;
    white-space: nowrap;
}
.tab-item.active{
    background-color: #1e1e1e;
    color: white;
}
.tab-close-btn {
    margin-left: 10px;
    padding: 0 4px;
    border: none;
    background: transparent;
    color: #ccc;
    cursor: pointer;
    font-size: 16px;
    border-radius: 50%;
}
.tab-close-btn:hover {
    background-color: #555;
}
.editor-group {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.editor-pane {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.editor-pane:first-child {
    border-left:none;
}

.resizer {
    width: 5px;
    background-color: #333;
    cursor: col-resize;
    flex-shrink: 0;
}
.resizer:hover {
    background-color: purple;
}

.terminal-resizer {
    height: 5px;
    background-color: #333;
    cursor: row-resize;
}
#terminal-container {
    height: 250px;
    background-color: #1e1e1e;
    padding: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#terminal-container .xterm {
    height: 100% !important;
}

#previewBtn {
    background-color: #007acc;
    color: white;
    padding: 5px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-left: 10px;
}

#previewBtn:hover {
    background-color: #005a9e;
}

.preview-resizer {
    height: 5px;
    background-color: #333;
    cursor: row-resize;
}
.preview-resizer:hover {
    background-color: purple;
}
#preview-container {
    height: 250px;
    background-color: #1e1e1e;
    padding: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-top: 1px solid #333;
}
.preview-header {
    padding: 5px 0;
    color: #cccccc;
    font-size: 14px;
    border-bottom: 1px solid #333;
    margin-bottom: 10px;
}

.preview-frame {
    flex: 1;
    width: 100%;
    border: 1px solid #333;
    background-color: white;
    border-radius: 4px;
}