/*
 * PromXAI Theme 2.0.7 — canonical Library/Favorites identity badges.
 * One owner for both Library and Favorites. Physical contract mirrors the
 * prompt identity rail: content kind at top-right; PRO or price at top-left.
 */
.px-library-card-badges {
  position: absolute;
  z-index: 12;
  top: 11px;
  left: 11px;
  right: 11px;
  display: grid;
  grid-template-columns: auto minmax(12px,1fr) auto;
  align-items: start;
  pointer-events: none;
  direction: ltr !important;
}

.px-library-card-badge {
  position: relative;
  z-index: 1;
  height: 28px;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  overflow: hidden;
  isolation: isolate;
  color: #fff;
  box-sizing: border-box;
  -webkit-backdrop-filter: blur(12px) saturate(135%);
  backdrop-filter: blur(12px) saturate(135%);
  box-shadow: 0 8px 18px rgba(0,0,0,.18);
  font: 900 10px/1 Inter,"IBM Plex Sans Arabic",sans-serif;
  letter-spacing: .08px;
  white-space: nowrap;
}

.px-library-card-badge--pro {
  grid-column: 1;
  justify-self: start;
  width: 64px;
  min-width: 64px;
  padding-inline: 8px;
  background: linear-gradient(120deg,#3677ef 0%,#7257ef 58%,#c447d0 100%);
  box-shadow: 0 8px 18px rgba(0,0,0,.18), 0 8px 20px rgba(124,58,237,.24);
  letter-spacing: .04em;
}

.px-library-card-badge--price {
  grid-column: 1;
  justify-self: start;
  min-width: 72px;
  max-width: 112px;
  padding-inline: 10px;
  color: #241a0c;
  border-color: rgba(255,238,195,.58);
  background: linear-gradient(120deg,#d5af68 0%,#c99a45 52%,#b98735 100%);
  box-shadow: 0 8px 18px rgba(0,0,0,.18), 0 8px 20px rgba(185,135,53,.24);
  text-shadow: 0 1px 0 rgba(255,255,255,.24);
  font-size: 9px;
  letter-spacing: 0;
  direction: ltr;
}
.px-library-card-badge--price .px-lang-ar { direction: rtl; unicode-bidi: plaintext; }
.px-library-card-badge--price .px-lang-en { direction: ltr; unicode-bidi: plaintext; }

.px-library-card-badge--kind {
  grid-column: 3;
  justify-self: end;
  min-width: 64px;
  max-width: min(45vw, 104px);
  padding-inline: 9px 10px;
}

.px-library-card-badge--kind .px-icon {
  width: 13px;
  height: 13px;
  min-width: 13px;
  flex: 0 0 13px;
  color: currentColor;
}

/*
 * Stable type colors: geometry never changes, only semantic paint.
 * Book = PromXAI violet; Template = teal/green; Article = blue; Bundle = bronze.
 */
.px-library-card-badge--kind.is-book {
  background: linear-gradient(135deg,#5b3fd6 0%,#7c5cfc 100%);
  box-shadow: 0 8px 18px rgba(0,0,0,.18), 0 8px 20px rgba(124,92,252,.22);
}
.px-library-card-badge--kind.is-template {
  background: linear-gradient(135deg,#0f766e 0%,#19b89a 100%);
  box-shadow: 0 8px 18px rgba(0,0,0,.18), 0 8px 20px rgba(25,184,154,.20);
}
.px-library-card-badge--kind.is-article {
  background: linear-gradient(135deg,#1d5fbf 0%,#2997e8 100%);
  box-shadow: 0 8px 18px rgba(0,0,0,.18), 0 8px 20px rgba(41,151,232,.20);
}
.px-library-card-badge--kind.is-bundle {
  background: linear-gradient(135deg,#824b2b 0%,#b97845 100%);
  box-shadow: 0 8px 18px rgba(0,0,0,.18), 0 8px 20px rgba(185,120,69,.20);
}

/* Same restrained paint-only shine as prompt PRO/Featured. */
.px-library-card-badge::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: -45%;
  bottom: -45%;
  left: -48%;
  width: 30%;
  pointer-events: none;
  background: linear-gradient(105deg,transparent 0%,rgba(255,255,255,.06) 25%,rgba(255,255,255,.70) 50%,rgba(255,255,255,.08) 74%,transparent 100%);
  filter: blur(.2px);
  transform: translateX(-180%) rotate(8deg);
  animation: pxLibraryBadgeShine 4.2s cubic-bezier(.35,.05,.2,1) infinite;
}
.px-library-card-badge--kind::after { animation-delay: .55s; }

@keyframes pxLibraryBadgeShine {
  0%,56% { transform: translateX(-180%) rotate(8deg); opacity: 0; }
  61% { opacity: .82; }
  78% { transform: translateX(520%) rotate(8deg); opacity: .48; }
  82%,100% { transform: translateX(520%) rotate(8deg); opacity: 0; }
}

@media (max-width:760px) {
  .px-library-card-badges {
    top: 10px;
    left: 10px;
    right: 10px;
    grid-template-columns: auto minmax(8px,1fr) auto;
  }
  .px-library-card-badge {
    height: 24px;
    min-height: 24px;
    padding-inline: 6px;
    gap: 4px;
    font-size: 9px;
  }
  .px-library-card-badge--pro {
    width: 50px;
    min-width: 50px;
  }
  .px-library-card-badge--price {
    min-width: 58px;
    max-width: 88px;
    padding-inline: 7px;
    font-size: 8px;
  }
  .px-library-card-badge--kind {
    min-width: 50px;
    max-width: 86px;
    padding-inline: 7px;
  }
  .px-library-card-badge--kind .px-icon {
    width: 11px;
    height: 11px;
    min-width: 11px;
    flex-basis: 11px;
  }
}

@media (prefers-reduced-motion:reduce) {
  .px-library-card-badge::after {
    animation: none !important;
    display: none !important;
  }
}
