/* ============================================================
   gallery.css — Public gallery page styles (index.php)
============================================================ */

/* ── Header override ────────────────────────────────────────── */
header { backdrop-filter: blur(8px); }

/* ── Admin link ─────────────────────────────────────────────── */
.admin-link {
  color: #656d76;
  font-size: .82rem;
  text-decoration: none;
  border: 1px solid var(--border);
  padding: .38rem .85rem;
  border-radius: var(--radius);
  transition: color .2s, border-color .2s;
}
.admin-link:hover { color: var(--accent); border-color: var(--accent); }

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 4rem 1.5rem 3rem;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0,201,167,.07) 0%, transparent 65%);
  border-bottom: 1px solid var(--border);
}
.hero-tag {
  display: inline-block;
  border: 1px solid rgba(0,201,167,.35);
  color: var(--accent);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .3rem .8rem;
  border-radius: 20px;
  margin-bottom: 1.25rem;
}
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  color: var(--heading);
  line-height: 1.15;
  margin-bottom: .9rem;
}
.hero h1 span { color: var(--accent); }
.hero p {
  color: #8b949e;
  max-width: 520px;
  margin: 0 auto;
  font-size: 1rem;
  line-height: 1.65;
}

/* ── Category filters ───────────────────────────────────────── */
.filters {
  max-width: 1100px;
  margin: 2rem auto 0;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}
.filter-label { font-size: .78rem; color: #656d76; font-weight: 600; margin-right: .25rem; }
.filter-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: .38rem .9rem;
  border-radius: 20px;
  font-size: .8rem;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
  text-decoration: none;
  display: inline-block;
}
.filter-btn:hover,
.filter-btn.active {
  background: rgba(0,201,167,.12);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Gallery grid ───────────────────────────────────────────── */
.gallery {
  max-width: 1100px;
  margin: 2rem auto 4rem;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* ── Model card ─────────────────────────────────────────────── */
.model-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color .25s, transform .2s, box-shadow .2s;
}
.model-card:hover {
  border-color: rgba(0,201,167,.4);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,.5);
}

.card-thumb {
  height: 150px;
  background: var(--surface2);
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.card-thumb-icon { font-size: 3.5rem; opacity: .25; user-select: none; }
.card-thumb::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(0,201,167,.06) 0%, transparent 70%);
}

.card-body  { padding: 1.1rem 1.1rem .75rem; flex: 1; display: flex; flex-direction: column; gap: .5rem; }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.card-title  { color: var(--heading); font-weight: 700; font-size: .97rem; line-height: 1.3; }

/* Badge override for cards (slightly smaller) */
.card-body .badge {
  padding: .18rem .55rem;
  font-size: .67rem;
  flex-shrink: 0;
  margin-top: .1rem;
}

.card-desc { color: #8b949e; font-size: .83rem; line-height: 1.55; flex: 1; }
.card-meta { font-size: .72rem; color: #656d76; }
.card-footer { padding: .75rem 1.1rem 1.1rem; }

/* ── Card buttons ───────────────────────────────────────────── */
.btn-view {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  background: rgba(0,201,167,.1);
  border: 1px solid rgba(0,201,167,.3);
  color: var(--accent);
  padding: .6rem;
  border-radius: 7px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.btn-view:hover { background: rgba(0,201,167,.2); border-color: var(--accent); }
.btn-view svg { transition: transform .2s; }
.btn-view:hover svg { transform: scale(1.15); }

.btn-details {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  width: 100%;
  padding: .5rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: #8b949e;
  font-size: .8rem;
  font-weight: 500;
  text-decoration: none;
  margin-top: .5rem;
  transition: border-color .2s, color .2s;
}
.btn-details:hover { border-color: var(--accent); color: var(--accent); }

/* ── Empty / error state ────────────────────────────────────── */
.state-box {
  grid-column: 1 / -1;
  text-align: center;
  padding: 5rem 1rem;
  color: #656d76;
}
.state-box svg { margin-bottom: 1.25rem; opacity: .3; }
.state-box h3 { color: var(--heading); margin-bottom: .5rem; }

/* ── Full-screen modal ──────────────────────────────────────── */
#viewerModal {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(6px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
#viewerModal.open { display: flex; }

.modal-inner {
  position: relative;
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
}

.modal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 1rem;
}
.modal-title-wrap { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.modal-title {
  font-weight: 700;
  color: var(--heading);
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.modal-badge { flex-shrink: 0; }
.modal-controls { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }

.btn-close {
  background: transparent;
  border: 1px solid var(--border);
  color: #656d76;
  width: 34px; height: 34px;
  border-radius: 7px;
  display: grid; place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 1.1rem;
  transition: border-color .2s, color .2s;
}
.btn-close:hover { border-color: #f85149; color: #f85149; }

/* ── Canvas wrap (modal — fills remaining height) ───────────── */
#canvasWrap {
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* ── Hint bar (modal — floating pill) ───────────────────────── */
.hint-bar {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.65);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: .35rem 1rem;
  font-size: .72rem;
  color: #656d76;
  pointer-events: none;
  white-space: nowrap;
  opacity: 1;
  transition: opacity .5s;
}
.hint-bar.fade { opacity: 0; }

/* ── Spinner size for modal ─────────────────────────────────── */
.spinner { width: 44px; height: 44px; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .modal-bar { flex-wrap: wrap; }
  .modal-controls { flex-wrap: wrap; }
  .ctrl-btn span { display: none; }
}
