/*
 * WS Hologram Verification — front-end styles.
 * Inherits the active theme's font and accent color automatically
 * (see includes/theme-inherit.php, which sets --wsh-accent / --wsh-font
 * as inline CSS variables based on the site's own theme.json / palette).
 * Surfaces use translucent "glass" overlays on top of whatever background
 * color the theme provides, rather than forcing a fixed light/dark look,
 * so this plugin sits naturally in any theme.
 */

.wsh-lookup {
  --wsh-accent: #6c8cff; /* overridden inline per-site */
  --wsh-font: inherit;   /* overridden inline per-site */
  --wsh-success: #4caf6d;
  --wsh-danger: #c65b4e;

  max-width: 880px;
  margin: 0 auto;
  padding: 20px;
  font-family: var(--wsh-font);
  color: inherit;
}

.wsh-lookup__card {
  position: relative;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  align-items: center;
  background: rgba(127, 127, 127, 0.06);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(127, 127, 127, 0.22);
  border-radius: 18px;
  padding: 44px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
}

.wsh-lookup__card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 18px;
  padding: 1px;
  background: linear-gradient(120deg, var(--wsh-accent), transparent 30%, transparent 70%, var(--wsh-accent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.4;
  pointer-events: none;
}

.wsh-lookup__visual {
  display: flex;
  justify-content: center;
}

.wsh-hologram-chip {
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: 22px;
  background: conic-gradient(from 180deg, #7f7fd5, #86a8e7, #91eae4, #e39ff2, #7f7fd5);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(124, 132, 250, 0.25), inset 0 0 30px rgba(255, 255, 255, 0.25);
  animation: wsh-hue-rotate 8s linear infinite;
}

@keyframes wsh-hue-rotate {
  to { filter: hue-rotate(360deg); }
}

.wsh-hologram-chip__shine {
  position: absolute;
  inset: -50%;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.55) 48%, transparent 60%);
  animation: wsh-shine 3.2s ease-in-out infinite;
}

@keyframes wsh-shine {
  0% { transform: translateX(-60%) translateY(-60%); }
  100% { transform: translateX(60%) translateY(60%); }
}

.wsh-hologram-chip__mark {
  position: relative;
  z-index: 1;
  font-size: 2.6rem;
  color: rgba(17, 18, 20, 0.75);
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.wsh-eyebrow {
  display: block;
  font-family: var(--wsh-font);
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--wsh-accent);
  margin-bottom: 14px;
  font-weight: 600;
}

.wsh-input-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.wsh-input {
  flex: 1;
  min-width: 220px;
  background: rgba(127, 127, 127, 0.08);
  border: 1px solid rgba(127, 127, 127, 0.3);
  border-radius: 10px;
  color: inherit;
  padding: 16px 18px;
  font-size: 1rem;
  font-family: var(--wsh-font);
  transition: border-color 0.2s ease;
}
.wsh-input::placeholder { color: inherit; opacity: 0.55; }
.wsh-input:focus {
  outline: none;
  border-color: var(--wsh-accent);
}

.wsh-btn {
  background: var(--wsh-accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 16px 30px;
  font-family: var(--wsh-font);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.2s ease;
}
.wsh-btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.wsh-btn:disabled { opacity: 0.6; cursor: default; transform: none; }

.wsh-result {
  margin-top: 20px;
  min-height: 0;
}

.wsh-result__state {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 12px;
  animation: wsh-fade-in 0.25s ease;
}
@keyframes wsh-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.wsh-result__state--pass {
  background: rgba(76, 175, 109, 0.12);
  border: 1px solid rgba(76, 175, 109, 0.35);
}
.wsh-result__state--fail {
  background: rgba(198, 91, 78, 0.12);
  border: 1px solid rgba(198, 91, 78, 0.35);
}

.wsh-result__icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.wsh-result__state--pass .wsh-result__icon { background: var(--wsh-success); color: #fff; }
.wsh-result__state--fail .wsh-result__icon { background: var(--wsh-danger); color: #fff; }

.wsh-result__state strong {
  display: block;
  color: inherit;
  font-size: 1.05rem;
  margin-bottom: 4px;
}
.wsh-result__state p {
  margin: 0;
  color: inherit;
  opacity: 0.75;
  font-size: 0.92rem;
  line-height: 1.5;
}

.wsh-result__product {
  display: flex;
  gap: 14px;
  align-items: center;
}
.wsh-result__product img {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.wsh-result__name { color: inherit; margin: 2px 0 6px; font-weight: 600; }
.wsh-result__link {
  color: var(--wsh-accent);
  font-size: 0.85rem;
  text-decoration: underline;
}

.wsh-lookup__notes {
  margin-top: 32px;
  text-align: center;
}
.wsh-lookup__notes p {
  color: inherit;
  opacity: 0.7;
  font-size: 0.92rem;
  font-style: italic;
  line-height: 1.7;
  max-width: 640px;
  margin: 0 auto 14px;
}

@media (max-width: 640px) {
  .wsh-lookup__card {
    grid-template-columns: 1fr;
    padding: 28px;
    text-align: center;
  }
  .wsh-input-row { flex-direction: column; }
}

/* Product badge (shop loop / single product) — inherits theme accent */
.wsh-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--wsh-font);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--wsh-accent);
  border: 1px solid var(--wsh-accent);
  border-radius: 20px;
  padding: 4px 12px;
  margin-top: 10px;
}
.wsh-badge__icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--wsh-accent);
  color: #fff;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}
