/* Основные стили */
body {
    background: #f0f2f5;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px 0;
}

/* Центрированный контейнер */
.container {
    max-width: 1115px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Карточки */
.card {
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: none;
    background: white;
    overflow: hidden;
}

.card-header {
    background: white;
    border-bottom: 1px solid #e9ecef;
    padding: 12px 20px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* ===== Изображения ===== */
.image-wrapper {
    position: relative;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

#originalImage {
    width: 100%;
    height: auto;
    display: block;
}

#mosaicCanvas {
    width: 100%;
    height: auto;
    display: block;
    background: #f8f9fa;
    border-radius: 4px;
}

/* ===== Палитра цветов ===== */
#colorPalette {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0;
}

.color-palette-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 10px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    transition: background 0.15s ease;
    cursor: default;
    min-width: 200px;
}

.color-palette-item:hover {
    background: #e9ecef;
}

.color-box {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    flex-shrink: 0;
}

.color-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.3;
}

.color-hex {
    font-weight: 600;
    color: #333;
    font-size: 0.8rem;
    font-family: 'Courier New', monospace;
}

.color-count {
    color: #6c757d;
    font-size: 0.75rem;
}

/* ===== Настройки ===== */
.settings-group {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.settings-label {
    font-weight: 600;
    min-width: 100px;
    margin-bottom: 0;
    font-size: 0.9rem;
}

.settings-slider {
    flex: 1;
    min-width: 150px;
}

.settings-input {
    width: 70px;
    text-align: center;
    flex-shrink: 0;
}

/* ===== Спиннер ===== */
#loadingOverlay {
    background: rgba(255, 255, 255, 0.75);
    border-radius: 8px;
}

/* ===== Кнопка сброса ===== */
#resetSettingsBtn {
    border-radius: 8px;
    border: 2px dashed #ced4da;
    background: transparent;
    font-weight: 600;
    font-size: 0.9rem;
    color: #6c757d;
    transition: all 0.25s ease;
    min-height: 80px;
    padding: 10px 15px;
    white-space: nowrap;
}

#resetSettingsBtn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    border-style: solid;
    color: #495057;
    transform: scale(1.02);
}

#resetSettingsBtn:active {
    transform: scale(0.97);
}

#resetSettingsBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 768px) {
    .col-md-10,
    .col-md-2 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .col-md-2 {
        margin-top: 15px;
    }
    
    #resetSettingsBtn {
        min-height: 50px;
        white-space: normal;
        font-size: 0.85rem;
        padding: 8px 20px;
        width: 100%;
    }

    .row.align-items-stretch {
        align-items: flex-start;
    }
}
