/* ========== DASHBOARD ========== */
#dashboard { 
  display: none;
}

#dashboard[style*="display: block"] {
  display: flex !important;
}

/* ========== CONTENT (VST override) ========== */
.content { 
  padding: 40px clamp(20px, 5vw, 50px) 40px clamp(10px, 2.5vw, 28px);
  overflow-y: auto;
  overflow-x: visible;
  display: flex;
  flex-direction: column;
}

.content > * {
  flex-shrink: 0;
}

/* ========== WELCOME (legacy — remplacé par browse-hero) ========== */
.welcome h2 { 
  font-size: 2rem; 
  margin-bottom: 6px;
  color: var(--text-primary);
  transition: color 0.3s ease;
}

.welcome p { 
  color: #333; 
  margin-bottom: 24px;
  transition: color 0.3s ease;
}

[data-theme="dark"] .welcome p {
  color: var(--text-secondary);
}

/* ========== PLUGINS PAGE (Browse-style hero) ========== */
#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;
}

/* ========== SUBSCRIPTION BANNER ========== */
.subscription-banner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 32px;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

.subscription-banner .badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  width: fit-content;
}

.subscription-banner h3 {
  font-size: 1.5rem;
  font-weight: 600;
}

.subscription-banner p {
  opacity: 0.9;
}

.subscription-banner button {
  background: white;
  color: #667eea;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  width: fit-content;
  transition: transform 0.2s ease;
}

.subscription-banner button:hover {
  transform: scale(1.05);
}

/* ========== 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 (LikeDown.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;
}

/* Pastille « Installed » sur l’image : outline vert uniquement */
.vst-card__corner--installed {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 100px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #15803d;
  background: transparent;
  border: 1px solid #22c55e;
  box-shadow: none;
}

[data-theme="dark"] .vst-card__corner--installed {
  color: #86efac;
  border-color: #4ade80;
}

.vst-card__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  font-family: 'Satoshi', 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid transparent;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    opacity 0.18s ease;
}

/* Spinner visible sur l’overlay (LikeDown.css met stroke #000 après — on force ici) */
#vstGrid .vst-card__btn .spinner {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

#vstGrid .vst-card__btn .spinner svg {
  width: 100%;
  height: 100%;
  transform-origin: center;
  animation: rotate4 0.75s linear infinite;
  will-change: transform;
}

#vstGrid .vst-card__btn .spinner circle {
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 75, 25;
  stroke-dashoffset: 0;
  animation: none;
}

#vstGrid .vst-card__btn--primary .spinner circle {
  stroke: var(--bg-primary);
  stroke-width: 2.75;
}

#vstGrid .vst-card__pill-action .spinner,
#vstGrid .vst-card__link-btn .spinner {
  width: 14px;
  height: 14px;
}

#vstGrid .vst-card__pill-action .spinner circle,
#vstGrid .vst-card__link-btn .spinner circle {
  stroke: currentColor;
  stroke-width: 2.5;
  animation: none;
}

#vstGrid .vst-card__pill-action--install .spinner circle {
  stroke: var(--bg-primary);
}

.vst-card__btn--primary {
  background: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
}

.vst-card__btn--primary:hover:not(:disabled) {
  opacity: 0.92;
}

.vst-card__btn--block {
  width: 100%;
  box-sizing: border-box;
}

.vst-card__btn:disabled:not(.downloading) {
  opacity: 0.45;
  cursor: not-allowed;
}

.vst-card__btn.downloading {
  opacity: 1;
  cursor: wait;
}

.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: 2px;
  flex-shrink: 0;
}

.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);
}

.vst-act--update {
  color: #16a34a;
}

[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--install {
  background: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
}

.vst-card__pill-action--install:hover:not(:disabled) {
  opacity: 0.88;
}

/* Progression téléchargement dans la pill (contraste garanti sur image produit blanche) */
#vstGrid .vst-card__pill-action.vst-card__pill-action--busy {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 6.85rem;
  min-height: 2rem;
  padding-left: 10px;
  padding-right: 10px;
}

#vstGrid .vst-card__pill-action--busy .vst-card__pill-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: rgba(255, 255, 255, 0.26);
  border-radius: 0;
  z-index: 0;
  pointer-events: none;
  transform: none;
  transition: width 0.22s ease-out;
}

#vstGrid .vst-card__pill-action--busy .vst-card__pill-progress-fill--indeterminate {
  width: 36% !important;
  transition: none;
  animation: vstPillDownloadIndeterminate 1.15s ease-in-out infinite;
}

@keyframes vstPillDownloadIndeterminate {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(280%);
  }
}

#vstGrid .vst-card__pill-action--busy .vst-card__pill-progress-label,
#vstGrid .vst-card__pill-action--busy .vst-card__pill-cancel-label {
  position: relative;
  z-index: 1;
  display: inline-block;
  max-width: 13rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  transition: opacity 0.15s ease;
}

#vstGrid .vst-card__pill-action--busy .vst-card__pill-cancel-label {
  display: none;
  position: absolute;
  color: #dc2626;
}

#vstGrid .vst-card__pill-action--busy:hover {
  cursor: pointer;
  border-color: rgba(220, 38, 38, 0.5);
  background: rgba(220, 38, 38, 0.06);
}

#vstGrid .vst-card__pill-action--busy:hover .vst-card__pill-progress-label {
  opacity: 0;
}

#vstGrid .vst-card__pill-action--busy:hover .vst-card__pill-cancel-label {
  display: inline-block;
}

#vstGrid .vst-card__pill-action--busy:hover .vst-card__pill-progress-fill {
  opacity: 0.3;
}

/* Bouton "Installed" : vert */
.vst-card__pill-action--installed {
  color: #15803d;
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
}

[data-theme="dark"] .vst-card__pill-action--installed {
  color: #86efac;
  border-color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
}

/* Hover → rouge "Uninstall" */
.vst-card__pill-action--installed:hover:not(:disabled),
.vst-card__pill-action--installed:focus-visible:not(:disabled) {
  border-color: rgba(220, 38, 38, 0.45);
  background: rgba(220, 38, 38, 0.06);
  color: #dc2626;
}

.vst-card__install-toggle__on-hover {
  display: none;
  color: #dc2626;
}

.vst-card__pill-action--installed:hover:not(:disabled) .vst-card__install-toggle__show,
.vst-card__pill-action--installed:focus-visible:not(:disabled) .vst-card__install-toggle__show {
  display: none;
}

.vst-card__pill-action--installed:hover:not(:disabled) .vst-card__install-toggle__on-hover,
.vst-card__pill-action--installed:focus-visible:not(:disabled) .vst-card__install-toggle__on-hover {
  display: inline;
}

.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__no-demo {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.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__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;
}

/* ========== SEARCH BAR ========== */
.search-bar input:focus {
  border-color: #000;
}

.search-bar input::placeholder {
  color: #999;
}
