.main-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.controls-panel {
    flex: 0 0 320px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.control-section {
    background: #ffffff;
    border-radius: 20px;
    padding: 24px;
    border: 2px solid #f0f0f0;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.control-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #ff6b8b;
    margin-bottom: 16px;
}

.control-group {
    width: 100%;
    margin-bottom: 20px;
}

.control-group:last-child {
    margin-bottom: 0;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.upload-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #2c3e50;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.upload-btn:hover {
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,107,139,0.3);
}

input[type="file"] {
    display: none;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #f0f0f0;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff6b8b;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(255,107,139,0.3);
    transition: transform 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.value-display {
    font-size: 13px;
    color: #777;
    text-align: center;
    margin-top: 8px;
    font-weight: 500;
}

.toggle-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.toggle-btn {
    flex: 1;
    min-width: 100px;
    padding: 10px 15px;
    background: #f9f9f9;
    color: #555;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-btn.active {
    background: #ff6b8b;
    color: white;
    border-color: #ff6b8b;
}

.toggle-btn:hover {
    background: #fef7ff;
    color: #ff6b8b;
}

.toggle-btn.active:hover {
    background: #ff4776;
}

.action-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #2c3e50;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,107,139,0.3);
}

.continue-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #2c3e50;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.continue-btn:hover {
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,107,139,0.3);
}

.stats-panel {
    background: #ffffff;
    border-radius: 20px;
    padding: 30px;
    border: 2px solid #f0f0f0;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.stats-panel:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border-color: #ff6b8b;
}

.stats-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stats-item {
    background: #fef7ff;
    padding: 20px 15px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.3s ease;
}

.stats-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: #ff6b8b;
}

.color-list-wrapper {
    margin-top: 25px;
    background: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e0e0e0;
}

.color-list-wrapper h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 500;
}

.stats-label {
    color: #777;
    font-size: 12px;
    font-weight: 500;
}

.stats-value {
    color: #ff6b8b;
    font-weight: 600;
    font-size: 18px;
}

.color-list {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 15px;
    border-radius: 6px;
    padding: 10px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
}

.color-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    gap: 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.color-item:hover {
    background: #f0f0f0;
    transform: translateX(3px);
}

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.color-item:hover .color-swatch {
    transform: scale(1.1);
}

.color-info {
    flex: 1;
    font-size: 14px;
}

.color-code {
    font-weight: 500;
    color: #2c3e50;
}

.color-count {
    color: #777;
    margin-left: 8px;
    font-size: 13px;
}

.canvas-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.canvas-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.canvas-wrapper {
    flex: 1;
    min-width: 350px;
    text-align: center;
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.canvas-wrapper:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

h3 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 500;
}

canvas {
    border: 2px solid #f0f0f0;
    border-radius: 8px;
    max-width: 100%;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

canvas:hover {
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.canvas-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 2px dashed #e0e0e0;
    transition: all 0.3s ease;
}

.canvas-placeholder:hover {
    background: #f0f0f0;
    border-color: #3498db;
    transform: scale(1.02);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 2px dashed #e0e0e0;
    transition: all 0.3s ease;
    cursor: pointer;
    width: 100%;
}

.upload-placeholder:hover {
    background: #f0f0f0;
    border-color: #3498db;
    transform: scale(1.02);
}

.placeholder-icon {
    font-size: 40px;
    margin-bottom: 15px;
    color: #3498db;
}

.placeholder-text {
    font-size: 16px;
    font-weight: 500;
    color: #555;
    margin-bottom: 8px;
}

.placeholder-subtext {
    font-size: 14px;
    color: #777;
    text-align: center;
    padding: 0 20px;
}

.placeholder-note {
    font-size: 10px;
    color: #666;
    text-align: center;
    padding: 0 20px;
    margin-top: 8px;
    font-style: italic;
}

#preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
}

#preview-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease-in-out;
}

#preview-modal .modal-content {
    background: white;
    border-radius: 15px;
    padding: 20px;
    max-width: 95%;
    max-height: 95%;
    overflow: auto;
    position: relative;
    animation: slideIn 0.3s ease-in-out;
}

#preview-modal .modal-stats {
    margin-top: 40px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

#preview-modal .stats-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

#preview-modal .stats-row:last-child {
    margin-bottom: 0;
}

#preview-modal .modal-stats .stats-label {
    color: #777;
    font-size: 14px;
    font-weight: 500;
}

#preview-modal .modal-stats .stats-value {
    color: #3498db;
    font-weight: 600;
    font-size: 14px;
}

#preview-modal .modal-pixel-control {
    margin-top: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

#preview-modal .modal-pixel-control label {
    font-size: 14px;
    font-weight: 500;
    color: #555;
    margin-bottom: 5px;
}

#preview-modal .modal-actions {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

#preview-modal .modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.3s;
}

#preview-modal .modal-close:hover {
    transform: scale(1.1);
}

#preview-modal .preview-image {
    max-width: 100%;
    height: auto;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}
