* {
    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: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    color: #333;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header p {
    color: #666;
    font-size: 1.1rem;
}

.upload-section {
    margin-bottom: 40px;
}

.upload-area {
    border: 3px dashed #ddd;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.upload-area.dragover {
    border-color: #667eea;
    background: #e0e8ff;
}

.upload-icon {
    color: #667eea;
    margin-bottom: 20px;
}

.upload-text {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 10px;
}

.upload-subtext {
    color: #999;
    font-size: 0.9rem;
}

.requirements {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
}

.requirements h3 {
    color: #333;
    margin-bottom: 15px;
}

.requirements ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
}

.requirements li {
    color: #666;
    padding: 5px 0;
}

.processing-section {
    margin-top: 40px;
}

.preview-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.preview-box {
    text-align: center;
}

.preview-box h3 {
    color: #333;
    margin-bottom: 15px;
}

.canvas-container {
    position: relative;
    display: inline-block;
}

.head-outline-overlay {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 10;
    border-radius: 10px;
}

.preview-box canvas {
    border: 2px solid #ddd;
    border-radius: 10px;
    width: 400px;
    height: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#processedCanvas {
    cursor: move;
}

#originalCanvas {
    cursor: default;
}

.drag-hint {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.85rem;
    color: #999;
    white-space: nowrap;
}

.arrow {
    font-size: 2rem;
    color: #667eea;
    font-weight: bold;
}

.adjustment-controls {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.control-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    color: #333;
    font-size: 0.9rem;
}

.control-label {
    font-weight: 500;
    white-space: nowrap;
}

.control-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.adjustment-controls input[type="range"] {
    width: 150px;
    vertical-align: middle;
}

.adjustment-controls #brightnessValue {
    display: inline-block;
    width: 50px;
    text-align: left;
    color: #667eea;
    font-weight: bold;
}

/* Toggle Switch Styling */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    cursor: pointer;
}

.toggle-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 24px;
    transition: 0.3s;
    cursor: pointer;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.toggle-switch input:disabled + .toggle-slider {
    background-color: #999;
    cursor: not-allowed;
}

.toggle-switch input:disabled + .toggle-slider:before {
    background-color: #ddd;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-small:hover {
    background: #5a6268;
}

.zoom-info {
    margin: 10px 0;
    text-align: center;
}

.zoom-info span {
    font-weight: bold;
    color: #667eea;
}

.zoom-info small {
    display: block;
    color: #999;
    margin-top: 5px;
    font-size: 0.8rem;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    color: #333;
    white-space: nowrap;
}

.actions {
    text-align: center;
    margin-top: 30px;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.status-message {
    text-align: center;
    padding: 10px;
    margin-top: 20px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .preview-container {
        flex-direction: column;
    }

    .arrow {
        transform: rotate(90deg);
    }

    .requirements ul {
        grid-template-columns: 1fr;
    }
}