/* ========== PLUGINS PAGE (Browse-style hero) ========== */
/* Layout #dashboard / .content → Styles/shared.css (plus d’override global ici) */
#plugins-content .browse-hero {
  margin-bottom: clamp(24px, 3.5vw, 40px);
}

#plugins-content .browse-hero-title {
  padding-left: 0;
  padding-right: 0;
}

#plugins-content .browse-hero-body {
  padding-left: 0;
  padding-right: 0;
}

/* ========== FILTER BAR (Plugins) — réutilise .feed-filter-* ========== */
.vst-filter-bar {
  flex-wrap: wrap;
  margin-bottom: clamp(16px, 2.4vw, 26px);
}

/* ========== GRID (Plugins) — 3 par rangée, cartes basses ========== */
#vstGrid.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 28px);
  flex-shrink: 0;
}

@media (max-width: 960px) {
  #vstGrid.grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  #vstGrid.grid {
    grid-template-columns: 1fr;
  }
}

/* ========== VST CARD (minimal, aligné Browse / variables) ========== */
.vst-card-wrap {
  width: 100%;
  min-width: 0;
}

.vst-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  overflow: visible;
  outline: none;
  box-shadow: none;
}

.vst-card:hover,
.vst-card:focus-within {
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

.vst-card:focus-visible .vst-card__media {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
  box-shadow: none;
}

[data-theme="dark"] .vst-card,
[data-theme="dark"] .vst-card:hover,
[data-theme="dark"] .vst-card:focus-within {
  box-shadow: none;
}

.vst-card--locked .vst-card__media {
  opacity: 0.88;
}

.vst-card__pill {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 9;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid var(--border-soft);
  box-shadow: 0 2px 8px var(--shadow);
}

/* Stage image — cadre fixe, fond léger, screenshot centré */
.vst-card__media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: clamp(10px, 3.5%, 16px);
  box-sizing: border-box;
  background: var(--bg-tertiary);
  overflow: visible;
  border-radius: 0;
  flex-shrink: 0;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.vst-card:hover .vst-card__media,
.vst-card:focus-within .vst-card__media {
  transform: translateY(-4px);
}

.vst-card--downloading .vst-card__media {
  transform: none;
}

[data-theme="dark"] .vst-card__media {
  background: var(--bg-secondary);
}

.vst-card__img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.08)) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.05));
  transition: filter 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.vst-card:hover .vst-card__img,
.vst-card:focus-within .vst-card__img {
  filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.12)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.08));
}

[data-theme="dark"] .vst-card__img {
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.32)) drop-shadow(0 1px 3px rgba(0, 0, 0, 0.2));
}

[data-theme="dark"] .vst-card:hover .vst-card__img,
[data-theme="dark"] .vst-card:focus-within .vst-card__img {
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.45)) drop-shadow(0 3px 8px rgba(0, 0, 0, 0.28));
}

.vst-card__placeholder {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0;
  user-select: none;
  color: var(--text-secondary);
  background: linear-gradient(145deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
}

.vst-card__placeholder::before {
  content: "";
  width: clamp(40px, 14%, 56px);
  aspect-ratio: 1;
  background: currentColor;
  mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="4" y1="21" x2="4" y2="14"/><line x1="4" y1="10" x2="4" y2="3"/><line x1="12" y1="21" x2="12" y2="12"/><line x1="12" y1="8" x2="12" y2="3"/><line x1="20" y1="21" x2="20" y2="16"/><line x1="20" y1="12" x2="20" y2="3"/><line x1="1" y1="14" x2="7" y2="14"/><line x1="9" y1="8" x2="15" y2="8"/><line x1="17" y1="16" x2="23" y2="16"/></svg>');
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
}

.vst-card__placeholder--visible {
  display: flex;
}

/* Voile + spinner sur l’image ; progression dans la pill */
.vst-card__media-shade {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.36);
  pointer-events: none;
  isolation: isolate;
}

.vst-card--downloading .vst-card__media-shade {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vst-card--downloading .vst-card__media-shade[data-vst-pct]::after {
  content: attr(data-vst-pct);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

#vstGrid .vst-card__media-spinner {
  width: 40px;
  height: 40px;
}

#vstGrid .vst-card__media-spinner svg {
  width: 100%;
  height: 100%;
  transform-origin: center;
  animation: rotate4 0.75s linear infinite;
  will-change: transform;
}

/* Ne pas cumuler dash4 (like-down.css .spinner circle) avec la rotation — ça saute à chaque tour */
#vstGrid .vst-card__media-spinner circle {
  fill: none;
  stroke: #fff;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 75, 25;
  stroke-dashoffset: 0;
  animation: none;
}

/* Coin photo : badges discrets */
.vst-card__corner {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 8;
  pointer-events: none;
}

.vst-card__corner--label {
  display: inline-block;
  padding: 0;
  border: none;
  border-radius: 0;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: none;
  color: var(--fg-whisper);
  background: transparent;
  box-shadow: none;
}

.vst-card__corner--free {
  color: #16a34a;
  font-weight: 500;
}

[data-theme="dark"] .vst-card__corner--free {
  color: #4ade80;
}

.vst-card__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 0 0;
  min-width: 0;
  flex: 1;
}

.vst-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.vst-card__title {
  margin: 0;
  font-size: var(--font-size-md);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.25;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ========== ACTIONS — boutons icônes (alignés loop cards) ========== */
.vst-card__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.vst-card__installed-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.vst-card__installed-group .vst-act--trash {
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, max-width 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.vst-card__installed-group:hover .vst-act--trash,
.vst-card__installed-group:focus-within .vst-act--trash {
  opacity: 1;
  max-width: 34px;
  pointer-events: auto;
}

.vst-card__installed-group:hover .vst-act--check,
.vst-card__installed-group:focus-within .vst-act--check {
  cursor: pointer;
  background: var(--surface-hover);
}

.vst-act {
  position: relative;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  overflow: hidden;
  transition: background 0.18s ease, color 0.18s ease;
}

.vst-act:hover {
  background: var(--surface-hover);
}

.vst-act__icon {
  width: 19px;
  height: 19px;
  display: block;
  stroke: currentColor;
  fill: none;
}

.vst-act--check {
  color: #16a34a;
  cursor: default;
}

.vst-act--check:hover {
  background: transparent;
}

.vst-act--trash {
  color: var(--text-muted);
}

.vst-act--trash:hover {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
}

/* Bouton texte « Mettre à jour » (remplace icônes quand une MAJ est dispo) */
.vst-card__pill-action--update {
  color: #15803d;
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
}

.vst-card__pill-action--update:hover:not(:disabled):not(.downloading) {
  background: rgba(34, 197, 94, 0.14);
  border-color: #16a34a;
}

[data-theme="dark"] .vst-card__pill-action--update {
  color: #86efac;
  border-color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
}

.vst-card__pill-action--update.downloading {
  min-width: 5.5rem;
  cursor: wait;
}

.vst-card__pill-action--update.downloading .vst-card__update-label {
  display: none;
}

.vst-card__pill-action--update .vst-act__spinner {
  display: none;
  width: 16px;
  height: 16px;
}

.vst-card__pill-action--update.downloading .vst-act__spinner {
  display: block;
}

[data-theme="dark"] .vst-act--check {
  color: #4ade80;
}

[data-theme="dark"] .vst-act--trash:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.12);
}

/* Spinner pendant le téléchargement / désinstallation */
.vst-act__spinner {
  display: none;
  width: 19px;
  height: 19px;
}

.vst-act.downloading {
  cursor: wait;
  background: var(--surface-hover);
}

.vst-act.downloading .vst-act__icon {
  display: none;
}

.vst-act.downloading .vst-act__spinner {
  display: block;
}

.vst-act__spinner svg {
  width: 100%;
  height: 100%;
  animation: rotate 1s linear infinite;
}

.vst-act__spinner circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 4;
  stroke-dasharray: 80, 200;
  stroke-linecap: round;
  animation: dash 1.5s ease-in-out infinite;
}

/* Pastille titre : Install / Demo, ou Installed → Uninstall (rouge au survol) */
.vst-card__pill-action {
  flex-shrink: 0;
  margin: 0;
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid var(--border-soft);
  background: var(--bg-secondary);
  color: var(--fg-hint);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    background 0.15s ease,
    opacity 0.15s ease;
}

.vst-card__pill-action.downloading {
  opacity: 1;
  cursor: pointer;
}

.vst-card__pill-action:disabled:not(.downloading) {
  opacity: 0.45;
  cursor: not-allowed;
}

.vst-card__desc {
  margin: 2px 0 0;
  font-size: var(--font-size-md);
  color: var(--text-muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vst-card__license-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin-top: 8px;
  padding-top: 0;
  border-top: none;
  width: 100%;
}

.vst-card__license-left:empty {
  display: none;
}

.vst-card__license-left {
  min-width: 0;
  flex: none;
  text-align: left;
}

.vst-card__license-right {
  min-width: 0;
  flex: none;
  text-align: right;
}

/* Tooltip « Tout retirer » — même style .lc-tooltip que les loop cards */
#vstGrid .vst-card__clear-all-wrap {
  max-width: 100%;
}

#vstGrid .vst-card .lc-tooltip-trigger:focus-within .lc-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#vstGrid .vst-card .lc-tooltip {
  white-space: normal;
  max-width: min(240px, calc(100vw - 48px));
  text-align: center;
  line-height: 1.35;
}

/* Annule .btn global (hover noir) pour les liens licence */
#vstGrid .vst-card__link-btn {
  display: inline;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 0;
  background: none;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  color: var(--fg-whisper);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

#vstGrid .vst-card__link-btn:hover:not(:disabled) {
  background: transparent;
  color: var(--text-primary);
}

#vstGrid .vst-card__link-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.vst-card__meta {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vst-card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
  margin-top: auto;
  padding-top: 4px;
  border-top: none;
}

.vst-card__foot-start {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.vst-card__foot-end {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

.vst-card__foot:empty {
  display: none;
}

.vst-card__version,
.vst-card__size,
.vst-card__activations {
  font-size: 11px;
  color: var(--fg-whisper);
  font-weight: 400;
  letter-spacing: 0.01em;
}

.vst-card__buy-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
}

.vst-card__buy-btn {
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-primary);
  cursor: pointer;
  transition: opacity 0.18s ease;
  white-space: nowrap;
}

.vst-card__buy-btn:hover {
  opacity: 0.72;
}

.vst-card__app-only-btn {
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-primary);
  cursor: pointer;
  transition: opacity 0.18s ease;
  white-space: nowrap;
}

.vst-card__app-only-btn:hover {
  opacity: 0.72;
}

.vst-card__price-label {
  font-size: 10px;
  font-weight: 400;
  color: var(--fg-whisper);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.vst-card__product-link {
  display: inline;
  font-size: 11px;
  font-weight: 400;
  color: var(--fg-whisper);
  text-decoration: none;
  border: none;
  background: none;
  transition: color 0.15s ease;
  flex-shrink: 0;
}

.vst-card__product-link:hover {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
