/* Products Page Specific Styles */

/* Product Grid Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Product Card Animations */
.product-card {
  animation: fadeInUp 0.6s ease-out;
  animation-fill-mode: both;
}

.product-card:nth-child(1) {
  animation-delay: 0.1s;
}
.product-card:nth-child(2) {
  animation-delay: 0.2s;
}
.product-card:nth-child(3) {
  animation-delay: 0.3s;
}
.product-card:nth-child(4) {
  animation-delay: 0.4s;
}
.product-card:nth-child(5) {
  animation-delay: 0.5s;
}
.product-card:nth-child(6) {
  animation-delay: 0.6s;
}
.product-card:nth-child(7) {
  animation-delay: 0.7s;
}
.product-card:nth-child(8) {
  animation-delay: 0.8s;
}

/* Filter Section Animations */
.filters-section {
  animation: slideInFromLeft 0.8s ease-out;
}

.sorting-section {
  animation: slideInFromRight 0.8s ease-out;
}

/* Product Card Hover Effects */
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.product-card:hover .group-hover\:scale-105 {
  transform: scale(1.05);
}

/* Wishlist Button Animation */
.product-card .absolute.top-4.right-4:hover {
  transform: scale(1.1);
  background-color: rgba(255, 255, 255, 1);
}

.product-card .absolute.top-4.right-4:hover i {
  color: #ef4444;
}

/* Add to Cart Button Animation */
.product-card button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(138, 0, 0, 0.3);
}

/* View Toggle Buttons */
.view-toggle-btn.active {
  background-color: var(--sqube-red);
  color: white;
  transform: scale(1.05);
}

.view-toggle-btn:hover {
  transform: scale(1.05);
}

/* Filter Dropdowns */
select:focus {
  box-shadow: 0 0 0 3px rgba(138, 0, 0, 0.1);
  border-color: var(--sqube-red);
}

/* Search Input Focus */
#product-search:focus {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* Load More Button */
#load-more:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(138, 0, 0, 0.3);
}

/* Clear Filters Button */
#clear-filters:hover {
  transform: translateX(2px);
}

/* Star Rating Animation */
.product-card .flex.text-yellow-400 i {
  transition: all 0.3s ease;
}

.product-card:hover .flex.text-yellow-400 i {
  transform: scale(1.1);
}

/* Price Animation */
.product-card .text-2xl.font-bold {
  transition: all 0.3s ease;
}

.product-card:hover .text-2xl.font-bold {
  transform: scale(1.05);
  color: var(--sqube-orange);
}

/* Category Badge Animation */
.product-card .absolute.top-4.left-4 {
  transition: all 0.3s ease;
}

.product-card:hover .absolute.top-4.left-4 {
  transform: scale(1.05);
}

/* List View Styles */
.products-list-view .product-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 1rem;
}

.products-list-view .product-card img {
  width: 200px;
  height: 150px;
  object-fit: cover;
  margin-right: 1rem;
}

.products-list-view .product-card .p-6 {
  flex: 1;
  padding: 0;
}

/* Loading Animation */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--sqube-red);
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .product-card {
    animation-delay: 0s;
  }

  .filters-section,
  .sorting-section {
    animation: none;
  }

  .grid.grid-cols-1.md\\:grid-cols-2.lg\\:grid-cols-3.xl\\:grid-cols-4 {
    grid-template-columns: 1fr;
  }

  .flex.flex-col.lg\\:flex-row {
    flex-direction: column;
    gap: 1rem;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .bg-background {
    background-color: #1a1a1a;
  }

  .bg-background {
    background-color: #2d2d2d;
    color: #ffffff;
  }

  .text-text {
    color: #a0a0a0;
  }

  .border-gray-300 {
    border-color: #4a4a4a;
  }
}
