/* Custom animations and organic design elements for Sprout Works */

/* Floating animation for hero elements */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

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

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

/* Custom focus styles for accessibility */
input:focus,
textarea:focus,
button:focus {
    outline: 2px solid #636d51;
    outline-offset: 2px;
}

/* Portfolio filter active state */
.portfolio-filter.active {
    background-color: #636d51;
    color: white;
    border-color: #636d51;
}

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

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

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

/* Lazy loading styles */
.lazy-loading {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    background-color: #f6f7f4;
    background-image: linear-gradient(90deg, #f6f7f4 25%, #e9ebe3 50%, #f6f7f4 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
}

.lazy-loaded {
    opacity: 1;
}

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

::-webkit-scrollbar-track {
    background: #f6f7f4;
}

::-webkit-scrollbar-thumb {
    background: #b8bfa5;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca584;
}

/* Organic shape decorations */
.organic-blob {
    background: linear-gradient(45deg, #f6f7f4, #e9ebe3);
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
}

/* Text selection styling */
::selection {
    background-color: #b8bfa5;
    color: #414637;
}

/* Custom checkbox styling for the contact form */
input[type="checkbox"] {
    accent-color: #636d51;
}

/* Loading animation for form submission */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.spinner {
    animation: spin 1s linear infinite;
}

/* Fade in animation for portfolio items */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Hidden class for portfolio filtering */
.hidden {
    display: none !important;
}

/* Smooth transitions for all interactive elements */
* {
    transition-property: color, background-color, border-color, opacity, transform;
    transition-duration: 200ms;
    transition-timing-function: ease-in-out;
}

/* Ensure images are responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Custom styles for mobile menu slide animation */
#mobile-menu {
    transition: all 0.3s ease-in-out;
    max-height: 0;
    overflow: hidden;
}

#mobile-menu.show {
    max-height: 300px;
}

/* Toast notification styles */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #636d51;
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
}

.toast.show {
    transform: translateX(0);
}

/* Form validation styles */
.error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Success states */
.success {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

/* Button loading state */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    color: white;
}

/* Backdrop blur for modals */
.backdrop-blur {
    backdrop-filter: blur(8px);
}

/* Custom gradient backgrounds */
.gradient-organic {
    background: linear-gradient(135deg, #f6f7f4 0%, #faf9f7 50%, #e9ebe3 100%);
}

/* Print styles */
@media print {
    nav,
    footer,
    button,
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .text-sage-600 {
        color: #4f5642 !important;
    }
    
    .text-sage-500 {
        color: #414637 !important;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .animate-float {
        animation: none;
    }
}
