/**
 * Guías Gallery — Styles
 *
 * @package GitHubTheme
 */

/* =========================================================================
   HEADER
   ========================================================================= */

.guias-page {
  padding-bottom: 64px;
}

.guias-header {
  text-align: center;
  padding: 24px 0 16px;
  border-bottom: 1px solid var(--github-border);
  margin-bottom: 24px;
}

.guias-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(0,142,194,.15), rgba(0,142,194,.05));
  border: 1px solid rgba(0,142,194,.2);
  color: var(--github-accent);
  margin-bottom: 12px;
}

.guias-title {
  font-family: var(--github-font-mono);
  font-size: 24px;
  font-weight: 600;
  color: var(--github-text-primary);
  text-transform: lowercase;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.guias-subtitle {
  font-family: var(--github-font-mono);
  font-size: 13px;
  color: var(--github-text-tertiary);
  text-transform: lowercase;
}

.guias-count {
  color: var(--github-accent);
  font-weight: 600;
}

/* =========================================================================
   A-Z FILTER BAR
   ========================================================================= */

.guias-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  padding: 12px 0;
  margin-bottom: 24px;
  position: sticky;
  top: 49px; /* below header */
  z-index: 50;
  background: var(--github-bg-primary);
  border-bottom: 1px solid var(--github-border);
}

.admin-bar .guias-filter {
  top: 81px; /* 49px header + 32px admin bar */
}

@media screen and (max-width: 782px) {
  .admin-bar .guias-filter {
    top: 95px; /* 49px header + 46px mobile admin bar */
  }
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--github-text-secondary);
  font-family: var(--github-font-mono);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  user-select: none;
}

.filter-btn:hover:not(.is-disabled):not(.active) {
  background: var(--github-bg-secondary);
  border-color: var(--github-border);
  color: var(--github-text-primary);
}

.filter-btn.active {
  background: var(--github-accent);
  color: #fff;
  border-color: var(--github-accent);
  box-shadow: 0 0 12px rgba(0, 142, 194, 0.3);
}

.filter-btn.is-disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

/* =========================================================================
   GAME GRID
   ========================================================================= */

.guias-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 1024px) {
  .guias-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

@media (max-width: 640px) {
  .guias-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

/* =========================================================================
   GAME CARD
   ========================================================================= */

.guia-card {
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  background: var(--github-bg-secondary);
  border: 1px solid var(--github-border);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.guia-card:hover {
  border-color: var(--github-accent);
  transform: translateY(-4px);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(0, 142, 194, 0.15),
    0 0 20px rgba(0, 142, 194, 0.08);
}

.guia-card.is-hidden {
  display: none;
}

/* Cover area */
.guia-cover {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--github-bg-tertiary);
}

.guia-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.4s ease;
}

.guia-cover-img.loaded {
  opacity: 1;
}

.guia-card:hover .guia-cover-img {
  transform: scale(1.06);
}

/* Shine overlay on hover */
.guia-cover-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0) 40%,
    rgba(255, 255, 255, 0.03) 50%,
    rgba(255, 255, 255, 0) 60%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.guia-card:hover .guia-cover-shine {
  opacity: 1;
}

/* Placeholder when no cover loaded yet */
.guia-cover-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    var(--github-bg-tertiary) 0%,
    var(--github-bg-secondary) 100%
  );
  transition: opacity 0.4s ease;
}

.guia-cover-placeholder span {
  font-family: var(--github-font-mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--github-text-tertiary);
  opacity: 0.4;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Hide placeholder once image loads */
.guia-cover-img.loaded + .guia-cover-placeholder,
.guia-cover-img.loaded ~ .guia-cover-placeholder {
  opacity: 0;
  pointer-events: none;
}

/* Metacritic Score */
.guia-metacritic {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: opacity 0.3s;
}

.mc-score {
  font-family: var(--github-font-mono);
  font-weight: 700;
  font-size: 11px;
  color: #66cc33; /* Metacritic Green */
  line-height: 1;
}

/* =========================================================================
   CARD INFO
   ========================================================================= */

.guia-info {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid var(--github-border);
}

.guia-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.guia-name {
  font-family: var(--github-font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--github-text-primary);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  transition: color 0.2s ease;
  flex: 1;
}

.guia-platforms {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--github-text-tertiary);
  flex-shrink: 0;
}

.guia-platforms svg {
  opacity: 0.7;
}

.guia-card:hover .guia-name {
  color: var(--github-accent);
}

.guia-count-badge {
  font-family: var(--github-font-mono);
  font-size: 11px;
  color: var(--github-text-tertiary);
  text-transform: lowercase;
}

/* =========================================================================
   EMPTY STATE
   ========================================================================= */

.guias-empty {
  text-align: center;
  padding: 64px 24px;
  color: var(--github-text-tertiary);
  font-family: var(--github-font-mono);
  font-size: 13px;
}

.guias-empty svg {
  margin-bottom: 16px;
}

.guias-empty[hidden] {
  display: none;
}

/* =========================================================================
   SKELETON PULSE (while covers load)
   ========================================================================= */

@keyframes guias-pulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 0.15; }
}

.guia-cover-placeholder {
  animation: guias-pulse 2s ease-in-out infinite;
}

.guia-cover-img.loaded ~ .guia-cover-placeholder {
  animation: none;
}

/* =========================================================================
   ENTRANCE ANIMATION
   ========================================================================= */

@keyframes guia-fade-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.guia-card {
  animation: guia-fade-in 0.4s ease both;
}

.guia-card:nth-child(1)  { animation-delay: 0.00s; }
.guia-card:nth-child(2)  { animation-delay: 0.03s; }
.guia-card:nth-child(3)  { animation-delay: 0.06s; }
.guia-card:nth-child(4)  { animation-delay: 0.09s; }
.guia-card:nth-child(5)  { animation-delay: 0.12s; }
.guia-card:nth-child(6)  { animation-delay: 0.15s; }
.guia-card:nth-child(7)  { animation-delay: 0.18s; }
.guia-card:nth-child(8)  { animation-delay: 0.21s; }
.guia-card:nth-child(9)  { animation-delay: 0.24s; }
.guia-card:nth-child(10) { animation-delay: 0.27s; }
.guia-card:nth-child(11) { animation-delay: 0.30s; }
.guia-card:nth-child(12) { animation-delay: 0.33s; }
.guia-card:nth-child(n+13) { animation-delay: 0.36s; }

/* =========================================================================
   RESPONSIVE — MOBILE FILTER
   ========================================================================= */

@media (max-width: 640px) {
  .guias-header {
    padding: 32px 0 24px;
  }

  .guias-title {
    font-size: 18px;
  }

  .guias-filter {
    gap: 3px;
    padding: 12px 0;
    margin-bottom: 20px;
  }

  .filter-btn {
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    font-size: 11px;
  }

  .guia-info {
    padding: 10px 12px;
  }

  .guia-name {
    font-size: 12px;
  }

  .guia-count-badge {
    font-size: 10px;
  }
}
