html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: sans-serif;
    overflow: hidden;
}

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

/* --- SIDEBAR --- */
.sidebar {
    width: 280px;
    background-color: #2d3748;
    color: white;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: margin-left 0.3s ease;
}

.sidebar.hidden {
    margin-left: -280px;
}

.sidebar-header {
    padding: 15px;
    background: #1a202c;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-toggle-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0 5px;
}

.sidebar-show-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 100;
    background: #2d3748;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 20px;
}

.sidebar-actions {
    padding: 10px;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    border-bottom: 1px solid #4a5568;
}

.sidebar-actions button {
    font-size: 12px;
    padding: 5px 8px;
    cursor: pointer;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.file-tree, .file-tree ul {
    list-style: none;
    padding-left: 15px;
    margin: 0;
}

.file-tree { padding-left: 0; }

.tree-item {
    margin-bottom: 2px;
}

.tree-item-content {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 4px;
}

.tree-item-content:hover {
    background-color: #4a5568;
}

.tree-item-content.active {
    background-color: #3182ce;
    color: white;
}

.tree-toggle {
    display: inline-block;
    width: 20px;
    text-align: center;
    cursor: pointer;
    margin-right: 5px;
    font-size: 10px;
}

.folder-icon::before { content: "📁 "; margin-right: 5px; }
.doc-icon::before { content: "📄 "; margin-right: 5px; }

/* **NEU: Lösch-Button Styling** */
.delete-btn {
    margin-left: auto;
    padding: 2px 6px;
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: 3px;
}

.delete-btn:hover {
    background-color: #ff4444;
}

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

/* --- EDITOR --- */
.editor-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    min-width: 0;
    position: relative;
}

/*
HIER: Titel-Abstand deutlich erhöht (70px padding-left).
Das sorgt dafür, dass der Button (der ca 40-50px breit ist)
den Text nicht verdeckt.
*/
#current-doc-title {
    margin: 0;
    padding: 15px 20px;
    padding-left: 70px !important; /* Deutlich mehr Abstand links */
    background: #f3f4f6;
    border-bottom: 1px solid #ddd;
    font-size: 1.2rem;
    color: #333;
}

.editor-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.tox-tinymce {
    flex: 1;
    border: none !important;
}
