/* Sblocca lo scroll (global.css lo disabilita per la home con parallax) */
body { overflow-y: auto !important; }

/* ── Layout ── */
.vouches-page {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-12) var(--space-6) var(--space-8);
  will-change: transform;
  transform: translateZ(0);
  overflow-y: auto;
}

/* ── Header ── */
.vouches-header {
  text-align: center;
  margin-bottom: var(--space-8);
  width: 100%;
}

.vouches-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: var(--space-6);
  transition: color var(--transition);
  text-decoration: none !important;
}
.vouches-back:hover { color: var(--text-muted); }

.vouches-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 900;
  letter-spacing: -.05em;
  line-height: .95;
  color: var(--text);
}

/* ── Tab bar ── */
.tab-bar {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}

.tab-btn {
  appearance: none;
  padding: 10px 28px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: .04em;
  border: 1px solid var(--border);
  background: rgba(17, 10, 28, .5);
  color: var(--text-muted);
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
  cursor: none;
}
.tab-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
}
.tab-btn.is-active {
  background: rgba(180, 80, 255, .18);
  border-color: var(--border-strong);
  color: var(--text);
  box-shadow: var(--shadow-purple);
}

/* ── Tab content ── */
.tab-content { display: none; width: 100%; max-width: 720px; }
.tab-content.is-active { display: flex; flex-direction: column; align-items: center; }

/* ── Vouches window ── */
.vouches-window {
  width: 100%;
  background: rgba(20, 5, 40, 0.55);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card), var(--shadow-purple);
  padding: var(--space-8) var(--space-6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

.vouches-count {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 700;
}

/* ── Platform filters ── */
.filters {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  justify-content: center;
}
.filter-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(180, 80, 255, .10);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-xs);
  padding: 7px 16px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  transition: all var(--transition);
  cursor: none;
  user-select: none;
}
.filter-btn:hover { border-color: var(--border-strong); color: var(--text); }
.filter-btn.is-active {
  background: rgba(180, 80, 255, .28);
  border-color: var(--border-strong);
  color: var(--text);
}

/* ── Vouch list ── */
.vouches-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.vouch {
  background: rgba(180, 80, 255, .07);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  transition: border-color var(--transition);
}
.vouch:hover { border-color: var(--border-strong); }

.vouch-author-pfp {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid var(--purple);
  object-fit: cover;
  flex-shrink: 0;
  transition: transform .2s;
  cursor: pointer;
}
.vouch-author-pfp:hover { transform: scale(1.08); }

.vouch-content { flex: 1; min-width: 0; }

.author { font-weight: 700; color: var(--purple); display: block; margin-bottom: var(--space-2); font-size: var(--text-sm); }
.author-link { color: #e4b5ff; text-decoration: none; font-weight: 800; }
.author-link:hover { text-decoration: underline; }

.mention {
  display: inline-block; padding: 0 6px; border-radius: 6px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); color: var(--text-muted);
}
.mention-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 0 10px; border-radius: 999px;
  background: rgba(0,255,170,.10); border: 1px solid rgba(0,255,170,.30);
  color: #00ffb4; font-weight: 800; line-height: 1.7;
  text-decoration: none; white-space: nowrap; font-size: var(--text-xs);
}
.mention-chip.is-self { background: rgba(180,80,255,.14); border-color: var(--border-strong); color: var(--purple); }
.mention-chip:hover { text-decoration: underline; }
.chip-text { display: inline-block; }
.chip-tag  { display: inline-flex; align-items: center; gap: 5px; }
.chip-emoji { width: 15px; height: 15px; border-radius: 3px; flex: 0 0 auto; }

.clan-tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; border-radius: 999px;
  background: rgba(0,255,170,.10); border: 1px solid rgba(0,255,170,.30);
  color: #00ffb4; font-weight: 800; line-height: 1.6; vertical-align: middle;
  font-size: var(--text-xs);
}
.clan-emoji { width: 16px; height: 16px; border-radius: 3px; display: inline-block; }

/* ── Vouch images ── */
.vouch-images {
  margin-top: var(--space-3);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-2);
}
.vouch-thumb {
  position: relative; width: 100%; aspect-ratio: 4/3;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.vouch-thumb img {
  max-width: 100%; max-height: 100%; object-fit: contain; display: block;
  transition: transform .15s ease; cursor: pointer; border-radius: var(--radius-sm);
}
.vouch-thumb img:hover { transform: scale(1.02); }

/* ── New vouches (myvouch.es) ── */
.vouch-stars {
  display: flex;
  gap: 2px;
  margin-bottom: var(--space-2);
  color: #f8b500;
  font-size: var(--text-xs);
}
.vouch-stars .star-off { color: var(--text-faint); opacity: .4; }

.vouch-proof {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  color: #e4b5ff;
  text-decoration: none;
}
.vouch-proof:hover { text-decoration: underline; }

.vouch-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
  font-size: var(--text-xs);
  color: var(--text-faint);
}
.vouch-meta .vouch-num { font-weight: 700; color: var(--text-muted); }

.myvouch-notice {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: rgba(180, 80, 255, .10);
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}
.myvouch-notice strong { color: var(--text); font-weight: 800; }
.myvouch-notice-icon { color: var(--purple); margin-right: 4px; }
.myvouch-notice-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 7px 16px;
  border-radius: var(--radius-full);
  background: rgba(180, 80, 255, .18);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: var(--text-xs);
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  transition: background var(--transition), box-shadow var(--transition);
}
.myvouch-notice-link:hover {
  background: rgba(180, 80, 255, .30);
  box-shadow: var(--shadow-purple);
}

/* ── Popup (click su avatar) ── */
#popup-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 10000; display: none; }
#user-id-popup {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: rgba(10,1,24,.92); color: var(--text);
  padding: var(--space-6) var(--space-8);
  border: 1px solid var(--border-strong); border-radius: var(--radius-xl);
  box-shadow: 0 0 30px rgba(180,80,255,.35);
  z-index: 10001; backdrop-filter: blur(12px);
  display: none; text-align: center;
}
#user-id-popup p { margin: 0; font-size: var(--text-sm); color: var(--text-muted); }
#user-id-popup span {
  font-weight: 700; color: #ff00c1;
  background: rgba(255,255,255,.08);
  padding: 4px 10px; border-radius: var(--radius-sm);
  margin-top: var(--space-2); display: inline-block;
  font-family: 'Courier New', monospace;
}

/* ── Lightbox ── */
#img-lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.8);
  display: none; align-items: center; justify-content: center;
  z-index: 10002; padding: 4vmin;
}
#img-lightbox[aria-hidden="false"] { display: flex; }
#img-lightbox img {
  max-width: min(92vw, 1200px); max-height: 88vh;
  border-radius: var(--radius-xl);
  box-shadow: 0 0 30px rgba(0,0,0,.6), 0 0 30px rgba(180,80,255,.2) inset;
}
#img-lightbox-close {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.6);
  background: transparent; color: #fff; font-size: 22px;
  display: grid; place-items: center; cursor: pointer;
}
body.lightbox-open { overflow: hidden; }
body.lightbox-open .cursor, body.lightbox-open .cursor-trail { display: none !important; }

/* ── Infinite scroll sentinel ── */
.load-sentinel {
  width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.load-sentinel::after {
  content: '';
  width: 22px; height: 22px;
  border: 2px solid var(--border);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.load-sentinel.hidden { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── SellAuth vouches ── */
.vouch-sa-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid var(--purple);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(180, 80, 255, .15);
  color: var(--purple);
  font-size: 18px;
}

.vouch-sa-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.vouch-sa-buyer {
  font-weight: 700;
  color: var(--purple);
  font-size: var(--text-sm);
}

.vouch-sa-date {
  font-size: var(--text-xs);
  color: var(--text-faint);
  white-space: nowrap;
}

.vouch-sa-message {
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.6;
  margin-bottom: var(--space-2);
}

.vouch-sa-product {
  font-size: var(--text-xs);
  color: var(--text-faint);
  font-weight: 600;
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
  margin-top: var(--space-2);
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .tab-bar { gap: var(--space-2); }
  .tab-btn { padding: 9px 18px; font-size: var(--text-xs); }
  .vouches-window { padding: var(--space-5) var(--space-4); }
  .vouch { gap: var(--space-3); }
}
