/* SpacesEditor - Haupt-Editor-Styles */

.spaces-editor {
    min-height: 100vh;
    background: var(--bg);
    padding: 0;
    max-width: 100%;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden; /* Verhindert horizontales Scrollen */
}

.spaces-editor-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: var(--space-4);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.spaces-editor-status {
    position: fixed;
    top: var(--space-4);
    right: var(--space-4);
    padding: var(--space-2) var(--space-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    font-size: var(--body);
    color: var(--muted);
    box-shadow: var(--shadow);
    z-index: 1000;
}

.spaces-editor-status span {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* Space Title Styles */
.spaces-editor-title-container {
    margin-bottom: var(--space-6);
    padding: var(--space-4) var(--space-4);
    border-bottom: 1px solid var(--border);
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
}

.spaces-editor-title-display {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.spaces-editor-title {
    font-size: var(--h1);
    font-weight: 600;
    color: var(--text);
    margin: 0;
    cursor: pointer;
    flex: 1;
    padding: var(--space-2) 0;
    border: 2px solid transparent;
    border-radius: var(--r-sm);
    transition: all 0.2s ease;
}

.spaces-editor-title:hover {
    background: var(--bg-hover);
    border-color: var(--border);
}

.spaces-editor-title-edit-btn {
    background: none;
    border: none;
    font-size: var(--body);
    cursor: pointer;
    padding: var(--space-2);
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.spaces-editor-title-edit-btn:hover {
    opacity: 1;
}

.spaces-editor-title-edit {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.spaces-editor-title-input {
    flex: 1;
    font-size: var(--h1);
    font-weight: 600;
    color: var(--text);
    background: var(--surface);
    border: 2px solid var(--primary);
    border-radius: var(--r-sm);
    padding: var(--space-2) var(--space-3);
    outline: none;
}

.spaces-editor-title-actions {
    display: flex;
    gap: var(--space-2);
}

.spaces-editor-title-save,
.spaces-editor-title-cancel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: var(--space-2) var(--space-3);
    cursor: pointer;
    font-size: var(--body);
    transition: all 0.2s ease;
}

.spaces-editor-title-save:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.spaces-editor-title-cancel:hover {
    background: var(--error);
    color: white;
    border-color: var(--error);
}

.editor-content {
    background: transparent;
    border-radius: 0;
    padding: 0;
    padding-right: var(--space-3); /* Minimaler Abstand rechts */
    box-shadow: none;
    min-height: 400px;
    direction: ltr; /* Links nach Rechts */
    text-align: left; /* Text linksbündig */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden; /* Verhindert horizontales Scrollen */
}

/* Wenn Sidebar collapsed (60px) */
.sidebar.collapsed ~ .main-content .spaces-editor-title-container {
    width: 100%;
    max-width: 100%;
}

@media (max-width: 768px) {
    .spaces-editor-title-container {
        padding: var(--space-3) var(--space-2);
    }
}

/* Block Picker Styles sind jetzt in BlockPicker.css */

