/* Animations for AuIrphila Bakery */

/* Fade In Animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Slide In From Right */
@keyframes slideInRight {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.slide-in-right {
    animation: slideInRight 0.5s ease forwards;
}

/* Slide In From Left */
@keyframes slideInLeft {
    from { transform: translateX(-50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease forwards;
}

/* Slide In From Bottom */
@keyframes slideInBottom {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.slide-in-bottom {
    animation: slideInBottom 0.5s ease forwards;
}

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

.pulse {
    animation: pulse 1.5s infinite;
}

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

.shake {
    animation: shake 0.5s ease;
}

/* Cart Notification Animation */
@keyframes slideDown {
    0% { transform: translateY(-100%); }
    10% { transform: translateY(0); }
    90% { transform: translateY(0); }
    100% { transform: translateY(-100%); }
}

.cart-notification {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--secondary-color);
    color: var(--white);
    text-align: center;
    padding: 1rem;
    z-index: 2000;
    transform: translateY(-100%);
}

.cart-notification.show {
    animation: slideDown 3s ease forwards;
}

/* Button Hover Animation */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.btn:hover::after {
    transform: translateX(0);
}

/* Image Hover Zoom */
.zoom-on-hover {
    overflow: hidden;
}

.zoom-on-hover img {
    transition: transform 0.5s ease;
}

.zoom-on-hover:hover img {
    transform: scale(1.1);
}

/* Staggered Fade In (for lists) */
.stagger-fade-in > * {
    opacity: 0;
}

.stagger-fade-in > *:nth-child(1) { animation: fadeIn 0.5s ease forwards 0.1s; }
.stagger-fade-in > *:nth-child(2) { animation: fadeIn 0.5s ease forwards 0.2s; }
.stagger-fade-in > *:nth-child(3) { animation: fadeIn 0.5s ease forwards 0.3s; }
.stagger-fade-in > *:nth-child(4) { animation: fadeIn 0.5s ease forwards 0.4s; }
.stagger-fade-in > *:nth-child(5) { animation: fadeIn 0.5s ease forwards 0.5s; }
.stagger-fade-in > *:nth-child(6) { animation: fadeIn 0.5s ease forwards 0.6s; }
.stagger-fade-in > *:nth-child(7) { animation: fadeIn 0.5s ease forwards 0.7s; }
.stagger-fade-in > *:nth-child(8) { animation: fadeIn 0.5s ease forwards 0.8s; }

/* Contact Page Specific Animations */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

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

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

.highlight-text {
    background: linear-gradient(90deg, transparent 0%, rgba(248, 177, 149, 0.2) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: highlight 3s linear infinite;
}

@keyframes border-pulse {
    0% { box-shadow: 0 0 0 0 rgba(248, 177, 149, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(248, 177, 149, 0); }
    100% { box-shadow: 0 0 0 0 rgba(248, 177, 149, 0); }
}

.pulse-border {
    animation: border-pulse 2s infinite;
}

/* Form field focus animation */
@keyframes input-focus {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.input-focus {
    animation: input-focus 0.3s ease;
}

/* About Page Specific Animations */
@keyframes float-slow {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

.float-slow {
    animation: float-slow 5s ease-in-out infinite;
}

@keyframes rotate-icon {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

.rotate-icon {
    animation: rotate-icon 3s linear infinite;
}

@keyframes border-glow {
    0% { box-shadow: 0 0 5px rgba(248, 177, 149, 0.5); }
    50% { box-shadow: 0 0 20px rgba(248, 177, 149, 0.8); }
    100% { box-shadow: 0 0 5px rgba(248, 177, 149, 0.5); }
}

.border-glow {
    animation: border-glow 3s infinite;
}

/* Reveal animation for about image */
@keyframes reveal-diagonal {
    0% { clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%); }
    100% { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
}

.reveal-diagonal {
    animation: reveal-diagonal 1.2s ease forwards;
}

/* Cart Page Specific Animations */
/* Product Card Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* Staggered animations for product grid */
.products-grid .product-card:nth-child(1) { animation-delay: 0.1s; }
.products-grid .product-card:nth-child(2) { animation-delay: 0.2s; }
.products-grid .product-card:nth-child(3) { animation-delay: 0.3s; }
.products-grid .product-card:nth-child(4) { animation-delay: 0.4s; }
.products-grid .product-card:nth-child(5) { animation-delay: 0.5s; }
.products-grid .product-card:nth-child(6) { animation-delay: 0.6s; }

/* Hover effect for product cards */
@keyframes shine {
    from {
        background-position: -100% 0;
    }
    to {
        background-position: 200% 0;
    }
}

.shine-effect::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: shine 1.5s infinite;
    pointer-events: none;
}

/* Price tag animation */
@keyframes pulsate {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.price-pulse {
    animation: pulsate 2s ease-in-out infinite;
}

/* Rating stars animation */
@keyframes twinkle {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

.twinkle {
    animation: twinkle 1.5s ease-in-out infinite;
}

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

.cart-item-enter {
    animation: cartItemEnter 0.3s ease forwards;
}

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

.cart-item-exit {
    animation: cartItemExit 0.3s ease forwards;
}

@keyframes quantityPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.quantity-change {
    animation: quantityPulse 0.3s ease;
}

@keyframes totalUpdate {
    0% { color: var(--accent-color); transform: scale(1.1); }
    100% { color: var(--secondary-color); transform: scale(1); }
}

.total-update {
    animation: totalUpdate 0.5s ease;
}

/* Footer animations */
@keyframes float-up {
    0% { transform: translateY(20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes pulse-glow {
    0% { box-shadow: 0 0 0 0 rgba(248, 177, 149, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(248, 177, 149, 0); }
    100% { box-shadow: 0 0 0 0 rgba(248, 177, 149, 0); }
}

.footer-animate {
    animation: float-up 0.8s ease forwards;
    opacity: 0;
}

.footer-animate:nth-child(1) { animation-delay: 0.1s; }
.footer-animate:nth-child(2) { animation-delay: 0.3s; }
.footer-animate:nth-child(3) { animation-delay: 0.5s; }
.footer-animate:nth-child(4) { animation-delay: 0.7s; }

.social-pulse:hover {
    animation: pulse-glow 1.5s infinite;
}

/* Header Logo Animation */
@keyframes logoSpin {
    0% { transform: rotateY(0); }
    100% { transform: rotateY(360deg); }
}

/* Logo attention pulse effect */
@keyframes attentionPulse {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.08);
        filter: brightness(1.1) drop-shadow(0 0 10px rgba(229, 178, 153, 0.8));
    }
    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

.attention-pulse {
    animation: attentionPulse 1s ease-in-out;
}

/* Nav Item Hover Animation */
@keyframes navItemPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Search Bar Expand Animation */
@keyframes expandSearch {
    from { width: 250px; }
    to { width: 300px; }
}

/* Header Background Gradient Animation */
@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Cart Icon Bounce Animation */
@keyframes cartBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* Header Shadow Pulse */
@keyframes shadowPulse {
    0% { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); }
    50% { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15); }
    100% { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); }
}

/* Enhanced Category Card Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.category-card {
  animation: fadeInUp 0.6s ease forwards;
  opacity: 0;
}

/* Staggered animation for category cards - first row */
.categories-container:first-of-type .category-card:nth-child(1) { animation-delay: 0.1s; }
.categories-container:first-of-type .category-card:nth-child(2) { animation-delay: 0.2s; }
.categories-container:first-of-type .category-card:nth-child(3) { animation-delay: 0.3s; }
.categories-container:first-of-type .category-card:nth-child(4) { animation-delay: 0.4s; }
.categories-container:first-of-type .category-card:nth-child(5) { animation-delay: 0.5s; }

/* Staggered animation for category cards - second row */
.categories-container.second-row .category-card:nth-child(1) { animation-delay: 0.6s; }
.categories-container.second-row .category-card:nth-child(2) { animation-delay: 0.7s; }
.categories-container.second-row .category-card:nth-child(3) { animation-delay: 0.8s; }
.categories-container.second-row .category-card:nth-child(4) { animation-delay: 0.9s; }
.categories-container.second-row .category-card:nth-child(5) { animation-delay: 1.0s; }

/* Subtle shine effect on hover */
@keyframes shine {
  0% {
    background-position: -100% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.category-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.category-card:hover::after {
  opacity: 1;
  animation: shine 1.5s infinite;
}

/* Card border animation */
@keyframes borderPulse {
  0% { box-shadow: 0 0 0 0 rgba(229, 115, 115, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(229, 115, 115, 0); }
  100% { box-shadow: 0 0 0 0 rgba(229, 115, 115, 0); }
}

.category-card:hover {
  animation: borderPulse 1.5s infinite;
}

/* Section title animation */
@keyframes underlineExtend {
  from { width: 0; }
  to { width: 120px; }
}

.section-title:after {
  animation: underlineExtend 1s ease-out forwards;
}
