* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
}

body {
    background-color: #f5f5f5;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
}

h2 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: #34495e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.editor-wrapper {
    display: flex;
    gap: 20px;
}

.preview-section {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.editor-section {
    width: 350px;
}

.canvas-container {
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    height: 600px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#previewCanvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.template-selector {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.template-thumbnails {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.template-thumbnail {
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.template-thumbnail:hover {
    border-color: #3498db;
    transform: translateY(-2px);
}

.template-thumbnail.active {
    border-color: #2ecc71;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.3);
}

.template-thumbnail img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.template-thumbnail span {
    padding: 8px;
    text-align: center;
    font-size: 0.9rem;
    background-color: #ecf0f1;
}

.text-controls {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    height: 100%;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.control-group {
    margin-bottom: 15px;
}

.control-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.control-row .control-group {
    flex: 1;
    margin-bottom: 0;
}

label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: #7f8c8d;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.color-input {
    display: flex;
    gap: 10px;
    align-items: center;
}

.color-input input[type="text"] {
    flex: 1;
}

input[type="range"] {
    width: 100%;
    margin-top: 5px;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #2ecc71;
    cursor: pointer;
}

#rotationValue {
    display: inline-block;
    margin-left: 5px;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.buttons {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

button {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
}

.btn-download {
    background-color: #2ecc71;
    color: white;
}

.btn-download:hover {
    background-color: #27ae60;
}

.btn-reset {
    background-color: #e74c3c;
    color: white;
}

.btn-reset:hover {
    background-color: #c0392b;
}

.media-controls {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.media-controls h2 {
    margin-bottom: 12px;
}

.media-controls input[type="file"] {
    width: 100%;
    padding: 6px 0;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
    width: 100%;
    margin-bottom: 10px;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.85rem;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #34495e;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.hint {
    font-size: 0.8rem;
    color: #7f8c8d;
    margin: 0 0 8px;
    line-height: 1.35;
}

.slider-section {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed #d0d0d0;
}

.slider-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 10px;
    line-height: 1.3;
}

.surface-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
    padding: 4px;
    margin-bottom: 8px;
    background: #eee;
    border-radius: 6px;
}

.surface-thumb {
    position: relative;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    background: #2c3e50;
    aspect-ratio: 3 / 4;
    display: flex;
    align-items: center;
    justify-content: center;
}

.surface-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.surface-thumb-label {
    color: #ecf0f1;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px;
    text-align: center;
}

.surface-thumb:hover {
    border-color: #3498db;
}

.surface-thumb.active {
    border-color: #2ecc71;
    box-shadow: 0 0 0 1px rgba(46, 204, 113, 0.4);
}

@media (max-width: 1200px) {
    .editor-wrapper {
        flex-direction: column;
    }
    
    .editor-section {
        width: 100%;
    }
    
    .canvas-container {
        height: auto;
        max-height: 600px;
    }
}

@media (max-width: 768px) {
    .template-thumbnails {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 15px;
    }
}
body, button, input, select {
    font-family: 'Roboto', sans-serif;
}

/* Для лучшего отображения интерфейса */
body {
    font-weight: 400; /* Обычное начертание */
}

h1, h2, h3 {
    font-weight: 700; /* Жирное для заголовков */
}

.btn-download {
    font-weight: 500; /* Средней жирности для кнопок */
}