/* AnimeCitazioni – Watchmode widget
   -------------------------------------------------- */

:root {
  --wm-bg: #ffffff;
  --wm-text: #111827;         /* slate-900 */
  --wm-muted: #6b7280;        /* gray-500  */
  --wm-border: #e5e7eb;       /* gray-200  */
  --wm-accent: #111827;
  --wm-pill-bg: #f3f4f6;      /* gray-100  */
  --wm-chip-bg: #f9fafb;      /* gray-50   */
  --wm-chip-hover: #eef2ff;   /* indigo-50 */
  --wm-badge-bg: #111827;
  --wm-badge-text: #fff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --wm-bg: #0f1216;
    --wm-text: #e5e7eb;
    --wm-muted: #9ca3af;
    --wm-border: #20242b;
    --wm-accent: #e5e7eb;
    --wm-pill-bg: #1a1f25;
    --wm-chip-bg: #151a20;
    --wm-chip-hover: #1e2630;
    --wm-badge-bg: #e5e7eb;
    --wm-badge-text: #0f1216;
  }
}

/* Wrapper */
.ac-wm {
  background: var(--wm-bg);
  color: var(--wm-text);
  border: 1px solid var(--wm-border);
  border-radius: 12px;
  padding: 16px;
  margin: 20px 0;
  box-shadow: 0 1px 0 rgba(0,0,0,.02);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

/* Head */

.ac-wm__pill {
  background: var(--wm-pill-bg);
  color: var(--wm-muted);
  border: 1px solid var(--wm-border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  line-height: 1;
}

.ac-wm__pill--muted {
  opacity: .85;
}

/* Groups */
.ac-wm__group + .ac-wm__group {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--wm-border);
}

/* provider logo - miglior visibilità per svg */
.ac-wm__chip-logo img {
	background: transparent;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  box-shadow: none;
}

/* Chips list */
.ac-wm__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Single chip */
.ac-wm__chip {
  display: inline-flex;
}

.ac-wm__chip-link {
  --pad-x: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px var(--pad-x);
  background: var(--wm-chip-bg);
  border: 1px solid var(--wm-border);
  border-radius: 999px;
  text-decoration: none;
  color: var(--wm-text);
  font-size: 14px;
  line-height: 1;
  transition: background-color .18s ease, border-color .18s ease, transform .02s ease;
}

.ac-wm__chip-link:hover {
  background: var(--wm-chip-hover);
  border-color: var(--wm-border);
}

.ac-wm__chip-link:active {
  transform: translateY(1px);
}

/* Logo */
.ac-wm__chip-logo {
  width: 30px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ac-wm__chip-logo--placeholder {
  background: linear-gradient(135deg, #0000 0%, #0002 100%);
}

/* Provider name */
.ac-wm__chip-name {
  white-space: nowrap;
  max-width: 160px;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* Badges (if ever used) */
.ac-wm__badge {
  margin-left: 6px;
  background: var(--wm-badge-bg);
  color: var(--wm-badge-text);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 11px;
  line-height: 1.1;
}

/* Empty / Error states */
.ac-wm--empty,
.ac-wm--not-found,
.ac-wm--error {
  border: 1px dashed var(--wm-border);
  border-radius: 10px;
  padding: 14px;
  color: var(--wm-muted);
  background:
    repeating-linear-gradient(
      -45deg,
      transparent 0 8px,
      rgba(0,0,0,.03) 8px 16px
    );
  font-size: 14px;
}

/* Tighten on very small screens */
@media (max-width: 420px) {
  .ac-wm { padding: 12px; }
  .ac-wm__chip-link { padding: 7px 10px; }
  .ac-wm__chip-name { max-width: 120px; }
}

/* Host theme guardrails */
.ac-wm a { color: inherit; }
.ac-wm a:hover { text-decoration: none; }

/* Utility: reduce external margins when stacked with other cards */
.ac-wm + .ac-wm { margin-top: 12px; }