/*
  Badge 03 — Notification Count — standalone HTML/CSS/JS implementation.
  No build step, no framework, no external dependency: copy index.html,
  this file, and script.js into any project as-is.
*/

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  display: flex;
  min-height: 12rem;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(to bottom, #fafafa, #f4f4f5);
}

.notification-demo {
  display: flex;
  align-items: center;
  gap: 2rem;
  border-radius: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background-color: #ffffff;
  padding: 2rem;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 16px 40px -16px rgba(0, 0, 0, 0.14);
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

.notification-demo__bell {
  position: relative;
  display: inline-flex;
  width: 2.75rem;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 1px solid oklch(0.922 0 0);
  background: #ffffff;
  color: oklch(0.145 0 0);
  font-family: inherit;
  cursor: pointer;
  transition: border-color 150ms ease;
}

.notification-demo__bell svg {
  width: 1.25rem;
  height: 1.25rem;
}

.notification-demo__bell .count-badge {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
}

.notification-demo__cycle {
  border-radius: 9999px;
  border: 1px solid oklch(0.922 0 0);
  background: #ffffff;
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: oklch(0.145 0 0);
  cursor: pointer;
  transition: border-color 150ms ease;
}

.notification-demo__bell:hover,
.notification-demo__cycle:hover {
  border-color: oklch(0.78 0 0);
}

.notification-demo__bell:focus-visible,
.notification-demo__cycle:focus-visible {
  outline: 2px solid oklch(0.145 0 0);
  outline-offset: 2px;
}

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background-color: oklch(0.62 0.21 25);
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji";
  font-weight: 600;
  line-height: 1;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.count-badge--compact {
  width: 1.25rem;
  height: 1.25rem;
  font-size: 0.6875rem;
}

.count-badge--wide {
  height: 1.25rem;
  min-width: 1.25rem;
  padding: 0 0.375rem;
  font-size: 0.625rem;
}

@keyframes count-badge-pop {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  60% {
    transform: scale(1.12);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

.count-badge--pop {
  animation: count-badge-pop 220ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .count-badge--pop {
    animation: none;
  }
}
