/* ===============================================
   SHARED-TOGGLE-PAGINATION.CSS
   Grid/list view toggle and pagination controls -
   used by both games.md's Browse view and porters.md.
   =============================================== */

/* ===== VIEW TOGGLE (Grid / List) ===== */
/* Pill-shaped segmented toggle: both icons sit in one rounded track, and
   the active mode is marked by a filled circle behind its icon alone. */
/* Height matches .filter-toggle-btn, which sits directly beside this in the
   browse toolbar - they were 28px and 32px before, so the pair never lined
   up. Change both together. */
.view-toggle-wrapper {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 0.1rem;
  height: 32px;
  padding: 2px;
  border-radius: 999px;
  background-color: rgba(128, 128, 128, 0.18);
  border: none;
  box-sizing: border-box;
}

.view-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: transparent;
  color: var(--card-stat-color, #888888);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-toggle-btn i {
  font-size: 0.7rem;
}

.view-toggle-btn:hover {
  color: var(--card-text);
}

[data-md-color-scheme="dark"] .view-toggle-btn.active {
  background-color: #ffffff;
  color: #111111;
}

[data-md-color-scheme="light"] .view-toggle-btn.active {
  background-color: #ffffff;
  color: #111111;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Matches .filter-toggle-btn's mobile size (games-filters.css) so the pair
   stays aligned. Lives here rather than in that file because this
   stylesheet loads later - an override there would lose the cascade to the
   base rule above, since media queries carry no extra specificity. */
@media (max-width: 768px) {
  .view-toggle-wrapper {
    height: 36px;
  }

  .view-toggle-btn {
    width: 32px;
    height: 32px;
  }

  .view-toggle-btn i {
    font-size: 0.8rem;
  }
}

/* ===== LIST VIEW ===== */
.game-grid.list-view {
  display: flex;
  flex-direction: column;
  grid-template-columns: none;
  gap: 0.6rem;
}

.game-grid.list-view .pm-card {
  flex-direction: row;
  align-items: center;
  text-align: left;
  padding: 0.6rem 1rem;
  gap: 1rem;
}

.game-grid.list-view .pm-card img {
  width: 110px;
  flex-shrink: 0;
  aspect-ratio: 4 / 3;
  margin-bottom: 0;
}

.game-grid.list-view .pm-card h3 {
  font-size: 0.95rem;
  flex-grow: 1;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-grid.list-view .card-stats {
  width: auto;
  flex-shrink: 0;
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  gap: 0.75rem;
}

.game-grid.list-view .card-stat {
  font-size: 0.75rem;
}

.game-grid.list-view .card-stat i {
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  .game-grid.list-view .pm-card {
    padding: 0.5rem 0.75rem;
    gap: 0.6rem;
  }

  .game-grid.list-view .pm-card img {
    width: 72px;
  }

  .game-grid.list-view .pm-card h3 {
    font-size: 0.75rem;
  }

  .game-grid.list-view .card-stats {
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
  }
}

/* ===== PAGINATION ===== */
.pagination-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  max-width: 1200px;
  margin: 1rem auto 2rem;
  padding: 1rem;
  background-color: var(--md-default-bg-color);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.pagination-info {
  margin: 0;
  font-size: 0.85rem;
  color: var(--md-default-fg-color--light);
  white-space: nowrap;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: center;
}

.pagination-pages {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.pagination-nav-btn,
.pagination-page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 0.5rem;
  background-color: transparent;
  color: var(--md-default-fg-color);
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.pagination-nav-btn {
  color: #F49519;
}

.pagination-nav-btn:hover:not(:disabled),
.pagination-page-btn:hover:not(.active) {
  background-color: rgba(244, 149, 25, 0.15);
}

.pagination-nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.pagination-page-btn.active {
  background-color: #F49519;
  border-color: #F49519;
  color: #ffffff;
}

.pagination-ellipsis {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  color: var(--md-default-fg-color--light);
}

.page-size-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--md-default-fg-color--light);
  white-space: nowrap;
  flex-shrink: 0;
}

.page-size-select {
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  border: 2px solid #F49519;
  font-size: 0.85rem;
  background-color: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  cursor: pointer;
  outline: none;
}

@media (max-width: 600px) {
  .pagination-container {
    justify-content: center;
    text-align: center;
  }

  .pagination-info {
    order: 3;
    width: 100%;
    text-align: center;
  }
}

