/**
 * Product Cards - Base44 Style
 * Full animations and hover effects
 */

/* ==================== CONTAINER ==================== */
.products-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding: 0;
}

@media (min-width: 768px) {
  .products-container {
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
  }
}

/* ==================== CARD ==================== */
.product-card {
  opacity: 0;
  animation: cardFadeIn 0.4s ease-out forwards;
  animation-delay: 0s;
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-card__wrapper {
  height: 100%;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .product-card__wrapper {
  transform: translateY(-4px);
  border-color: rgba(2, 38, 53, 0.4);
  box-shadow: 0 0 40px 8px rgba(2, 38, 53, 0.75);
}

/* ==================== IMAGE ==================== */
.product-card__image-container {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f3f4f6;
}

.product-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Placeholder */
.product-card__placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1A1F36 0%, #2D1F3D 50%, #8B1538 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-card__placeholder-content {
  text-align: center;
  padding: 16px;
}

.product-card__placeholder-title {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 700;
  font-size: 18px;
  margin: 0;
}

.product-card__placeholder-subtitle {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  margin: 4px 0 0 0;
}

/* Badge */
.product-card__badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #E31E24;
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  z-index: 10;
}

/* ==================== CONTENT ==================== */
.product-card__content {
  padding: 16px;
}

.product-card__title {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 12px 0;
  min-height: 48px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* ==================== META ROW ==================== */
.product-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  position: relative;
}

/* Folder Button */
.product-card__folder {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #6b7280;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s;
}

.product-card__folder:hover {
  color: #E31E24;
}

.product-card__folder-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
}

.product-card__folder:hover .product-card__folder-icon {
  transform: scale(1.1);
}

.product-card__folder-text {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: text-decoration 0.2s;
}

.product-card__folder:hover .product-card__folder-text {
  text-decoration: underline;
}

/* Share Button */
.product-card__share {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: #6b7280;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s;
}

.product-card__share:hover {
  color: #E31E24;
}

.product-card__share-icon {
  width: 16px;
  height: 16px;
}

/* Tooltip */
.product-card__tooltip {
  position: absolute;
  top: -32px;
  right: 0;
  background: #111827;
  color: white;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  z-index: 50;
  animation: tooltipSlideIn 0.2s ease-out;
}

@keyframes tooltipSlideIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-card__tooltip svg {
  width: 12px;
  height: 12px;
}

/* ==================== FOOTER ==================== */
.product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Tags */
.product-card__tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 60%;
}

.product-card__tag {
  font-size: 12px;
  color: #E31E24;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s;
}

.product-card__tag:hover {
  color: #c91a1f;
  text-decoration: underline;
}

/* Download Button */
.product-card__download {
  position: relative;
  background: #111827;
  color: white;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.product-card__download:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Red sliding background */
.product-card__download-bg {
  position: absolute;
  inset: 0;
  background: #E31E24;
  transform: translateX(-100%);
  transition: transform 0.5s ease-out;
  z-index: 1;
}

.product-card__download:hover .product-card__download-bg {
  transform: translateX(0);
}

.product-card__download-text,
.product-card__download-icon {
  position: relative;
  z-index: 10;
}

.product-card__download-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card__download:hover .product-card__download-icon {
  transform: rotate(360deg);
}

/* ==================== NO RESULTS ==================== */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 16px;
  color: #6b7280;
  font-size: 18px;
}

/* === FIX: CONSISTENT CARD HEIGHTS === */
.products-container \{
  align-items: stretch;
\}

.product-card \{
  display: flex;
  height: 100%;
\}

.product-card__wrapper \{
  display: flex;
  flex-direction: column;
\}

.product-card__content \{
  flex: 1;
  display: flex;
  flex-direction: column;
\}

.product-card__title \{
  height: 48px !important;
  max-height: 48px !important;
\}

.product-card__meta \{
  flex: 1;
\}

.product-card__footer \{
  margin-top: auto;
\}

/* ==================== FORCE EQUAL CARD SIZES ==================== */
/* Force grid to create equal-width columns */
.products-container {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  grid-auto-rows: 1fr !important;
  gap: 24px !important;
}

/* Make cards stretch to fill grid cells */
.product-card {
  display: flex !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
}

.product-card__wrapper {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  height: 100% !important;
}

/* Force all image containers to same height */
.product-card__image-container {
  width: 100% !important;
  height: 220px !important;
  min-height: 220px !important;
  max-height: 220px !important;
  flex-shrink: 0 !important;
  overflow: hidden !important;
}

.product-card__image-container img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

/* Force content to fill remaining space */
.product-card__content {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
}

/* Add spacing between Copy Link and Download button */
.product-card__footer {
  gap: 16px !important;
}

/* ==================== RESPONSIVE EQUAL-SIZE GRID ==================== */

/* Base grid - mobile first (1 column) */
.products-container {
  display: grid !important;
  grid-template-columns: 1fr !important;
  grid-auto-rows: 1fr !important;
  gap: 24px !important;
}

/* Tablet - 2 equal columns */
@media (min-width: 768px) {
  .products-container {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Desktop - 3 equal columns */
@media (min-width: 1024px) {
  .products-container {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* Large desktop - 4 equal columns */
@media (min-width: 1536px) {
  .products-container {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

/* Force cards to fill grid cells equally */
.product-card {
  display: flex !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

.product-card__wrapper {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  height: 100% !important;
}

/* Fixed image height for consistency */
.product-card__image-container {
  width: 100% !important;
  height: 220px !important;
  min-height: 220px !important;
  max-height: 220px !important;
  flex-shrink: 0 !important;
  overflow: hidden !important;
}

.product-card__image-container img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

/* Content stretches to fill remaining space */
.product-card__content {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
}

/* Footer spacing */
.product-card__footer {
  gap: 16px !important;
  margin-top: auto !important;
}
