/* Custom styles for AI Portrait Generator */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

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

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

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

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

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(14, 165, 233, 0.3); }
    50% { box-shadow: 0 0 40px rgba(14, 165, 233, 0.5); }
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradient 3s ease infinite;
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #0ea5e9 0%, #d946ef 50%, #0ea5e9 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient 4s ease infinite;
}

/* Glassmorphism */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-dark {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Hover effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.02);
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(14, 165, 233, 0.3);
}

/* Custom scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #0ea5e9, #d946ef);
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #0284c7, #c026d3);
}

/* Loading spinner */
.spinner {
    border: 3px solid rgba(14, 165, 233, 0.1);
    border-radius: 50%;
    border-top: 3px solid #0ea5e9;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* Image placeholder styles */
.image-placeholder {
    background: linear-gradient(135deg, #e0f2fe 0%, #fae8ff 100%);
    animation: loading-shimmer 2s infinite linear;
}

@keyframes loading-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Modern button styles */
.btn-primary {
    @apply inline-flex items-center justify-center px-6 py-3 text-base font-semibold text-white rounded-xl transition-all duration-300;
    background: linear-gradient(135deg, #0ea5e9 0%, #d946ef 100%);
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.4);
}

.btn-secondary {
    @apply inline-flex items-center justify-center px-6 py-3 text-base font-semibold rounded-xl transition-all duration-300;
    background: #f1f5f9;
    color: #475569;
}

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

.btn-success {
    @apply inline-flex items-center justify-center px-6 py-3 text-base font-semibold text-white rounded-xl transition-all duration-300;
    background: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    @apply inline-flex items-center justify-center px-6 py-3 text-base font-semibold text-white rounded-xl transition-all duration-300;
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

/* Modern card styles */
.card {
    @apply bg-white rounded-2xl overflow-hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.card-hover {
    @apply transition-all duration-300;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.card-gradient {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(241, 245, 249, 0.9) 100%);
    backdrop-filter: blur(10px);
}

/* Modern form styles */
.form-input {
    @apply w-full px-4 py-3 rounded-xl transition-all duration-300;
    border: 2px solid #e2e8f0;
    background: #ffffff;
}

.form-input:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
    outline: none;
}

.form-textarea {
    @apply w-full px-4 py-3 rounded-xl transition-all duration-300 resize-none;
    border: 2px solid #e2e8f0;
    background: #ffffff;
}

.form-textarea:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
    outline: none;
}

/* Status message styles */
.status-success {
    @apply p-4 rounded-xl;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #6ee7b7;
    color: #047857;
}

.status-error {
    @apply p-4 rounded-xl;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fca5a5;
    color: #b91c1c;
}

.status-info {
    @apply p-4 rounded-xl;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #93c5fd;
    color: #1d4ed8;
}

.status-warning {
    @apply p-4 rounded-xl;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fcd34d;
    color: #b45309;
}

/* Modern badge styles */
.badge {
    @apply inline-flex items-center px-3 py-1 rounded-full text-xs font-semibold;
}

.badge-primary {
    background: linear-gradient(135deg, #e0f2fe 0%, #f0e7fe 100%);
    color: #0369a1;
}

.badge-success {
    background: #d1fae5;
    color: #047857;
}

.badge-warning {
    background: #fef3c7;
    color: #b45309;
}

.badge-danger {
    background: #fee2e2;
    color: #b91c1c;
}

/* Hide scrollbar utility for horizontal scrolling */
.hide-scrollbar {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;  /* Chrome, Safari and Opera */
}

/* Touch-friendly tap targets */
@media (max-width: 640px) {
    button, a, input, select, textarea {
        min-height: 44px;
    }
}

/* Responsive utilities */
@media (max-width: 640px) {
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1.125rem;
    }
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles */
.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.5);
}

*:focus-visible {
    outline: 2px solid #0ea5e9;
    outline-offset: 2px;
}

/* Selection styles */
::selection {
    background: rgba(14, 165, 233, 0.2);
    color: #0c4a6e;
}

/* Smooth page transitions */
.page-transition {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Toast notification styles */
.toast {
    @apply fixed z-50 px-6 py-4 rounded-xl shadow-2xl transform transition-all duration-300;
    backdrop-filter: blur(10px);
}

.toast-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.95) 0%, rgba(20, 184, 166, 0.95) 100%);
    color: white;
}

.toast-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95) 0%, rgba(249, 115, 22, 0.95) 100%);
    color: white;
}

.toast-info {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.95) 0%, rgba(139, 92, 246, 0.95) 100%);
    color: white;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Step indicator styles */
.step-indicator {
    @apply flex items-center gap-2;
}

.step-indicator .step {
    @apply w-10 h-10 rounded-full flex items-center justify-center text-sm font-bold transition-all duration-300;
}

.step-indicator .step.active {
    background: linear-gradient(135deg, #0ea5e9 0%, #d946ef 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
}

.step-indicator .step.completed {
    background: #10b981;
    color: white;
}

.step-indicator .step.pending {
    background: #e2e8f0;
    color: #64748b;
}

.step-indicator .connector {
    @apply h-1 flex-1 rounded-full;
    background: #e2e8f0;
}

.step-indicator .connector.completed {
    background: linear-gradient(90deg, #0ea5e9, #d946ef);
}

/* Upload drop zone */
.drop-zone {
    @apply relative border-2 border-dashed rounded-2xl p-12 text-center transition-all duration-300;
    border-color: #cbd5e1;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: #0ea5e9;
    background: rgba(14, 165, 233, 0.05);
}

.drop-zone.drag-over {
    transform: scale(1.02);
    box-shadow: 0 0 30px rgba(14, 165, 233, 0.2);
}

/* Image comparison slider */
.comparison-slider {
    @apply relative overflow-hidden rounded-2xl;
}

.comparison-slider .before,
.comparison-slider .after {
    @apply absolute inset-0;
}

.comparison-slider .slider-handle {
    @apply absolute top-0 bottom-0 w-1 bg-white cursor-ew-resize;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

/* Modal backdrop */
.modal-backdrop {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
}

/* Noise texture overlay */
.noise-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
}
