* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1e1e1e;
    color: #e0e0e0;
    line-height: 1.6;
    overflow: hidden;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
}

.Vinsta{
    width: 150px;
    height: auto;

}

h1 {
    font-size: 24px;
    font-weight: 300;
}

.controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

button {
    background-color: #333;
    color: #e0e0e0;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
}

button:hover {
    background-color: #444;
}

select {
    background-color: #333;
    color: #e0e0e0;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
}

main {
    display: flex;
    gap: 15px;
    flex: 1;
    overflow: hidden;
}

.left-panel {
    width: 220px;
    background-color: #2d2d2d;
    border-radius: 4px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.canvas-container {
    flex: 1;
    background-color: #2d2d2d;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    position: relative;
    min-width: 0;
}

#canvas {
    max-width: 100%;
    max-height: 100%;
    background-color: #3d3d3d;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    cursor: move;
}

.canvas-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    pointer-events: none;
    border: 1px dashed #666;
    display: none;
}

.selection-outline {
    position: absolute;
    border: 2px solid #4a9eff;
    pointer-events: none;
    display: none;
    box-shadow: 0 0 0 1px rgba(74, 158, 255, 0.3);
}

.brush-cursor {
    position: absolute;
    border-radius: 50%;
    border: 2px solid #ffffff;
    pointer-events: none;
    display: none;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.right-panel {
    width: 200px;
    background-color: #2d2d2d;
    border-radius: 4px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.panel-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.panel-section.compact-section {
    gap: 6px;
}

.panel-section h3 {
    font-size: 14px;
    font-weight: 400;
    padding-bottom: 6px;
    border-bottom: 1px solid #333;
    margin-bottom: 5px;
    word-wrap: break-word;
}

/* Стили для заголовка с переключателем */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-toggle {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #555;
    transition: .4s;
    border-radius: 20px;
}

.slider-toggle:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider-toggle {
    background-color: #4a9eff;
}

input:checked + .slider-toggle:before {
    transform: translateX(20px);
}

/* PBR Controls */
.pbr-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pbr-type-selector {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.pbr-type-selector label {
    font-size: 11px;
    color: #ccc;
}

.pbr-type-selector select {
    font-size: 12px;
    padding: 5px 6px;
    height: 26px;
}

.pbr-sliders {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.pbr-sliders .input-group.compact {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.pbr-sliders .input-group.compact label {
    font-size: 11px;
    color: #ccc;
}

.slider {
    width: 100%;
    height: 6px;
    background: #444;
    border-radius: 3px;
    outline: none;
    margin: 2px 0;
}

.slider::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    background: #4a9eff;
    border-radius: 50%;
    cursor: pointer;
}

.pbr-sliders .input-group.compact span {
    font-size: 10px;
    color: #aaa;
    text-align: center;
}

.pbr-buttons {
    display: flex;
    gap: 6px;
    margin-top: 3px;
}

.pbr-buttons .compact-btn {
    flex: 1;
    padding: 5px 6px;
    font-size: 11px;
    height: 24px;
}

.pbr-info {
    margin-top: 3px;
}

.pbr-info small {
    font-size: 9px;
    color: #888;
    line-height: 1.2;
    display: block;
}

/* Texture Tools Controls */
.texture-tools-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.brush-type-selector {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.brush-type-selector label {
    font-size: 11px;
    color: #ccc;
}

.brush-type-selector select {
    font-size: 12px;
    padding: 5px 6px;
    height: 26px;
}

.brush-controls {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.brush-controls .input-group.compact {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.brush-controls .input-group.compact label {
    font-size: 11px;
    color: #ccc;
}

.brush-controls .input-group.compact span {
    font-size: 10px;
    color: #aaa;
    text-align: center;
}

.color-picker-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.color-picker-row label {
    font-size: 11px;
    color: #ccc;
}

.color-picker-small {
    display: flex;
    align-items: center;
    gap: 8px;
}

#brushColor {
    width: 25px;
    height: 25px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    padding: 0;
}

.color-preview-small {
    width: 25px;
    height: 25px;
    border-radius: 3px;
    border: 1px solid #444;
    background-color: #000000;
}

.brush-specific-controls {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 3px;
}

.brush-buttons {
    margin-top: 3px;
}

.brush-buttons .compact-btn {
    width: 100%;
    padding: 5px 6px;
    font-size: 11px;
    height: 24px;
}

.input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 5px;
}

.input-group.compact {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.input-group.compact label {
    font-size: 11px;
    color: #ccc;
    word-wrap: break-word;
}

.input-group.compact input {
    background-color: #3d3d3d;
    border: 1px solid #444;
    border-radius: 3px;
    padding: 4px 5px;
    color: #e0e0e0;
    font-size: 12px;
    height: 26px;
    min-width: 0;
}

.compact-btn {
    padding: 5px 8px;
    font-size: 12px;
    width: 100%;
    margin-top: 2px;
    height: 26px;
}

.resolution-controls,
.transform-controls {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Специальные стили для трансформации */
.transform-controls .position-row,
.transform-controls .size-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.transform-controls .rotation-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 8px;
}

.transform-controls .position-row .input-group.compact,
.transform-controls .size-row .input-group.compact {
    flex: 1;
}

.presets {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.preset-btn.compact {
    width: 100%;
    text-align: center;
    font-size: 11px;
    padding: 5px 8px;
}

.layers-panel {
    width: 250px;
    background-color: #2d2d2d;
    border-radius: 4px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.layers-panel h2 {
    font-size: 16px;
    font-weight: 300;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #333;
}

.layers-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 12px;
}

.layer-item {
    background-color: #3d3d3d;
    border-radius: 4px;
    padding: 8px;
    margin-bottom: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
    position: relative;
}

.layer-item.selected {
    border-color: #4a9eff;
    background-color: #404040;
}

.layer-item.selected::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 3px;
    height: 100%;
    background-color: #ffffff;
    border-radius: 0 2px 2px 0;
}

.layer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 5px;
}

.layer-name {
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    cursor: pointer;
    min-width: 0;
}

.layer-controls {
    display: flex;
    gap: 3px;
    flex-shrink: 0;
}

.layer-controls button {
    padding: 2px 4px;
    font-size: 10px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.layer-bottom-controls {
    display: flex;
    gap: 3px;
    justify-content: space-between;
    margin-top: 3px;
}

.layer-bottom-controls button {
    padding: 2px 4px;
    font-size: 10px;
    flex: 1;
}

.opacity-control {
    display: flex;
    align-items: center;
    gap: 6px;
}

.opacity-control span {
    font-size: 10px;
    color: #ccc;
    white-space: nowrap;
}

.opacity-control input {
    flex: 1;
    min-width: 0;
}

.layer-visible {
    opacity: 1;
}

.layer-hidden {
    opacity: 0.5;
}

#addLayerBtn {
    width: 100%;
    background-color: #444;
    padding: 6px 10px;
    font-size: 12px;
}

#addLayerBtn:hover {
    background-color: #555;
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #2d2d2d;
    padding: 20px;
    border-radius: 8px;
    width: 300px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.modal-content h3 {
    margin-bottom: 15px;
    font-weight: 300;
    text-align: center;
}

.color-picker-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

#colorPicker {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.color-preview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid #444;
}

.modal-content input[type="text"] {
    width: 100%;
    padding: 8px;
    margin-bottom: 15px;
    background-color: #3d3d3d;
    border: 1px solid #444;
    border-radius: 4px;
    color: #e0e0e0;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

/* Стили для скроллбара */
.layers-list::-webkit-scrollbar {
    width: 5px;
}

.layers-list::-webkit-scrollbar-track {
    background: #2d2d2d;
    border-radius: 2px;
}

.layers-list::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 2px;
}

.layers-list::-webkit-scrollbar-thumb:hover {
    background: #666;
}