body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f9;
    color: #333;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    color: #2c3e50;
}

.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.control-group label {
    font-weight: bold;
}

.control-group input, .control-group button {
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.control-group button {
    background-color: #2c3e50;
    color: white;
    cursor: pointer;
}

.control-group button:hover {
    background-color: #34495e;
}

/* Стили для контейнера предпросмотра */
.preview {
    margin-top: 20px;
    padding: 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-align: center;
    position: relative;
    margin-bottom: 20px; /* Отступ между предпросмотром и миниатюрами */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Тень для выделения */
}

.preview canvas {
    border: 1px solid #ccc;
    max-width: 100%; /* Ограничение ширины canvas */
    height: auto;
}

/* Стили для контейнера миниатюр */
.thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 20px;
    background-color: #f9f9f9; /* Легкий фон для контраста */
    border: 1px solid #eee; /* Более светлая граница */
    border-radius: 5px;
}

.thumbnail {
    position: relative;
    border: 1px solid #ccc;
    padding: 5px;
    background-color: #fff;
    cursor: pointer;
    width: calc(20% - 10px); /* 5 изображений в ряду */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s; /* Анимация при наведении */
}

.thumbnail:hover {
    transform: scale(1.05); /* Увеличение при наведении */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Тень при наведении */
}

.thumbnail img {
    max-width: 100%;
    height: auto;
}

.thumbnail .caption {
    text-align: center;
    font-size: 12px;
    margin-top: 5px;
}

.thumbnail.disabled img {
    filter: grayscale(100%);
    opacity: 0.5;
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2c3e50;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.description {
    margin-top: 40px;
    padding: 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.description h2 {
    color: #2c3e50;
}

.description p, .description ol, .description ul {
    line-height: 1.6;
}
