/* Card component styles for Ten Z Vault */

/* Base card styles */
.crystal-card {
  background: linear-gradient(90deg, #f8fafc 0%, #d1c4e9 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 
    0 4px 16px 0 rgba(59, 130, 246, 0.18), 
    0 1px 6px 0 rgba(13, 148, 136, 0.08);
  border: 1.5px solid #000;
  border-radius: 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* Product card specific styles */
.product-card {
  width: 370px;
  height: 370px;
  margin: 0 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.25rem;
  text-align: center;
}

/* Category card specific styles */
.category-card {
  display: flex;
  align-items: center;
  padding: 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  cursor: pointer;
}

/* Card hover effects */
.card-hover:hover {
  background: rgba(34, 197, 94, 0.6);
  transform: translateY(-2px);
  box-shadow: 
    0 8px 25px 0 rgba(59, 130, 246, 0.25), 
    0 4px 10px 0 rgba(13, 148, 136, 0.12);
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 
    0 12px 30px 0 rgba(59, 130, 246, 0.3), 
    0 6px 15px 0 rgba(13, 148, 136, 0.15);
}

/* Card animations */
.card-animate {
  opacity: 0;
  transform: translateY(20px);
  animation: cardSlideIn 0.6s ease-out forwards;
  scroll-snap-align: start;
  flex-shrink: 0;
}

@keyframes cardSlideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Product card content */
.product-image-container {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 144px;
  margin-bottom: 1rem;
}

.product-image {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  border-radius: 0.5rem;
  transition: transform 0.3s ease;
}

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

.product-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.product-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.22);
  font-family: 'Poppins', sans-serif;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.product-description {
  font-size: 1.12rem;
  color: #5b21b6;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.18);
  font-family: 'Poppins', sans-serif;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.crystal-card-desc {
  font-size: 1.12rem;
  color: #5b21b6;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.18);
  font-family: 'Poppins', sans-serif;
  margin-bottom: 0.5rem;
}

/* Product rating */
.product-rating {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  gap: 0.25rem;
}

.stars {
  display: flex;
  gap: 0.125rem;
}

.stars i {
  font-size: 1rem;
}

.rating-value {
  font-size: 0.875rem;
  color: #6b7280;
  margin-left: 0.5rem;
}

/* Product price */
.product-price {
  font-size: 1.125rem;
  font-weight: 600;
  color: #059669;
  margin-top: 0.5rem;
}

/* Category card content */
.category-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111;
  margin-left: 1rem;
}

/* Card loading state */
.card-loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.card-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Card error state */
.card-error {
  background: linear-gradient(90deg, #fef2f2 0%, #fee2e2 100%);
  border-color: #dc2626;
  color: #dc2626;
}

/* Card skeleton loading */
.card-skeleton {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

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

.skeleton-text {
  height: 1rem;
  background: #e5e7eb;
  border-radius: 0.25rem;
  margin-bottom: 0.5rem;
}

.skeleton-text.short {
  width: 60%;
}

.skeleton-text.medium {
  width: 80%;
}

.skeleton-text.long {
  width: 100%;
}

/* Responsive card adjustments */
@media (max-width: 768px) {
  .product-card {
    width: 320px;
    height: 320px;
    margin: 0 8px;
    padding: 1rem;
  }
  
  .product-title {
    font-size: 1.25rem;
  }
  
  .product-description {
    font-size: 1rem;
  }
  
  .product-image-container {
    height: 120px;
  }
}

@media (max-width: 480px) {
  .product-card {
    width: 280px;
    height: 300px;
    margin: 0 6px;
  }
  
  .category-card {
    flex-direction: column;
    text-align: center;
    padding: 1rem;
  }
  
  .category-name {
    margin-left: 0;
    margin-top: 0.5rem;
  }
}

/* Card accessibility improvements */
.product-card:focus-within {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.category-card:focus-within {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Card link styling */
.product-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  border-radius: inherit;
}

.product-card-link:focus {
  outline: none;
}

/* Card badge/tag */
.card-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: #3b82f6;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 10;
}

.card-badge.featured {
  background: #f59e0b;
}

.card-badge.sale {
  background: #dc2626;
}

.card-badge.new {
  background: #059669;
}

/* Card grid container */
.cards-grid {
  display: grid;
  gap: 2rem;
  padding: 1rem;
}

@media (min-width: 640px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .cards-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Card slider container */
.cards-slider {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 2rem;
  padding: 1rem 2rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.cards-slider::-webkit-scrollbar {
  display: none;
}

.cards-slider .crystal-card {
  scroll-snap-align: start;
  flex-shrink: 0;
}
