* {
    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%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    padding: 20px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    font-weight: 800;
    letter-spacing: -1px;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

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

.upload-area {
    background: white;
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 3px dashed #667eea;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s;
}

.upload-area:hover::before {
    left: 100%;
}

.upload-area:hover {
    border-color: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.upload-area.dragover {
    border-color: #764ba2;
    background: #f8f9ff;
    transform: scale(1.02);
}

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

.upload-content h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.upload-content p {
    color: #666;
    font-size: 0.9rem;
}

.preview-section {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.transform-options {
    margin-bottom: 40px;
    padding: 35px;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.1);
}

.options-title {
    text-align: center;
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 25px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    max-width: 800px;
    margin: 0 auto;
}

.option-card {
    background: white;
    border: 3px solid #e8eaf6;
    border-radius: 16px;
    padding: 35px 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    outline: none;
}

.option-card:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.option-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.option-card:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.2);
}

.option-card:hover::before {
    transform: scaleX(1);
}

.option-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.25);
}

.option-card.selected::before {
    transform: scaleX(1);
}

.option-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
    display: block;
    transition: transform 0.3s ease;
}

.option-card:hover .option-icon {
    transform: scale(1.1) rotate(5deg);
}

.option-card h4 {
    color: #333;
    font-size: 1.3rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.option-card p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

.image-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.image-box {
    display: flex;
    flex-direction: column;
}

.image-box h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2rem;
    text-align: center;
}

.image-box img {
    width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    max-height: 600px;
    object-fit: contain;
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-box img:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.18);
}

.result-container {
    width: 100%;
    min-height: 400px;
    border-radius: 12px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.loading-spinner {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 8px;
    font-weight: 500;
}

.loading-subtext {
    font-size: 0.9rem;
    color: #666;
}

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

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

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

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.status-message {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    display: none;
}

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

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

.status-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    display: block;
}

@media (max-width: 768px) {
    .image-container {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 2rem;
    }

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

