/**
 * GPCC Game Card Component
 * Complete styling for game cards in grids/lists
 * Architecture: Scoped with .gpcc-skin, no !important
 */

/* === GAME CARD BASE === */
.gpcc-skin .gpcc-card {
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
  position: relative;
}

.gpcc-skin .gpcc-card:hover {
  background-color: var(--surface-3);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  text-decoration: none;
}

.gpcc-skin .gpcc-card:focus,
.gpcc-skin .gpcc-card:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  text-decoration: none;
}

.gpcc-skin .gpcc-card:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* === CARD THUMBNAIL === */
.gpcc-skin .gpcc-card__thumb {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background-color: var(--surface-1);
  text-decoration: none;
}

.gpcc-skin .gpcc-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform var(--transition-fast);
}

.gpcc-skin .gpcc-card:hover .gpcc-card__thumb img {
  transform: scale(1.05);
}

/* Placeholder for missing image */
.gpcc-skin .gpcc-card__thumb:empty::before {
  content: "🎮";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  opacity: 0.3;
}

/* === CARD BODY === */
.gpcc-skin .gpcc-card__body {
  padding: calc(var(--gap) / 2);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: calc(var(--gap) / 3);
}

/* === CARD TITLE === */
.gpcc-skin .gpcc-card__title {
  margin: 0;
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  line-height: var(--leading-tight);
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gpcc-skin .gpcc-card__title a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.gpcc-skin .gpcc-card__title a:hover {
  color: var(--primary);
}

.gpcc-skin .gpcc-card__title a:focus,
.gpcc-skin .gpcc-card__title a:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
  border-radius: var(--radius-sm);
}

/* === CARD META === */
.gpcc-skin .gpcc-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--gap) / 2);
  margin-top: auto;
}

.gpcc-skin .gpcc-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1;
  position: relative;
}

/* Meta icons using CSS masks */
.gpcc-skin .gpcc-meta::before {
  content: "";
  width: 12px;
  height: 12px;
  background-color: currentColor;
  flex-shrink: 0;
  opacity: 0.7;
}

.gpcc-skin .gpcc-meta--size::before {
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z'/%3E%3C/svg%3E") no-repeat center;
  mask-size: contain;
}

.gpcc-skin .gpcc-meta--downloads::before {
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M9 19l3 3m0 0l3-3m-3 3V10'/%3E%3C/svg%3E") no-repeat center;
  mask-size: contain;
}

.gpcc-skin .gpcc-meta--rating::before {
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z'/%3E%3C/svg%3E") no-repeat center;
  mask-size: contain;
}

/* Hide meta items when empty */
.gpcc-skin .gpcc-meta:empty {
  display: none;
}

/* === CARD TAGS === */
.gpcc-skin .gpcc-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--gap) / 4);
  margin-top: calc(var(--gap) / 3);
}

.gpcc-skin .gpcc-card__tags .gpcc-tag {
  font-size: var(--text-xs);
  padding: 0.125rem 0.375rem;
  background-color: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--transition-fast);
  line-height: 1.2;
}

.gpcc-skin .gpcc-card__tags .gpcc-tag:hover {
  background-color: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
}

.gpcc-skin .gpcc-card__tags .gpcc-tag:focus,
.gpcc-skin .gpcc-card__tags .gpcc-tag:focus-visible {
  outline: 1px solid var(--focus-ring);
  outline-offset: 1px;
}

/* === RESPONSIVE ADJUSTMENTS === */
@media (max-width: 768px) {
  .gpcc-skin .gpcc-card__body {
    padding: calc(var(--gap) / 2.5);
  }
  
  .gpcc-skin .gpcc-card__title {
    font-size: var(--text-sm);
  }
  
  .gpcc-skin .gpcc-card__meta {
    gap: calc(var(--gap) / 3);
  }
  
  .gpcc-skin .gpcc-meta {
    font-size: 0.6875rem; /* 11px */
  }
  
  .gpcc-skin .gpcc-meta::before {
    width: 10px;
    height: 10px;
  }
}

@media (max-width: 576px) {
  .gpcc-skin .gpcc-card__thumb {
    aspect-ratio: 4 / 3; /* Slightly wider on very small screens */
  }
  
  .gpcc-skin .gpcc-card__body {
    padding: calc(var(--gap) / 3);
  }
  
  .gpcc-skin .gpcc-card__tags {
    gap: 0.125rem;
  }
  
  .gpcc-skin .gpcc-card__tags .gpcc-tag {
    font-size: 0.625rem; /* 10px */
    padding: 0.0625rem 0.25rem;
  }
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
  .gpcc-skin .gpcc-card,
  .gpcc-skin .gpcc-card__thumb img,
  .gpcc-skin .gpcc-card__title a,
  .gpcc-skin .gpcc-card__tags .gpcc-tag {
    transition: none;
  }
  
  .gpcc-skin .gpcc-card:hover {
    transform: none;
  }
  
  .gpcc-skin .gpcc-card:hover .gpcc-card__thumb img {
    transform: none;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .gpcc-skin .gpcc-card {
    border-width: 2px;
  }
  
  .gpcc-skin .gpcc-card:hover {
    border-color: var(--primary);
  }
  
  .gpcc-skin .gpcc-meta::before {
    opacity: 1;
  }
}

/* === LOADING STATE === */
.gpcc-skin .gpcc-card.loading {
  pointer-events: none;
  opacity: 0.7;
}

.gpcc-skin .gpcc-card.loading .gpcc-card__thumb::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: gpcc-card-spin 1s linear infinite;
}

@keyframes gpcc-card-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gpcc-skin .gpcc-card.loading .gpcc-card__thumb::after {
    animation: none;
    border-top-color: var(--primary);
  }
}

/* === GRID CONTAINER RECOMMENDATIONS === */
/* These are example grid setups - actual grid should be in layout.css */
/*
.gpcc-games-grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

@media (min-width: 768px) {
  .gpcc-games-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

@media (min-width: 1024px) {
  .gpcc-games-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

@media (min-width: 1280px) {
  .gpcc-games-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}
*/