/* Custom styles for GiftWonders */

/* Base styles and utilities */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Smooth scrolling for the entire page */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar styles */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #FF6B6B;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #FF5252;
}

/* Loading animations */
@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 bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0,0,0);
    }
    40%, 43% {
        transform: translate3d(0, -10px, 0);
    }
    70% {
        transform: translate3d(0, -5px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Animation classes */
.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

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

.bounce-in {
    animation: bounce 1s ease-out;
}

.pulse-hover:hover {
    animation: pulse 0.3s ease-in-out;
}

/* Product card enhancements */
.product-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.product-card .product-image {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.product-card:hover .product-image {
    transform: scale(1.1);
}

/* Category card animations */
.category-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-card:hover {
    transform: translateY(-8px);
}

.category-card .category-icon {
    transition: all 0.3s ease;
}

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

/* Button enhancements */
.btn-primary {
    background: linear-gradient(135deg, #FF6B6B, #F472B6);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary::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.6s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #FF5252, #E91E63);
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(255, 107, 107, 0.4);
}

/* Navigation enhancements */
.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #FF6B6B;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Hero section enhancements */
.hero-gradient {
    background: linear-gradient(135deg, 
        rgba(255, 228, 230, 0.9) 0%, 
        rgba(243, 232, 255, 0.9) 33%, 
        rgba(219, 234, 254, 0.9) 66%, 
        rgba(209, 250, 229, 0.9) 100%);
}

.hero-image {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-image:hover {
    transform: rotate(0deg) scale(1.05);
}

/* Search input enhancements */
.search-input {
    transition: all 0.3s ease;
}

.search-input:focus {
    transform: scale(1.02);
    box-shadow: 0 10px 25px rgba(255, 107, 107, 0.2);
}

/* Cart sidebar enhancements */
.cart-sidebar {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

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

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

/* Star rating enhancements */
.star-rating {
    filter: drop-shadow(0 1px 2px rgba(255, 193, 7, 0.3));
}

/* Newsletter section enhancements */
.newsletter-bg {
    background: linear-gradient(135deg, #FF6B6B 0%, #F472B6 100%);
    position: relative;
}

.newsletter-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" fill="rgba(255,255,255,0.1)"><polygon points="0,0 1000,0 1000,100 500,20 0,100"/></svg>') no-repeat;
    background-size: cover;
}

/* Footer enhancements */
.footer-link {
    transition: all 0.3s ease;
}

.footer-link:hover {
    transform: translateX(5px);
    color: #FF6B6B;
}

/* Mobile optimizations */
@media (max-width: 640px) {
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

/* Tablet optimizations */
@media (min-width: 641px) and (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

/* Accessibility enhancements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Focus styles for better accessibility */
.focus-visible {
    outline: 2px solid #FF6B6B;
    outline-offset: 2px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 2px solid #FF6B6B;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bg-warm-coral {
        background-color: #CC0000;
    }
    
    .text-warm-coral {
        color: #CC0000;
    }
    
    .border-warm-coral {
        border-color: #CC0000;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    * {
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .bg-warm-coral {
        background: transparent !important;
        color: black !important;
    }
}

/* Custom selection colors */
::selection {
    background: rgba(255, 107, 107, 0.3);
    color: #333;
}

::-moz-selection {
    background: rgba(255, 107, 107, 0.3);
    color: #333;
}

/* Toast notification enhancements */
.toast {
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Smooth image loading */
img {
    transition: opacity 0.3s ease;
}

img[data-loading="true"] {
    opacity: 0;
}

img[data-loading="false"] {
    opacity: 1;
}

/* Utility classes for custom animations */
.animate-float {
    animation: float 3s ease-in-out infinite;
}

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

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

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* Loading spinner */
.spinner {
    border: 3px solid rgba(255, 107, 107, 0.2);
    border-top: 3px solid #FF6B6B;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

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