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

.editor-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.tabs-container {
    display: flex;
    background: var(--editor-bg);
    padding: 8px;
}

.tabs {
    display: flex;
    gap: 4px;
    flex: 1;
}

.tab {
    background: var(--tab-inactive-bg);
    color: #fff;
    padding: 8px 16px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease-out;
    margin-right: 5px;
    position: relative;
    overflow: hidden;
    animation: tabEnter 0.2s ease-out;
    transition: background-color 0.2s ease-out, transform 0.2s ease-out;
    border: 1px solid var(--tab-border);
}

.tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--tab-active-border);
    transition: all 0.2s ease-out;
    transform: translateX(-50%);
}

.tab:hover::after {
    width: 100%;
}

.tab.active {
    background: var(--tab-active-bg);
    transform: translateY(-2px);
}

.tab.active::after {
    width: 100%;
}

.tab.active .tab-close {
    opacity: 1;
}

.tab-close {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 6px;
    border-radius: 3px;
    transition: all 0.2s ease;
    opacity: 0.6;
}

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

.tab-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ff4444;
    transform: scale(1.1);
}

.new-tab-btn {
    background: var(--tab-inactive-bg);
    border: 1px solid var(--tab-border);
    color: #fff;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 24px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

#editor-wrapper {
    flex: 1;
    position: relative;
}

#monaco-editor {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.tab-title {
    outline: none;
    min-width: 30px;
    padding: 2px 4px;
    border-radius: 3px;
}

.tab-title[contenteditable="true"] {
    background: rgba(255, 255, 255, 0.1);
    cursor: text;
}

.tab-title:empty::before {
    content: 'Untitled';
    color: #888;
}

.editor-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-selector {
    background: var(--tab-inactive-bg);
    color: #fff;
    border: 1px solid var(--tab-border);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 14px;
    cursor: pointer;
    outline: none;
}

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

.theme-selector option {
    background: var(--tab-inactive-bg);
    color: #fff;
}

.tab-context-menu {
    display: none;
    position: fixed;
    background: #2d2d2d;
    border: 1px solid #3d3d3d;
    border-radius: 4px;
    padding: 4px 0;
    min-width: 160px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.menu-item {
    padding: 6px 12px;
    cursor: pointer;
    color: #d4d4d4;
}

.menu-item:hover {
    background: #3d3d3d;
}

/* Add unsaved changes indicator */
.tab.unsaved .tab-title::after {
    content: '*';
    margin-left: 4px;
    color: #858585;
}

.tabs::-webkit-scrollbar {
    height: 5px;
}

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

.tabs::-webkit-scrollbar-thumb {
    background: #3d3d3d;
    border-radius: 5px;
}

/* Toolbar */
.toolbar {
    display: flex;
    background: #252526;
    padding: 8px;
    border-bottom: 1px solid #3d3d3d;
    justify-content: space-between;
    align-items: center;
}

.toolbar-btn {
    background: none;
    border: none;
    color: #cccccc;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 3px;
}

.toolbar-btn:hover {
    background: #3d3d3d;
}

#quick-find {
    background: #3d3d3d;
    border: none;
    color: #cccccc;
    padding: 4px 8px;
    border-radius: 3px;
    width: 300px;
}

/* Main Container */
.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: #252526;
    border-right: 1px solid #3d3d3d;
    display: flex;
    flex-direction: column;
}

.sidebar-title {
    padding: 8px;
    font-size: 11px;
    text-transform: uppercase;
    color: #cccccc;
    background: #2d2d2d;
}

/* File Explorer */
.file-tree {
    padding: 8px;
    overflow-y: auto;
}

/* Search Sidebar */
.search-container {
    padding: 8px;
}

.search-options {
    padding: 8px 0;
    color: #cccccc;
    font-size: 12px;
}

.search-results {
    overflow-y: auto;
}

/* Status Bar */
.status-bar {
    height: 22px;
    background: #007acc;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    padding: 0 8px;
    font-size: 12px;
    align-items: center;
}

.status-item {
    padding: 0 8px;
}

/* Command Palette */
.command-palette {
    display: none;
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    background: #252526;
    border: 1px solid #3d3d3d;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.command-palette input {
    width: 100%;
    padding: 8px;
    background: #3d3d3d;
    border: none;
    color: #cccccc;
}

.command-list {
    max-height: 400px;
    overflow-y: auto;
}

/* Settings Panel */
.settings-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 600px;
    background: #1e1e1e;
    border: 1px solid #3d3d3d;
    border-radius: 6px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease-out;
}

.settings-panel.visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.settings-header {
    padding: 16px;
    border-bottom: 1px solid #3d3d3d;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-title {
    color: #fff;
    font-size: 18px;
    font-weight: 500;
}

.settings-close {
    background: none;
    border: none;
    color: #888;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

.settings-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.settings-content {
    padding: 16px;
    max-height: 70vh;
    overflow-y: auto;
}

.settings-group {
    margin-bottom: 24px;
}

.settings-group-title {
    color: #fff;
    font-size: 14px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #3d3d3d;
}

.setting-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    color: #d4d4d4;
}

.setting-label {
    flex: 1;
    font-size: 14px;
}

.setting-control {
    width: 200px;
}

.setting-control select,
.setting-control input[type="number"],
.setting-control input[type="text"] {
    width: 100%;
    background: #3d3d3d;
    border: 1px solid #4d4d4d;
    color: #fff;
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.setting-control select:hover,
.setting-control input[type="number"]:hover,
.setting-control input[type="text"]:hover {
    border-color: #6d6d6d;
}

.setting-control select:focus,
.setting-control input[type="number"]:focus,
.setting-control input[type="text"]:focus {
    border-color: #007acc;
    outline: none;
}

.setting-control input[type="checkbox"] {
    position: relative;
    width: 40px;
    height: 20px;
    appearance: none;
    background: #3d3d3d;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.setting-control input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    background: #858585;
    transition: all 0.2s ease;
}

.setting-control input[type="checkbox"]:checked {
    background: #007acc;
}

.setting-control input[type="checkbox"]:checked::before {
    left: 22px;
    background: #fff;
}

.settings-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease-out;
}

.settings-backdrop.visible {
    opacity: 1;
    visibility: visible;
    background: rgba(0, 0, 0, 0.5);
}

/* File tree styles */
.file-item {
    padding: 4px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-item:hover {
    background: #3d3d3d;
}

.file-icon {
    font-size: 14px;
}

/* Dragging tabs */
.tab.dragging {
    opacity: 0.5;
    cursor: move;
}

/* Settings styles */
.setting-item {
    margin: 12px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.setting-item label {
    color: #cccccc;
    flex: 1;
}

.setting-item input[type="number"],
.setting-item select {
    width: 100px;
    background: #3d3d3d;
    border: 1px solid #4d4d4d;
    color: #cccccc;
    padding: 4px;
    border-radius: 3px;
}

/* Smooth tab enter/exit animations */
@keyframes tabEnter {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tab close animation */
.tab.closing {
    animation: tabExit 0.2s ease-out forwards;
    pointer-events: none;
}

@keyframes tabExit {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

:root {
    --tab-active-bg: #1E1E1E;
    --tab-inactive-bg: #2D2D2D;
    --tab-border: #3D3D3D;
    --tab-active-border: #007ACC;
    --editor-bg: #1E1E1E;
}

.settings-btn, .new-tab-btn {
    background: var(--tab-inactive-bg);
    border: 1px solid var(--tab-border);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-btn:hover, .new-tab-btn:hover {
    background: var(--tab-active-bg);
}

/* Welcome Screen */
.welcome-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--editor-bg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
}

.welcome-content {
    max-width: 800px;
    width: 100%;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

/* Tutorial */
.tutorial-tooltip {
    position: fixed;
    background: var(--tab-active-bg);
    border: 1px solid var(--tab-border);
    border-radius: 6px;
    padding: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

/* Customizable Toolbar */
.toolbar-customizer {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--editor-bg);
    border: 1px solid var(--tab-border);
    border-radius: 6px;
    padding: 20px;
    z-index: 1000;
}

/* Quick Actions Menu */
.quick-actions-menu {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    background: var(--editor-bg);
    border: 1px solid var(--tab-border);
    border-radius: 6px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--editor-bg);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease-out;
}

.loading-screen.fade-out {
    opacity: 0;
}

.loading-content {
    text-align: center;
    color: #fff;
}

.loading-title {
    font-size: 32px;
    margin-bottom: 24px;
    font-weight: 300;
    letter-spacing: 2px;
    color: #fff;
    text-shadow: 0 0 10px #fff,
                 0 0 20px #fff,
                 0 0 30px #fff;
    animation: glowWhite 1.5s ease-in-out infinite alternate;
}

.loading-progress {
    width: 300px;
    height: 4px;
    background: #2d2d2d;
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto 24px;
}

.progress-bar {
    width: 0;
    height: 100%;
    background: var(--tab-active-border);
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.loading-author {
    font-size: 16px;
    color: #FFD700; /* Golden yellow */
    font-style: italic;
    margin-top: 16px;
    opacity: 0;
    text-shadow: 0 0 10px #FFD700,
                 0 0 20px #FFD700,
                 0 0 30px #FFD700;
    animation: fadeInAndGlow 0.5s ease-out 0.5s forwards;
}

@keyframes glowWhite {
    from {
        text-shadow: 0 0 10px #fff,
                     0 0 20px #fff,
                     0 0 30px #fff;
    }
    to {
        text-shadow: 0 0 20px #fff,
                     0 0 30px #fff,
                     0 0 40px #fff;
    }
}

@keyframes fadeInAndGlow {
    from {
        opacity: 0;
        transform: translateY(10px);
        text-shadow: 0 0 10px #FFD700,
                     0 0 20px #FFD700;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        text-shadow: 0 0 10px #FFD700,
                     0 0 20px #FFD700,
                     0 0 30px #FFD700;
    }
}