/* Paint-themed Custom Styles */

/* Animation Delays */
.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-4000 {
    animation-delay: 4s;
}

/* Custom Border Width */
.border-3 {
    border-width: 3px;
}

/* Paint Splatter Background Pattern */
.paint-pattern {
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255, 107, 107, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(78, 205, 196, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 217, 61, 0.1) 0%, transparent 50%);
}

/* Autocomplete Suggestions */
.suggestions-dropdown {
    display: none;
    /* Enable smooth scrolling on mobile */
    -webkit-overflow-scrolling: touch;
    /* Prevent dropdown from being affected by touch events that bubble up */
    touch-action: pan-y;
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.suggestion-item:hover {
    background: linear-gradient(to right, #eff6ff, #dbeafe);
    padding-left: 20px;
}

.suggestion-item.selected {
    background: linear-gradient(to right, #dbeafe, #bfdbfe);
    border-left: 4px solid #2563eb;
    font-weight: 500;
}

.suggestion-item .color-preview {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: inline-block;
    margin-right: 12px;
    vertical-align: middle;
    border: 2px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.suggestion-item .color-name {
    font-weight: 500;
    color: #1f2937;
}

.suggestion-item .color-code {
    color: #6b7280;
    font-size: 0.875rem;
    margin-left: 8px;
}

/* Loading States */
.loading {
    display: none;
}

.error {
    display: none;
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border: 2px solid #f87171;
    border-radius: 12px;
    padding: 16px;
    color: #991b1b;
    font-weight: 500;
}

/* Image Display */
.preview-image, .result-image {
    display: none;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

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

/* Paint Drip Effect */
.paint-drip {
    position: relative;
}

.paint-drip::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 20px;
    background: currentColor;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: drip 2s ease-in-out infinite;
}

@keyframes drip {
    0%, 100% {
        transform: translateX(-50%) translateY(0) scaleY(1);
    }
    50% {
        transform: translateX(-50%) translateY(5px) scaleY(1.2);
    }
}

/* Brush Stroke Button Effect */
.brush-stroke {
    position: relative;
    overflow: hidden;
}

.brush-stroke::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.brush-stroke:hover::before {
    left: 100%;
}

/* Color Swatch Hover Effect */
.color-swatch {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.color-swatch:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

/* Paint Blob Animation Enhancement */
@keyframes blob-float {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    33% {
        transform: translate(30px, -30px) scale(1.05) rotate(120deg);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.95) rotate(240deg);
    }
}

/* Form Input Focus States */
input:focus, select:focus, textarea:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #2563eb, #3b82f6);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #1d4ed8, #2563eb);
}

/* Mobile Responsive Adjustments */
@media (max-width: 640px) {
    .suggestion-item {
        padding: 10px 12px;
    }
    
    .color-preview {
        width: 20px;
        height: 20px;
    }
    
    #downloadBtn {
        bottom: 1rem;
        right: 1rem;
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    #downloadBtn svg {
        width: 1rem;
        height: 1rem;
    }
    
    /* Fix loading spinner responsiveness on mobile */
    .loading .inline-flex {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }
    
    .loading .animate-spin {
        width: 2rem !important;
        height: 2rem !important;
        margin-right: 0 !important;
        margin-bottom: 0.75rem;
    }
    
    /* Ensure color input doesn't get cut off by randomize button and dropdown toggle */
    #colorIndicator {
        right: 2.75rem !important;
        width: 1.75rem !important;
        height: 1.75rem !important;
    }
    
    /* Adjust dropdown toggle position on mobile */
    #dropdownToggle {
        right: 0.5rem !important;
        width: 1.75rem !important;
        height: 1.75rem !important;
    }
    
    /* Add proper mobile padding to hero section */
    section.relative.min-h-screen {
        padding-top: 4rem;
        min-height: calc(100vh - 4rem);
    }
    
    /* Improve footer layout for mobile */
    footer .flex.flex-col.md\\:flex-row {
        text-align: center;
        gap: 1rem;
    }
    
    footer .mb-4.md\\:mb-0 {
        margin-bottom: 1rem !important;
    }
    
    footer h3 {
        font-size: 1.5rem !important;
    }
    
    footer .text-center.md\\:text-right {
        text-align: center !important;
    }
    
    /* Stack color input and randomize button on very small screens */
    @media (max-width: 480px) {
        .flex.flex-col.sm\\:flex-row {
            flex-direction: column !important;
        }
        
        #surpriseBtn {
            width: 100%;
            justify-content: center;
        }
        
        /* Extra mobile padding for very small screens */
        section.relative.min-h-screen {
            padding-top: 2rem;
            min-height: calc(100vh - 2rem);
        }
        
        /* Reduce footer padding on very small screens */
        footer {
            padding-top: 2rem !important;
            padding-bottom: 2rem !important;
        }
    }
}

/* Paint Splash Loading Animation */
@keyframes paint-splash {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(360deg);
        opacity: 1;
    }
}

.paint-splash-loader {
    animation: paint-splash 1s ease-in-out infinite;
}

/* Gradient Text Animation */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

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

/* Card Hover Effects */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Paint Bucket Cursor */
.paint-cursor {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><path fill="%232563eb" d="M16 2l-4 4h-2v2l-4 4v6l4 4v2h2l4 4 4-4h2v-2l4-4v-6l-4-4v-2h-2l-4-4z"/></svg>') 16 16, auto;
}

/* Floating Animation for Elements */
@keyframes gentle-float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.float-animation {
    animation: gentle-float 4s ease-in-out infinite;
}

/* Success Message Styling */
.success-message {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border: 2px solid #34d399;
    border-radius: 12px;
    padding: 16px;
    color: #065f46;
    font-weight: 500;
    animation: fade-in-up 0.4s ease-out;
}

/* Transition Classes */
.transition-all-slow {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Paint Texture Overlay */
.paint-texture {
    position: relative;
}

.paint-texture::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255,255,255,.05) 35px, rgba(255,255,255,.05) 70px);
    pointer-events: none;
}

/* Responsive Typography */
@media (max-width: 768px) {
    .text-responsive-lg {
        font-size: 1.125rem;
    }
    
    .text-responsive-xl {
        font-size: 1.25rem;
    }
    
    .text-responsive-2xl {
        font-size: 1.5rem;
    }
    
    .text-responsive-3xl {
        font-size: 1.875rem;
    }
}