/* What's New sidebar entry (WhatsNewSidebarEntry). Colours follow the
   What's New confetti palette, which is deliberately its own world: the
   rainbow border and party popper are the one joyful element in the shell. */

.wn-entry {
  --wn-rainbow: linear-gradient(
    120deg,
    #fb7185,
    #fcd34d 28%,
    #34d399 52%,
    #3b82f6 76%,
    #8b5cf6
  );
  position: relative;
  display: block;
  margin: 0 0 2px;
  border-radius: 14px;
  padding: 1.5px;
  background: var(--wn-rainbow);
  outline: none;
  transition:
    transform 0.15s ease-out,
    box-shadow 0.15s ease-out;
}

.wn-entry:hover,
.wn-entry:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px -10px rgb(139 92 246 / 0.6);
}

.wn-entry:focus-visible {
  box-shadow:
    0 0 0 2px var(--sidebar),
    0 0 0 4px var(--ring);
}

.wn-entry-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 12.5px;
  background: var(--sidebar);
  padding: 9px 10px;
}

.wn-entry:hover .wn-entry-inner,
.wn-entry-active .wn-entry-inner {
  background: color-mix(in oklch, var(--sidebar) 92%, #fdba74);
}

.wn-entry-tile {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #fff4ec;
  box-shadow: inset 0 0 0 1px #fbd9c6;
}

.dark .wn-entry-tile {
  background: #2a2433;
  box-shadow: inset 0 0 0 1px #4a3b55;
}

.wn-entry-tile svg,
.wn-entry-confetti svg,
.wn-collapsed-popper svg {
  display: block;
  overflow: visible;
}

.wn-entry-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--sidebar-foreground);
}

.wn-entry-sub {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.3;
  color: var(--muted-foreground);
}

.wn-entry-new {
  border-radius: 999px;
  padding: 2px 7px;
  background: linear-gradient(90deg, #e11d48, #7c3aed 55%, #2563eb);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #fff;
}

.wn-entry-confetti {
  position: absolute;
  top: -24px;
  right: -8px;
  z-index: 20;
  width: 46px;
  height: 38px;
  pointer-events: none;
}

/* Hidden at rest: a hover plays the burst, and the cluster stays in the
   corner only while the card is still hovered. */
.wn-entry-confetti svg {
  visibility: hidden;
}

.wn-entry-confetti svg.wn-play,
.wn-entry:hover .wn-entry-confetti svg.wn-settle {
  visibility: visible;
}

.wn-entry-confetti svg.wn-settle {
  animation: wn-settle 0.45s cubic-bezier(0.2, 0.8, 0.3, 1.3) both;
}

@keyframes wn-settle {
  from {
    opacity: 0;
    transform: scale(0.4) translate(-10px, 10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Collapsed sidebar: a rainbow tile, with a pink dot while unread. */
.wn-collapsed {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1.5px solid transparent;
  border-radius: 10px;
  background:
    linear-gradient(var(--sidebar), var(--sidebar)) padding-box,
    linear-gradient(120deg, #fb7185, #fcd34d, #34d399, #3b82f6, #8b5cf6)
      border-box;
}

.wn-collapsed:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.wn-collapsed-popper svg {
  width: 20px;
  height: 20px;
}

.wn-collapsed-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fb7185;
  box-shadow: 0 0 0 2px var(--sidebar);
}

@media (prefers-reduced-motion: reduce) {
  .wn-entry,
  .wn-entry * {
    animation: none !important;
    transition: none !important;
  }

  .wn-entry:hover {
    transform: none;
  }
}
