* {
    font-family: 'Nunito', sans-serif;
}

.bg-gradient-main {
    background: linear-gradient(135deg, #FAFAF9 0%, #F0FDFA 50%, #FDF4FF 100%);
    min-height: 100vh;
}

.title-gradient {
    background: linear-gradient(135deg, #8B5CF6 0%, #06B6D4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mascot {
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.animate-wiggle {
    animation: wiggle 0.5s ease-in-out infinite;
}

.upload-zone {
    max-width: 500px;
    margin: 0 auto;
    padding: 60px 40px;
    border: 3px dashed #CBD5E1;
    border-radius: 24px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.upload-zone:hover,
.upload-zone.dragging {
    border-color: #06B6D4;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.image-card {
    background: white;
    border-radius: 24px;
    padding: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.image-label {
    position: absolute;
    top: 24px;
    left: 24px;
    padding: 8px 16px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    z-index: 10;
}

.image-label.before {
    background: linear-gradient(135deg, #F97316, #F59E0B);
    color: white;
}

.image-label.after {
    background: linear-gradient(135deg, #8B5CF6, #06B6D4);
    color: white;
}

.placeholder-area {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
    border-radius: 16px;
    min-height: 300px;
}

.sparkle-loader {
    width: 60px;
    height: 60px;
    border: 4px solid transparent;
    border-top-color: #8B5CF6;
    border-right-color: #06B6D4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-dots .dot {
    animation: bounce 1s infinite;
    display: inline-block;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.controls-section {
    background: white;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.color-swatch {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-swatch:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.color-swatch.selected {
    border-color: #1E293B;
    transform: scale(1.1);
}

.checkmark {
    color: white;
    font-weight: bold;
    font-size: 20px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.generate-btn {
    background: linear-gradient(135deg, #8B5CF6 0%, #06B6D4 100%);
    color: white;
    font-weight: 800;
    font-size: 18px;
    padding: 16px 40px;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.5);
}

.generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.download-btn {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    font-weight: 700;
    font-size: 16px;
    padding: 14px 32px;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.reset-btn {
    background: #F1F5F9;
    color: #64748B;
    font-weight: 700;
    font-size: 16px;
    padding: 14px 32px;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reset-btn:hover {
    background: #E2E8F0;
    color: #475569;
}

.error-message {
    background: linear-gradient(135deg, #FEF2F2 0%, #FEE2E2 100%);
    border: 2px solid #FECACA;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    color: #DC2626;
    font-weight: 600;
}

.retry-btn {
    margin-top: 12px;
    background: #DC2626;
    color: white;
    padding: 8px 20px;
    border-radius: 10px;
    border: none;
    font-weight: 700;
    cursor: pointer;
}

.history-section {
    background: white;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
}

.history-item {
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.history-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.history-item img {
    width: 100%;
    height: auto;
    display: block;
}

.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    top: -20px;
    border-radius: 3px;
    animation: confetti-fall 3s ease-out forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .upload-zone {
        padding: 40px 24px;
    }
    
    .upload-icon {
        font-size: 3rem;
    }
    
    .generate-btn,
    .download-btn,
    .reset-btn {
        width: 100%;
    }
    
    .color-swatch {
        width: 40px;
        height: 40px;
    }
}