* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 10px;
    font-size: 2.5em;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

.upload-section {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    margin-bottom: 30px;
    background: #f8f9ff;
    transition: all 0.3s ease;
}

.upload-section:hover {
    border-color: #764ba2;
    background: #f0f2ff;
}

.upload-section.dragover {
    border-color: #764ba2;
    background: #e8ebff;
}

input[type="file"] {
    display: none;
}

.upload-btn {
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    margin: 10px;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.upload-btn:active {
    transform: translateY(0);
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

.image-panel {
    background: #f8f9ff;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.image-panel h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.image-wrapper {
    position: relative;
    width: 100%;
    min-height: 300px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-wrapper img,
.image-wrapper canvas {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.controls-toggle-container {
    margin-top: 20px;
    text-align: center;
}

.controls-panel {
    background: #f8f9ff;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    display: none;
}

.controls-panel.visible {
    display: block;
}

.controls-panel h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.filter-group {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.filter-group:last-child {
    border-bottom: none;
}

.filter-group h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.control-item {
    margin-bottom: 15px;
}

.control-item label {
    display: block;
    margin-bottom: 8px;
    color: #666;
    font-weight: 500;
    font-size: 14px;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    transition: background 0.2s;
}

.slider::-webkit-slider-thumb:hover {
    background: #764ba2;
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.slider::-moz-range-thumb:hover {
    background: #764ba2;
}

.value-display {
    min-width: 50px;
    text-align: right;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.random-filter-container {
    margin-top: 20px;
    text-align: center;
}

.random-filter-container .btn {
    padding: 15px 40px;
    font-size: 16px;
    min-width: 200px;
}

.hidden {
    display: none;
}

@media (max-width: 968px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 20px;
    }

    h1 {
        font-size: 2em;
    }
}

