/* GSSW Download Lightbox */

.gssw-dlNoScroll { overflow: hidden; }

.gssw-dlBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(17,17,17,1);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
}

.gssw-dlBtn:hover {
  border-color: rgba(255,255,255,.25);
}

.gssw-dlLightbox { position: fixed; inset: 0; z-index: 9999; }
.gssw-dlBackdrop { position: absolute; inset: 0; background: rgba(0,0,0,.7); }

.gssw-dlDialog {
  position: relative;
  max-width: 560px;
  margin: 10vh auto;
  background: #111;
  color: #fff;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 20px 80px rgba(0,0,0,.65);
}

.gssw-dlClose {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 24px;
  line-height: 40px;
  cursor: pointer;
}

.gssw-dlClose:hover { background: rgba(255,255,255,.12); }

.gssw-dlTitle { font-size: 18px; font-weight: 700; margin: 0 0 6px 0; padding-right: 48px; }
.gssw-dlMeta { opacity: .85; margin-bottom: 14px; }

/* Optional preview image (used by [gssw_library]) */
.gssw-dlPreview {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: #000;
  margin: 10px 0 0 0;
}

.gssw-dlZipWrap { margin: 12px 0; }
.gssw-dlZipLabel { font-size: 13px; opacity: .85; margin-bottom: 6px; }
.gssw-dlZipList {
  max-height: 180px;
  overflow: auto;
  background: #000;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.4;
}

.gssw-dlActions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.gssw-dlDownload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  background: #ff9a31;
  color: #fff;
  font-weight: 600;
}

.gssw-dlDownload:hover { filter: brightness(1.05); }

/* ===================================================================================== */
/* Asset Library (maps/models) UI                                                        */
/* ===================================================================================== */

.gssw-libAlpha {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px 0;
}

.gssw-libAlphaLink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(17,17,17,1);
  color: #fff;
  text-decoration: none;
  font-size: 12px;
}

.gssw-libAlphaLink:hover { border-color: rgba(255,255,255,.25); }

.gssw-libAlphaLink.is-active {
  border-color: rgba(255,255,255,.35);
  background: rgba(0,0,0,1);
}

.gssw-libLink { text-decoration: none; color: inherit; display: block; }

.gssw-libNoThumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
}

.gssw-libPager {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0 0;
  justify-content: flex-end;
}

.gssw-libPage,
.gssw-libDots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(17,17,17,1);
  color: #fff;
  text-decoration: none;
  font-size: 12px;
}

.gssw-libDots { opacity: .8; }

.gssw-libPage:hover { border-color: rgba(255,255,255,.25); }

.gssw-libPage.is-active {
  border-color: rgba(255,255,255,.35);
  background: rgba(0,0,0,1);
}

.gssw-libPage.is-disabled {
  opacity: .55;
  pointer-events: none;
}

/* ===================================================================================== */
/* Library UI (maps/models browser)                                                       */
/* ===================================================================================== */

.gssw-libAlpha {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px 0;
}

.gssw-libAlphaLink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 30px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(17,17,17,1);
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  line-height: 1;
}

.gssw-libAlphaLink:hover { border-color: rgba(255,255,255,.22); }
.gssw-libAlphaLink.is-active {
  border-color: rgba(255,102,0,.65);
  box-shadow: 0 0 0 1px rgba(255,102,0,.35) inset;
}

.gssw-libLink { text-decoration: none; color: inherit; display: block; }

.gssw-libNoThumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.gssw-libPager {
  margin: 16px 0 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.gssw-libPage {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(17,17,17,1);
  color: #ff6600;
  text-decoration: none;
  font-size: 12px;
}

.gssw-libPage:hover { border-color: rgba(255,255,255,.22); }
.gssw-libPage.is-active {
  border-color: rgba(255,102,0,.65);
  box-shadow: 0 0 0 1px rgba(255,102,0,.35) inset;
}

.gssw-libPage.is-disabled { opacity: .5; cursor: default; }

.gssw-libDots {
  display: inline-flex;
  align-items: center;
  padding: 0 2px;
  opacity: .75;
}

/* --- GSSW Library (maps/models) --- */
.gssw-lib { margin: 18px 0; }

/* ===================================================================================== */
/* Player model library tweaks                                                            */
/* Folder: /uploads/gssw-downloads/player-models/{mod}/                                   */
/* Thumbs:  /uploads/gssw-player-models/{mod}/                                            */
/* Target thumb size: 164x200 (force crop/contain via object-fit)                         */
/* ===================================================================================== */

.gssw-libKind-player-models .gssw-libGrid{
  /* Fixed-size tiles (centred), responsive wrap */
  grid-template-columns: repeat(auto-fill, 164px);
  justify-content: center;
}

.gssw-libKind-player-models .gssw-libThumb{
  width: 164px;
  height: 200px;
  aspect-ratio: auto;
}

.gssw-libKind-player-models .gssw-libThumb img{
  width: 164px;
  height: 200px;
  object-fit: cover;
}

.gssw-libKind-player-models .gssw-libNoThumb{
  width: 164px;
  height: 200px;
  aspect-ratio: auto;
}

.gssw-libAlpha,
.gssw-libPager {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.gssw-libAlpha a,
.gssw-libPager a,
.gssw-libPager span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 28px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.35);
  color: #ff9900;
  text-decoration: none;
  font-size: 12px;
  line-height: 1;
}

.gssw-libAlpha a:hover,
.gssw-libPager a:hover {
  border-color: rgba(255,255,255,.25);
}

.gssw-libAlpha a.is-active,
.gssw-libPager .is-active {
  border-color: rgba(255,153,0,.65);
  background: rgba(255,153,0,.10);
  color: #ffcc66;
}

.gssw-libGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.gssw-libItem {
  margin: 0;
  overflow: hidden;
  background: rgba(0,0,0,.25);
  border: 1px solid rgb(255, 255, 255);
}

.gssw-libLink {
  display: block;
  text-decoration: none;
  color: inherit;
}

.gssw-libItem img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.gssw-libNoThumb {
  width: 100%;
  height: 140px;
  background: rgba(0,0,0,.55);
}

.gssw-libItem figcaption {
  padding: 10px 10px;
  font-size: 13px;
  color: #fff;
  background: rgba(0,0,0,.55);
  border-top: 1px solid rgba(255,255,255,.10);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gssw-libItem:hover {
  border-color: #999;
}


/* ===================================================================================== */
/* Overrides: responsive library grid + larger preview image                              */
/* ===================================================================================== */

/* Make the modal fit any screen nicely (not full-screen) */
.gssw-dlDialog{
  max-width: 1100px;
  width: calc(100% - 24px);
  margin: 8vh auto;
}

/* Bigger preview image while staying responsive */
.gssw-dlPreview{
  max-height: 72vh;
  object-fit: contain;
}

/* Library grid (replaces Gutenberg gallery styling) */
.gssw-libGrid{
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

@media (max-width: 1100px){
  .gssw-libGrid{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px){
  .gssw-libGrid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px){
  .gssw-libGrid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.gssw-libItem{ margin: 0; }

.gssw-libLink{
  display: block;
  text-decoration: none;
  color: inherit;

  background: rgba(0,0,0,.35);
  overflow: hidden;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}

.gssw-libLink:hover{
  border-color: rgba(255,255,255,.35);
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}

.gssw-libThumb{
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}
.gssw-libThumb img{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gssw-libNoThumb{
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
}

.gssw-libCaption{
  display: block;
  padding: 10px 10px;
  font-size: 13px;
  color: #fff;
  background: rgba(0,0,0,.65);
  border-top: 1px solid rgba(255,255,255,.10);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

/* ===================================================================================== */
/* Player models: fixed thumb size (164x200)                                              */
/* ===================================================================================== */

/* When kind="player-models", the PHP wrapper adds: .gssw-libKind-player-models */
.gssw-libKind-player-models .gssw-libGrid{
  /* Fixed card width so the 164px thumbs feel consistent */
  grid-template-columns: repeat(auto-fill, 164px);
  justify-content: center;
}

.gssw-libKind-player-models .gssw-libThumb,
.gssw-libKind-player-models .gssw-libNoThumb{
  width: 164px;
  height: 200px;
  aspect-ratio: auto;
}

.gssw-libKind-player-models .gssw-libThumb img{
  width: 164px;
  height: 200px;
  object-fit: cover;
}

/* Better fit on narrow screens */
@media (max-width: 420px){
  .gssw-libKind-player-models .gssw-libGrid{
    grid-template-columns: repeat(auto-fill, 150px);
  }
  .gssw-libKind-player-models .gssw-libThumb,
  .gssw-libKind-player-models .gssw-libNoThumb,
  .gssw-libKind-player-models .gssw-libThumb img{
    width: 150px;
    height: 183px;
  }
}
