/*  ═══════════════════════════════════════════════════════════════
    Navbar Activity Panel — Instagram-style likes feed
    ═══════════════════════════════════════════════════════════════ */

.navbar__signed-in {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.navbar__activity-wrap {
  position: relative;
}

.navbar__activity-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-bg-glass);
  color: var(--color-text-primary);
  transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}

.navbar__activity-trigger:hover {
  border-color: var(--color-border-hover);
  background: var(--color-bg-glass-hover);
  color: var(--color-accent);
}

.navbar__activity-trigger:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.navbar__activity-trigger--open {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: var(--color-soft-fill);
}

.navbar__activity-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.navbar__activity-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--color-error);
  color: #ffffff;
  font-size: 11px;
  font-weight: var(--font-weight-bold);
  line-height: 18px;
  text-align: center;
  pointer-events: none;
}

.navbar__activity-panel {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  width: min(360px, 92vw);
  max-height: min(480px, 70vh);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
  background: var(--color-panel-bg);
  backdrop-filter: blur(18px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 220;
  overflow: hidden;
}

.navbar__activity-panel[hidden] {
  display: none;
}

.navbar__activity-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.navbar__activity-panel__title {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.navbar__activity-panel__close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text-secondary);
  font-size: var(--font-size-xl);
  line-height: 1;
}

.navbar__activity-panel__close:hover {
  background: var(--color-soft-fill-2);
  color: var(--color-text-primary);
}

.navbar__activity-panel__body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.activity-feed__status {
  padding: var(--space-6) var(--space-4);
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.activity-feed__list {
  list-style: none;
  margin: 0;
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.activity-feed__item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.activity-feed__item:hover {
  background: var(--color-soft-fill);
}

.activity-feed__item--new {
  background: var(--color-soft-fill);
}

.activity-feed__item--new:hover {
  background: var(--color-soft-fill-2);
}

.activity-feed__content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.activity-feed__text {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
}

.activity-feed__text a {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
}

.activity-feed__text a:hover,
.activity-feed__text a:focus-visible {
  color: var(--color-accent);
  text-decoration: underline;
}

.activity-feed__when {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
}

.activity-feed__more {
  display: block;
  width: calc(100% - var(--space-4));
  margin: var(--space-2) auto var(--space-3);
}

@media (max-width: 640px) {
  .navbar__activity-panel {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    /* Height instead of bottom:0 — navbar backdrop-filter creates a fixed
       containing block (~navbar height), so top+bottom collapses to 0. */
    height: calc(100dvh - var(--navbar-height));
    width: 100%;
    max-height: none;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  /* Portaled to document.body on mobile for viewport-level stacking. */
  .navbar__activity-panel--mobile {
    z-index: 900;
  }

  .navbar__activity-panel__close {
    display: inline-flex;
  }
}
