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

:root {
    --bg: #1e1e1e;
    --sidebar: #181818;
    --tab: #252526;
    --border: #333;
    --text: #d4d4d4;
}

body {
    height: 100vh;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family:
        "Cascadia Code",
        "JetBrains Mono",
        Consolas,
        monospace;
}

.app {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition:
        transform .25s ease,
        width .25s ease;
}

.sidebar-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    height: 40px;
    padding-right: 12px;
    border-bottom: 1px solid var(--border);
    color: #888;
    font-size: 12px;
}

#closeSidebar {
    display: block;
    background: transparent;
    border: none;
    color: var(--text);
    cursor: pointer;
    font-size: 16px;
    width: 40px;
    height: 40px
}

.explorer {
    flex: 1;
    overflow-y: auto;
}

.file,
.folder-header {
    padding: 10px 16px;
    cursor: pointer;
    user-select: none;
}

.file:hover,
.folder-header:hover {
    background: #2a2d2e;
}

.file.active {
    background: #37373d;
}

.folder-content {
    margin-left: 16px;
}

.hidden {
    display: none;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: #888;
}

.sidebar-footer a {
    display: block;
    margin-bottom: 6px;
    color: #4fc1ff;
    text-decoration: none;
}

.sidebar-footer a:hover {
    text-decoration: underline;
}

.editor {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tab-bar {
    display: flex;
    align-items: center;
    min-height: 40px;
    overflow-x: auto;
    background: var(--tab);
    border-bottom: 1px solid var(--border);
    scrollbar-width: none;
}

.tab-bar::-webkit-scrollbar {
    display: none;
}

.tab {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    padding: 0 14px;
    background: #2d2d2d;
    border-right: 1px solid var(--border);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab.active {
    background: var(--bg);
}

.close {
    opacity: .6;
    transition: opacity .2s;
}

.close:hover {
    opacity: 1;
}

.editor-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

#lineNumbers {
    width: 60px;
    min-width: 60px;
    padding: 24px 10px;
    text-align: right;
    color: #6e7681;
    border-right: 1px solid var(--border);
    user-select: none;
    overflow: hidden;
    line-height: 28px;
    font-size: 15px;
}

#code {
    flex: 1;
    padding: 24px;
    overflow: auto;
    white-space: pre-wrap;
    line-height: 28px;
    font-size: 15px;
    margin: 0;
}

.key {
    color: #9cdcfe;
}

.string {
    color: #ce9178;
}

.number {
    color: #b5cea8;
}

.boolean {
    color: #569cd6;
}

a {
    color: #4fc1ff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: var(--text);
    vertical-align: text-bottom;
    animation: blink 1s infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

#sidebarToggle {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    border-right: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: #444;
}

::-webkit-scrollbar-track {
    background: #252526;
}

@media (max-width: 1200px) {

    .sidebar {
        width: 220px;
        min-width: 220px;
    }

}

@media (max-width: 900px) {

    .sidebar {
        width: 180px;
        min-width: 180px;
    }

    #lineNumbers {
        width: 50px;
        min-width: 50px;
    }

    #code {
        padding: 16px;
        font-size: 14px;
    }

}

@media (max-width: 800px) {

    #sidebarToggle {
        display: block;
    }

    .sidebar-header {
        display: flex;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        min-width: 280px;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
        box-shadow:
            0 0 20px rgba(0, 0, 0, .4);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    #lineNumbers {
        width: 40px;
        min-width: 40px;
        padding: 16px 6px;
    }

    #code {
        padding: 16px;
        font-size: 13px;
        line-height: 24px;
    }

}

@media (max-width: 500px) {

    .sidebar {
        width: 240px;
        min-width: 240px;
    }

    #lineNumbers {
        display: none;
    }

    #code {
        padding: 12px;
        font-size: 12px;
    }

    .tab {
        padding: 0 10px;
    }

}