﻿.library-card{
  overflow:visible;
}

.models-toolbar{
  align-items:start;
  grid-template-columns:240px auto 1fr 130px;
}

.filter-mode{
  min-width:190px;
  height:48px;
  padding:5px;
  border:2px solid #202426;
  border-radius:4px;
  background:#fff;
  display:grid;
  grid-template-columns:auto 1fr 1fr;
  align-items:center;
  gap:4px;
  box-shadow:0 10px 28px rgba(32,36,38,.12);
}

.filter-mode span{
  padding:0 8px;
  color:#c8202f;
  font-size:11px;
  font-weight:900;
  white-space:nowrap;
}

.filter-mode button{
  height:34px;
  border:1px solid #dfe2e3;
  border-radius:3px;
  background:#f7f8f8;
  color:#202426;
  font-size:11px;
  font-weight:900;
}

.filter-mode button.selected{
  border-color:#c8202f;
  background:#c8202f;
  color:#fff;
  box-shadow:0 8px 18px rgba(200,32,47,.24);
}

.category-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  overflow:visible;
  min-width:0;
  padding:0;
}

.category-tabs button{
  flex:0 0 auto;
}

.model-visual{
  aspect-ratio:1 / 1;
  height:auto;
  overflow:hidden;
  isolation:isolate;
}

.model-tags{
  position:absolute;
  top:10px;
  right:10px;
  z-index:7;
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:6px;
  max-width:82%;
  pointer-events:none;
}

.model-card-tools{
  position:absolute;
  left:10px;
  bottom:10px;
  z-index:9;
  display:flex;
  gap:8px;
}

.model-tool-button{
  width:38px;
  height:38px;
  border:1px solid rgba(255,255,255,.72);
  border-radius:5px;
  background:rgba(32,36,38,.88);
  color:#fff;
  display:grid;
  place-items:center;
  box-shadow:0 8px 22px rgba(0,0,0,.28);
}

.model-tool-button svg{
  width:18px;
  height:18px;
}

.model-tool-button.like.active{
  border-color:#ff9aa4;
  background:#c8202f;
}

.model-tool-button.report.active{
  border-color:#ffd06a;
  background:#b45309;
}

.model-tool-button:hover{
  background:#fff;
  color:#202426;
}

.model-tag{
  min-width:38px;
  width:auto;
  height:28px;
  padding:0 10px;
  border-radius:5px;
  display:grid;
  place-items:center;
  background:#4f5559;
  color:#fff;
  font-size:13px;
  font-weight:900;
  line-height:1;
  white-space:nowrap;
  box-shadow:0 5px 14px rgba(0,0,0,.28);
  animation:modelTagFloat 2.4s ease-in-out infinite;
}

.model-tag:nth-child(2){animation-delay:.12s}
.model-tag:nth-child(3){animation-delay:.24s}
.model-tag:nth-child(4){animation-delay:.36s}
.model-tag.tag-v2{background:#d8202f}
.model-tag.tag-vsw{background:#10a45d}
.model-tag.tag-vt{background:#f05a10}
.model-tag.tag-v0{background:#4f5559}
.model-tag.tag-stealthburner{background:#7c3aed}
.model-tag.tag-afterburner{background:#9f1239}
.model-tag.tag-klicky{background:#0f766e}
.model-tag.tag-nevermore{background:#334155}
.model-tag.tag-adxl{background:#2563eb}
.model-tag.tag-mgn{background:#7c2d12}
.model-tag.tag-skirt{background:#9333ea}
.model-tag.tag-creality{background:#0ea5e9}
.model-tag.tag-cr10{background:#0284c7}
.model-tag.tag-artillery{background:#52525b}
.model-tag.tag-anycubic{background:#0891b2}
.model-tag.tag-tronxy{background:#be123c}
.model-tag.tag-prusa{background:#ea580c}
.model-tag.tag-vzbot{background:#111827}
.model-tag.tag-corexy{background:#155e75}
.model-tag.tag-cpap{background:#0369a1}
.model-tag.tag-hextrudort{background:#6d28d9}
.model-tag.tag-direct-drive{background:#16a34a}
.model-tag.tag-cable-chain{background:#475569}
.model-tag.tag-filament{background:#ca8a04}
.model-tag.tag-camera{background:#4f46e5}
.model-tag.tag-bltouch{background:#db2777}
.model-tag.tag-hotend{background:#dc2626}

.model-visual:hover .model-tag{
  transform:translateY(-2px);
}

@keyframes modelTagFloat{
  0%,100%{transform:translateY(0)}
  50%{transform:translateY(-3px)}
}

.model-preview,
.model-thumb{
  transform-origin:center center;
  transition:transform .22s ease;
}

.model-visual:hover .model-preview,
.model-visual:hover .model-thumb{
  transform:none;
}

.model-visual:hover{
  z-index:5;
}

.gallery-hover-preview{
  position:fixed;
  z-index:2000;
  pointer-events:none;
  background:#202426;
  border:2px solid #fff;
  border-radius:6px;
  overflow:hidden;
  box-shadow:0 24px 80px rgba(0,0,0,.42);
}

.gallery-hover-preview img{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
}

.model-thumb-pager{
  position:absolute;
  inset:0;
  z-index:4;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 8px;
  opacity:0;
  transition:opacity .16s ease;
  pointer-events:none;
}

.model-visual:hover .model-thumb-pager{
  opacity:1;
}

.model-thumb-pager button{
  width:44px;
  height:44px;
  border:0;
  border-radius:4px;
  background:rgba(255,255,255,.92);
  color:#202426;
  font-size:9px;
  font-weight:900;
  box-shadow:0 10px 28px rgba(0,0,0,.24);
  pointer-events:auto;
}

.model-thumb-pager button:hover{
  background:#fff;
}

.model-thumb-count{
  align-self:flex-end;
  margin-bottom:10px;
  min-width:46px;
  height:26px;
  padding:0 8px;
  border-radius:13px;
  background:rgba(32,36,38,.86);
  color:#fff;
  display:grid;
  place-items:center;
  font-size:10px;
  font-weight:900;
  pointer-events:none;
}

.model-thumb-count[hidden]{
  display:none;
}

.model-thumb-loading{
  position:absolute;
  inset:0;
  z-index:6;
  display:grid;
  place-items:center;
  background:rgba(32,36,38,.36);
  pointer-events:none;
}

.model-thumb-loading[hidden]{
  display:none;
}

.model-thumb-loading span{
  width:54px;
  height:54px;
  border-radius:50%;
  border:4px solid rgba(255,255,255,.44);
  border-top-color:#fff;
  animation:gallerySpin .75s linear infinite;
  grid-area:1/1;
}

.model-thumb-loading b{
  grid-area:1/1;
  color:#fff;
  font-size:13px;
  font-weight:900;
  text-shadow:0 2px 8px rgba(0,0,0,.5);
}

@keyframes gallerySpin{
  to{transform:rotate(360deg)}
}

@media(max-width:600px){
  .models-toolbar{
    grid-template-columns:1fr 105px;
  }

  .filter-mode{
    grid-column:1/-1;
    width:100%;
  }

  .category-tabs{
    gap:6px;
  }

  .model-visual{
    height:auto;
  }
}
