* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #64748b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --error-color: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    text-align: center;
    padding: 40px 0;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
}

.subtitle {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
}

.main-content {
    flex: 1;
}

.upload-section {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

.upload-area {
    background: var(--card-bg);
    border: 2px dashed var(--border-color);
    border-radius: 20px;
    padding: 60px 80px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-xl);
    max-width: 600px;
    width: 100%;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: #fafbff;
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: #eef2ff;
    transform: scale(1.02);
}

.upload-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    color: var(--primary-color);
}

.upload-icon svg {
    width: 100%;
    height: 100%;
}

.upload-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.processing-section {
    display: flex;
    justify-content: center;
    padding: 60px 0;
}

.processing-content {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 60px 80px;
    text-align: center;
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 100%;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.processing-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #8b5cf6);
    border-radius: 4px;
    animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

.result-section {
    padding: 20px 0;
}

.result-content {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-xl);
}

.image-compare {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.image-container {
    position: relative;
    width: 100%;
    max-width: 350px;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    background: #f1f5f9;
    box-shadow: var(--shadow-md);
}

.image-container.transparent-bg {
    background-image:
        linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
        linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
        linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.image-label {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    z-index: 10;
}

.arrow-container {
    color: var(--primary-color);
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.arrow-container svg {
    width: 100%;
    height: 100%;
}

.action-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn svg {
    width: 20px;
    height: 20px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: #e2e8f0;
    border-color: var(--secondary-color);
}

.error-section {
    display: flex;
    justify-content: center;
    padding: 60px 0;
}

.error-content {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 60px 80px;
    text-align: center;
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 100%;
}

.error-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    color: var(--error-color);
}

.error-icon svg {
    width: 100%;
    height: 100%;
}

.error-text {
    font-size: 1.125rem;
    color: var(--error-color);
    margin-bottom: 24px;
}

.footer {
    text-align: center;
    padding: 40px 0 20px;
}

.features {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.feature {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9375rem;
    font-weight: 500;
}

.feature svg {
    width: 20px;
    height: 20px;
}

.copyright {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
}

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

    .title {
        font-size: 1.75rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .upload-area {
        padding: 40px 30px;
    }

    .result-content {
        padding: 24px;
    }

    .image-compare {
        gap: 20px;
    }

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

    .processing-content,
    .error-content {
        padding: 40px 30px;
    }

    .features {
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.5rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}