#x3d-container {
    background: none;
}

#x3d-container.hidden {
    opacity: 0;
    height: 0;
    overflow: hidden;
}

.threejs-header {
    margin-bottom: 20px;
}

.x3dom-container, .threejs-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
    align-items: stretch; /* Растягиваем по высоте */
}

/* Стили для редактора кода */
.CodeMirror {
    flex-grow: 1;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    line-height: 1.5;
    border-radius: 4px;
    text-align: left !important;
}

/* Строки кода */
.CodeMirror-line {
  overflow-wrap: anywhere !important;
}


.preview-section, .code-section {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    min-height: 500px; /* Фиксированная минимальная высота */
}

#canvas-container {
    width: 100%;
    flex-grow: 1; /* Занимает всё доступное пространство */
    border-radius: 4px;
    min-height: 300px;
}

#content {
    white-space: pre-wrap;
    color: #000;
    font-size: 18px;
    text-align: justify;
    word-break: break-word;
    font-family: inherit;
}

#editor, #x3d-editor {
    width: 100%;
    height: 100%;
    min-height: 300px;
    font-family: 'Courier New', monospace;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: none;
    background: #282c34;
    color: #abb2bf;
    font-size: 14px;
    line-height: 1.5;
    overflow: auto; /* Включаем прокрутку */
}

/* Сам ползунок */
::-webkit-scrollbar {
    width: 8px; /* Толщина вертикального скролла */
    height: 8px; /* Толщина горизонтального скролла */
}

/* Трек (фон скролла) */
::-webkit-scrollbar-track {
    background: transparent;
}

/* Сам бегунок (ползунок) */
::-webkit-scrollbar-thumb {
    background-color: rgba(200, 200, 200, 0.3);
    border-radius: 4px;
    transition: background-color 0.3s;
}

/* При наведении на ползунок */
::-webkit-scrollbar-thumb:hover {
    background-color: rgba(200, 200, 200, 0.6);
}


/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .threejs-container {
        grid-template-columns: 1fr;
    }

    .x3dom-container {
        grid-template-columns: 1fr;
    }

    .preview-section, .code-section {
        min-height: auto;
    }
}


.controls, .post-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.controls button {
    background: #4CAF50;
    color: white;
    cursor: pointer;
}

.post-actions button, .controls button {
    padding: 4px 12px;
    font-size: 14px;
    border-radius: 8px;
    border: none;
}



.share-btn {
    background: #2196F3;
    color: white;
}

.comments-btn {
    background: #ff9800;
    color: white;
}

.comments-section {
    display: none;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 20px;
}

.post-description {
    grid-column: 1 / -1;
    padding: 20px;
    border-radius: 8px;
    line-height: 1.6;
}

.x3dom-canvas {
    border-radius: 4px;
}
