body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar Styling */
.sidebar {
    width: 250px;
    background-color: #2c3e50;
    color: #ecf0f1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #1a252f;
}

.sidebar-header {
    height: 50px;
    padding: 0 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #1a252f;
    box-sizing: border-box;
}

.header-buttons {
    display: flex;
    gap: 5px;
}

.header-buttons button {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

#sample-btn {
    background-color: #3498db;
    color: white;
}

#sample-btn:hover {
    background-color: #2980b9;
}

#new-file-btn {
    background-color: #27ae60;
    color: white;
}

#new-file-btn:hover {
    background-color: #2ecc71;
}

#file-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex-grow: 1;
}

#file-list li {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #34495e;
    transition: background-color 0.2s;
}

#file-list li:hover {
    background-color: #34495e;
}

#file-list li.active {
    background-color: #3498db;
}

/* Main Editor Area */
.main-editor {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: #282c34;
    min-width: 0;
    min-height: 0;
}

.toolbar {
    height: 50px;
    padding: 0 20px;
    background-color: #21252b;
    color: #abb2bf;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #181a1f;
    box-sizing: border-box;
    flex-shrink: 0;
}

#save-btn {
    padding: 6px 15px;
    background-color: #e67e22;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#save-btn:hover {
    background-color: #d35400;
}

.toolbar-buttons {
    display: flex;
    gap: 10px;
}

#format-btn {
    padding: 6px 15px;
    background-color: #9b59b6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#format-btn:hover {
    background-color: #8e44ad;
}

#editor-container {
    flex-grow: 1;
    min-height: 0;
    width: 100%;
}

.CodeMirror {
    height: 100% !important;
    width: 100% !important;
    font-size: 16px;
}

/* Context Menu Styling */
.context-menu {
    position: fixed;
    display: none;
    background-color: #34495e;
    color: white;
    border: 1px solid #2c3e50;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    z-index: 1000;
    border-radius: 4px;
    width: 120px;
}

.context-menu ul {
    list-style: none;
    margin: 0;
    padding: 5px 0;
}

.context-menu li {
    padding: 8px 15px;
    cursor: pointer;
    font-size: 14px;
}

.context-menu li:hover {
    background-color: #3498db;
}

.context-menu li.delete-item:hover {
    background-color: #e74c3c;
}

.context-menu ul li {
    border-bottom: none; /* Override previous sidebar li style */
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 12px 20px;
    border-radius: 4px;
    color: white;
    font-size: 14px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease-out forwards;
    min-width: 200px;
    max-width: 300px;
}

.toast.success {
    background-color: #27ae60;
}

.toast.error {
    background-color: #e74c3c;
}

.toast.info {
    background-color: #3498db;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}
