:root {
    --primary: #64ffda;
    --secondary: #0a192f;
    --dark: #172a45;
    --light: #ccd6f6;
    --red: #ff6464;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Fira Code', monospace;
    background: linear-gradient(45deg, #0a192f, #172a45);
    color: var(--light);
    height: 100vh;
    overflow: hidden;
}

.main {
    display: grid;
    grid-template-columns: 200px 3fr 2fr;
    gap: 1rem;
    height: 100vh;
    padding: 1rem;
}

.sidebar {
    background: rgba(23, 42, 69, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.sidebar button {
    background: var(--primary);
    color: var(--secondary);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    margin: 0.25rem 0;
    width: 100%;
}

.sidebar button:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(100, 255, 218, 0.3);
}

.file-tree {
    margin-top: 1rem;
    padding-left: 10px;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    margin: 0.25rem 0;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    justify-content: space-between;
}

.file-item:hover {
    background: rgba(100, 255, 218, 0.1);
}

.file-item i {
    margin-right: 8px;
    color: var(--primary);
}

#editor-container {
    display: flex;
    flex-direction: column;
    background: rgba(23, 42, 69, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
}

.editor-tabs {
    display: flex;
    background: var(--dark);
    padding: 0.5rem;
}

.tab {
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 5px;
    margin-right: 0.5rem;
}

.tab.active {
    background: var(--primary);
    color: var(--secondary);
    font-weight: 600;
}

.editor-wrapper {
    position: relative;
    flex: 1;
    overflow: hidden;
}

.line-numbers {
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    height: 100%;
    padding: 10px 4px;
    background-color: var(--dark);
    color: var(--primary);
    text-align: right;
    user-select: none;
    font-size: 0.9em;
}

.editor {
    width: calc(100% - 40px);
    height: 100%;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--light);
    resize: none;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    line-height: 1.5;
    padding-left: 50px;
}

.editor:disabled {
    background: rgba(23, 42, 69, 0.5);
    cursor: not-allowed;
}

.outputscreen {
    display: flex;
    flex-direction: column;
    background: rgba(23, 42, 69, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--dark);
}

.output-header button {
    background: var(--primary);
    color: var(--secondary);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.output-header button:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(100, 255, 218, 0.3);
}

iframe {
    flex: 1;
    border: none;
    background: white;
}

.console {
    background: var(--dark);
    padding: 1rem;
    height: 200px;
    overflow-y: auto;
    border-top: 2px solid var(--primary);
}

.log {
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
    font-weight: 600;
    padding: 0.25rem 0;
    color: var(--light);
}

.log.error {
    color: var(--red);
}

.context-menu {
    position: absolute;
    background: var(--dark);
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    display: none;
}

.context-menu-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.context-menu-item:hover {
    background: rgba(100, 255, 218, 0.1);
}

.delete-btn {
    color: var(--red);
    margin-left: 10px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.delete-btn:hover {
    opacity: 1;
}

.folder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
}

@media (max-width: 768px) {
    .main {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .sidebar {
        height: 200px;
        overflow-y: auto;
    }

    #editor-container, .outputscreen {
        height: 50vh;
    }

    .editor-tabs {
        flex-wrap: wrap;
    }

    .tab, .sidebar button, .output-header button {
        font-size: 0.8rem;
        padding: 0.3rem 0.5rem;
        margin: 0.25rem;
    }

    .file-item {
        font-size: 0.8rem;
        padding: 0.3rem;
    }

    .line-numbers {
        width: 30px;
        font-size: 0.7rem;
    }

    .editor {
        padding-left: 40px;
        font-size: 12px;
    }

    .console {
        height: 150px;
    }

    .output-header {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem;
    }
}