* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #ff00ff, #8a2be2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header p {
    font-size: 1.1rem;
    color: #666;
    font-weight: 300;
}

/* Upload Section */
.upload-section {
    margin-bottom: 30px;
}

.upload-area {
    border: 3px dashed #ddd;
    border-radius: 15px;
    padding: 60px 40px;
    text-align: center;
    background: #fafafa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #ff00ff;
    background: #f8f0ff;
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: #ff00ff;
    background: #f0e6ff;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.upload-content h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.upload-content p {
    color: #666;
    font-size: 1.1rem;
}

.browse-link {
    color: #ff00ff;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
}

.browse-link:hover {
    color: #cc00cc;
}

/* Controls Section */
.controls-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.color-picker-container, .threshold-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.color-picker-container label {
    font-weight: 500;
    color: #333;
}

#bgColor {
    width: 60px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.color-name {
    background: #ff00ff;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.threshold-container {
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.threshold-container label {
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
}

#alphaThreshold {
    width: 120px;
    margin: 0;
}

.threshold-value {
    background: #007bff;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    min-width: 20px;
    text-align: center;
}

.threshold-container small {
    color: #666;
    font-size: 0.75rem;
    margin-top: 2px;
}



.size-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.size-container label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
}

#originalSize {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-tertiary {
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(45deg, #ff00ff, #8a2be2);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 0, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 255, 0.4);
}

.btn-secondary {
    background: #28a745;
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-secondary:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-tertiary {
    background: #6c757d;
    color: white;
}

.btn-tertiary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Preview Section */
.preview-section {
    text-align: center;
}

.batch-info {
    background: #e3f2fd;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    border-left: 5px solid #2196f3;
}

.batch-info h3 {
    color: #1565c0;
    margin-bottom: 10px;
}

.batch-info p {
    color: #0d47a1;
    font-weight: 500;
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.image-pair {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.image-pair h4 {
    margin-bottom: 15px;
    color: #333;
    font-weight: 500;
    font-size: 0.9rem;
    text-align: center;
}

.image-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.image-container {
    text-align: center;
}

.image-container h5 {
    margin-bottom: 10px;
    color: #666;
    font-weight: 400;
    font-size: 0.8rem;
}

canvas {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.image-download {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.btn-small {
    padding: 6px 15px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.download-section {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: #666;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .upload-area {
        padding: 40px 20px;
    }
    
    .controls-section {
        flex-direction: column;
        gap: 20px;
    }
    
    .image-comparison {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .download-section {
        flex-direction: column;
        align-items: center;
    }
}

/* Loading Animation */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    margin: -25px 0 0 -25px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ff00ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
} 