* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    background-color: #1e1e1e;
    color: #d4d4d4;
}

.container-fluid {
    height: 100%;
}

/* Sidebar */
.sidebar {
    background-color: #252526;
    height: 100%;
    overflow-y: auto;
    border-right: 1px solid #3c3c3c;
}

.sidebar-header {
    background-color: #333333;
}

.file-list {
    max-height: calc(100vh - 250px);
    overflow-y: auto;
}

.file-item {
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    margin-bottom: 2px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}

.file-item:hover {
    background-color: #2a2d2e;
}

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

.file-item .file-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.file-item .delete-btn {
    opacity: 0;
    transition: opacity 0.2s;
}

.file-item:hover .delete-btn {
    opacity: 1;
}

/* Toolbar */
.toolbar {
    background-color: #2d2d2d;
}

/* Editor */
#editor-container {
    height: calc(100vh - 50px);
    overflow: hidden;
}

.CodeMirror {
    height: 100%;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
}

/* Курсор */
.CodeMirror-cursor {
    border-left: 2px solid #00d4ff !important;
}

/* Блок курсора (при выделении) */
.CodeMirror div.CodeMirror-secondarycursor {
    border-left: 2px solid #00d4ff !important;
}

/* Вкладки файлов */
.tabs-container {
    background-color: #1e1e1e;
    min-height: 35px;
}

.tabs-list {
    gap: 1px;
}

.tab-item {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    background-color: #2d2d2d;
    border: none;
    border-bottom: 2px solid transparent;
    color: #888;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    user-select: none;
    min-width: 120px;
    max-width: 200px;
}

.tab-item:hover {
    background-color: #383838;
    color: #d4d4d4;
}

.tab-item.active {
    background-color: #1e1e1e;
    border-bottom-color: #0e639c;
    color: #d4d4d4;
}

.tab-item .tab-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
    font-size: 13px;
}

.tab-item .tab-close {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
    font-size: 14px;
    line-height: 1;
}

.tab-item:hover .tab-close {
    opacity: 1;
}

.tab-item .tab-close:hover {
    background-color: #c42b1c;
    color: white;
}

.tab-item.modified .tab-name::after {
    content: ' ●';
    color: #0e639c;
}

.tab-item.active.modified .tab-name::after {
    color: #d4d4d4;
}

/* Scrollbar для вкладок */
.tabs-list::-webkit-scrollbar {
    height: 4px;
}

.tabs-list::-webkit-scrollbar-track {
    background: #1e1e1e;
}

.tabs-list::-webkit-scrollbar-thumb {
    background: #424242;
    border-radius: 2px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
    background: #424242;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4f4f4f;
}

/* Buttons */
.btn-primary {
    background-color: #0e639c;
    border-color: #0e639c;
}

.btn-primary:hover {
    background-color: #1177bb;
    border-color: #1177bb;
}

.btn-success {
    background-color: #16825d;
    border-color: #16825d;
}

.btn-success:hover {
    background-color: #1a9870;
    border-color: #1a9870;
}

.btn-danger {
    background-color: #c42b1c;
    border-color: #c42b1c;
}

/* Form controls */
.form-select {
    background-color: #3c3c3c;
    border-color: #3c3c3c;
    color: #d4d4d4;
}

.form-select:focus {
    background-color: #3c3c3c;
    border-color: #0e639c;
    color: #d4d4d4;
    box-shadow: 0 0 0 0.25rem rgba(14, 99, 156, 0.25);
}

.form-control {
    background-color: #3c3c3c;
    border-color: #3c3c3c;
    color: #d4d4d4;
}

.form-control:focus {
    background-color: #3c3c3c;
    border-color: #0e639c;
    color: #d4d4d4;
    box-shadow: 0 0 0 0.25rem rgba(14, 99, 156, 0.25);
}

/* Modal */
.modal-content {
    background-color: #2d2d2d;
    border: 1px solid #3c3c3c;
}

.modal-header {
    border-bottom: 1px solid #3c3c3c;
}

.modal-footer {
    border-top: 1px solid #3c3c3c;
}

.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Toast */
.toast {
    background-color: #2d2d2d;
    border: 1px solid #3c3c3c;
}

.toast-header {
    background-color: #333333;
    border-bottom: 1px solid #3c3c3c;
}

/* Errors Panel */
.errors-panel {
    background-color: #2d2d2d;
    max-height: 200px;
    overflow-y: auto;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

.errors-header {
    background-color: #333333;
    border-bottom: 1px solid #3c3c3c;
    position: sticky;
    top: 0;
}

.errors-list {
    padding: 0.5rem;
}

.error-item {
    padding: 6px 10px;
    margin-bottom: 4px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-item.error {
    background-color: rgba(220, 53, 69, 0.2);
    border-left: 3px solid #dc3545;
}

.error-item.warning {
    background-color: rgba(255, 193, 7, 0.2);
    border-left: 3px solid #ffc107;
}

.error-item:hover {
    opacity: 0.8;
}

.error-item .error-line {
    color: #888;
    font-size: 12px;
}

.error-item .error-message {
    flex: 1;
}
