/* Animation Styles for Liquid Glass Design */

/* Dialog Animations */
@keyframes dialog-enter {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes dialog-exit {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
}

@keyframes backdrop-enter {
  from {
    opacity: 0;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }
}

@keyframes backdrop-exit {
  from {
    opacity: 1;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }
  to {
    opacity: 0;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
  }
}

/* Drawer Animations */
@keyframes drawer-slide-in {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes drawer-slide-out {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(100%);
  }
}

/* Button Ripple Effect */
@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

/* Loading Animations */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

/* Card Hover Effects */
@keyframes card-lift {
  from {
    transform: translateY(0);
    box-shadow: var(--glass-shadow);
  }
  to {
    transform: translateY(-4px);
    box-shadow: var(--glass-shadow-lg);
  }
}

/* Product Grid Animations */
@keyframes product-fade-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes product-fade-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

/* Cart Badge Animation */
@keyframes badge-bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0) scale(1);
  }
  40% {
    transform: translateY(-10px) scale(1.1);
  }
  60% {
    transform: translateY(-5px) scale(1.05);
  }
}

/* Notification Animations */
@keyframes notification-slide-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes notification-slide-out {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Theme Transition */
@keyframes theme-transition {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Glass Morphism Effects */
.glass-morphism {
  background: var(--color-surface-glass);
  backdrop-filter: var(--glass-backdrop-blur);
  -webkit-backdrop-filter: var(--glass-backdrop-blur);
  border: 1px solid var(--color-border-glass);
  box-shadow: var(--glass-shadow);
}

.glass-morphism-light {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-morphism-dark {
  background: rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Animation Classes */
.animate-fade-in {
  animation: product-fade-in 0.3s ease-out;
}

.animate-fade-out {
  animation: product-fade-out 0.3s ease-out;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-shimmer {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
}

.animate-bounce {
  animation: badge-bounce 0.6s ease-out;
}

/* Dialog Animation Classes */
.dialog-enter {
  animation: dialog-enter 0.3s ease-out;
}

.dialog-exit {
  animation: dialog-exit 0.3s ease-out;
}

.backdrop-enter {
  animation: backdrop-enter 0.3s ease-out;
}

.backdrop-exit {
  animation: backdrop-exit 0.3s ease-out;
}

/* Drawer Animation Classes */
.drawer-slide-in {
  animation: drawer-slide-in 0.3s ease-out;
}

.drawer-slide-out {
  animation: drawer-slide-out 0.3s ease-out;
}

/* Button Ripple Effect */
.glass-button {
  position: relative;
  overflow: hidden;
}

.glass-button::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.glass-button:active::after {
  width: 300px;
  height: 300px;
}

/* Stagger Animation for Product Grid */
.product-grid .product-card {
  animation: product-fade-in 0.5s ease-out;
}

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

/* Loading States */
.loading-skeleton {
  background: linear-gradient(
    90deg,
    var(--color-surface) 25%,
    var(--color-surface-elevated) 50%,
    var(--color-surface) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--glass-border-radius-sm);
}

.loading-skeleton-text {
  height: 1em;
  margin-bottom: 0.5em;
}

.loading-skeleton-text:last-child {
  width: 60%;
}

.loading-skeleton-image {
  height: 200px;
  width: 100%;
}

/* Hover Effects */
.hover-lift {
  transition: transform var(--transition-normal),
    box-shadow var(--transition-normal);
}

.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: var(--glass-shadow-lg);
}

.hover-glow {
  transition: box-shadow var(--transition-normal);
}

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

/* Scroll Animations */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Micro-interactions */
.micro-bounce {
  transition: transform var(--transition-fast);
}

.micro-bounce:active {
  transform: scale(0.95);
}

.micro-rotate {
  transition: transform var(--transition-fast);
}

.micro-rotate:hover {
  transform: rotate(5deg);
}

/* Focus Animations */
.focus-ring {
  transition: box-shadow var(--transition-fast);
}

.focus-ring:focus {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Theme Transition */
.theme-transition {
  transition: background-color var(--transition-normal),
    color var(--transition-normal), border-color var(--transition-normal);
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .animate-fade-in,
  .animate-fade-out,
  .animate-pulse,
  .animate-shimmer,
  .animate-bounce,
  .dialog-enter,
  .dialog-exit,
  .backdrop-enter,
  .backdrop-exit,
  .drawer-slide-in,
  .drawer-slide-out {
    animation: none !important;
  }

  .hover-lift:hover,
  .micro-bounce:active,
  .micro-rotate:hover {
    transform: none !important;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .glass-card,
  .glass-button {
    border-width: 2px;
    border-color: var(--color-text-primary);
  }

  .glass-morphism,
  .glass-morphism-light,
  .glass-morphism-dark {
    background: var(--color-surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* Print Styles */
@media print {
  .glass-card,
  .glass-button,
  app-header,
  app-footer,
  .dialog,
  .drawer {
    background: white !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }

  .hero-visual,
  .hero-shape {
    display: none !important;
  }
}
