/* ══════════════════════════════════════════════════════
   ACTIVITY PAGE
══════════════════════════════════════════════════════ */

/* ── Tab icons ── */
.act-tab-icon {
  width:  16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 4px;
}

.act-page {
  max-width:  640px;
  margin:     0 auto;
  padding:    0 0 80px;
  min-height: 100vh;
}

/* ── Page-enter animation ── */
.act-page {
  animation: act-page-enter .22s ease both;
}
@keyframes act-page-enter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0);   }
}

/* ── Header ── */
.act-header {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  padding:         20px 20px 12px;
  position:        sticky;
  top:             0;
  background:      var(--bg);
  z-index:         10;
  border-bottom:   1px solid var(--border);
  gap:             10px;
}

.act-title {
  font-family: var(--font-display);
  font-size:   clamp(20px, 3vw, 26px);
  font-weight: 800;
  font-style:  italic;
  color:       var(--text);
  flex:        1;
}

.act-header-actions {
  display:     flex;
  align-items: center;
  gap:         8px;
  flex-shrink: 0;
}

.act-mark-all-btn {
  font-size:   12px;
  font-weight: 600;
  color:       var(--teal);
  background:  none;
  border:      none;
  cursor:      pointer;
  padding:     6px 10px;
  border-radius: var(--r-sm);
  transition:  background .15s;
  white-space: nowrap;
}
.act-mark-all-btn:hover { background: var(--panel); }

/* ── Tabs ── */
.act-tabs {
  display:          flex;
  gap:              6px;
  padding:          10px 16px 8px;
  overflow-x:       auto;
  scrollbar-width:  none;
  position:         sticky;
  top:              57px;   /* topbar height on mobile (56px) + 1px border */
  background:       var(--bg);
  z-index:          9;
  border-bottom:    1px solid var(--border);
}

@media (min-width: 769px) {
  .act-tabs { top: 69px; } /* desktop topbar = 68px + 1px */
}

.act-tabs::-webkit-scrollbar { display: none; }

.act-tab {
  flex-shrink:     0;
  background:      var(--panel);
  border:          1px solid var(--border);
  border-radius:   50px;
  padding:         6px 14px;
  font-size:       12px;
  font-weight:     600;
  color:           var(--muted);
  cursor:          pointer;
  transition:      background .15s, color .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.act-tab:hover      { color: var(--text); background: var(--card); }
.act-tab--active    { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ── Pull-to-refresh indicator ── */
.act-ptr {
  display:         flex;
  align-items:     center;
  justify-content: center;
  height:          0;
  overflow:        hidden;
  opacity:         0;
  transition:      height .2s ease, opacity .2s ease;
}

.act-ptr-spinner {
  width:        22px;
  height:       22px;
  border:       2.5px solid var(--border-md);
  border-top-color: var(--teal);
  border-radius: 50%;
}
.act-ptr--spinning .act-ptr-spinner {
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Feed ── */
.act-feed { padding: 8px 0; }

/* Unread counter banner */
.act-unread-count {
  font-size:      11px;
  font-weight:    700;
  color:          var(--teal);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding:        10px 20px 4px;
}

/* ── Group ── */
.act-group         { margin-bottom: 4px; }
.act-group-label {
  font-size:       11px;
  font-weight:     700;
  text-transform:  uppercase;
  letter-spacing:  1.2px;
  color:           var(--muted);
  padding:         12px 20px 4px;
}

/* ── Item ── */
.act-item {
  display:     flex;
  align-items: flex-start;
  gap:         14px;
  padding:     14px 20px;
  text-decoration: none;
  transition:  background .15s, transform .22s ease, opacity .22s ease;
  position:    relative;
  cursor:      pointer;
  -webkit-tap-highlight-color: transparent;
  will-change: transform, opacity;
}

.act-item:hover           { background: var(--panel); }
.act-item--unread         { background: rgba(45,212,191,.045); }
.act-item--unread:hover   { background: rgba(45,212,191,.08); }

/* Swipe / dismiss animation */
.act-item--dismissing {
  transform: translateX(-110%);
  opacity:   0;
  overflow:  hidden;
  max-height: 0;
  padding:   0;
}

/* Dismiss button — visible on hover / focus */
.act-item-dismiss {
  position:      absolute;
  right:         14px;
  top:           50%;
  transform:     translateY(-50%);
  width:         26px;
  height:        26px;
  border-radius: 50%;
  background:    var(--panel);
  border:        1px solid var(--border);
  color:         var(--muted);
  font-size:     11px;
  display:       grid;
  place-items:   center;
  cursor:        pointer;
  opacity:       0;
  transition:    opacity .15s, color .15s;
  flex-shrink:   0;
}
.act-item:hover .act-item-dismiss,
.act-item:focus-within .act-item-dismiss { opacity: 1; }
.act-item-dismiss:hover { color: var(--red); }

/* Icon circle */
.act-item-icon-wrap {
  width:        46px;
  height:       46px;
  border-radius: 50%;
  background:   var(--panel);
  border:       2px solid var(--act-colour, var(--border));
  display:      flex;
  align-items:  center;
  justify-content: center;
  flex-shrink:  0;
  font-size:    22px;
  box-shadow:   0 0 0 3px color-mix(in srgb, var(--act-colour, var(--border)) 15%, transparent);
}

@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .act-item-icon-wrap { box-shadow: 0 0 0 3px rgba(45,212,191,.15); }
}

.act-item-icon { line-height: 1; user-select: none; }

/* Content */
.act-item-content {
  flex:      1;
  min-width: 0;
  padding-right: 30px; /* room for dismiss button */
}

.act-item-title {
  font-size:   14px;
  font-weight: 600;
  color:       var(--text);
  line-height: 1.35;
  margin-bottom: 2px;
}

.act-item-body {
  font-size:   13px;
  color:       var(--text-2);
  line-height: 1.4;
  display:     -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow:    hidden;
  margin-bottom: 3px;
}

.act-item-time {
  font-size: 11px;
  color:     var(--muted);
}

/* Unread dot */
.act-item-dot {
  width:        9px;
  height:       9px;
  border-radius: 50%;
  background:   var(--teal);
  flex-shrink:  0;
  margin-top:   5px;
  box-shadow:   0 0 6px rgba(45,212,191,.5);
}

/* Skeleton rows */
.act-skel-row {
  height:       70px;
  border-radius: var(--r-sm);
  margin:       8px 16px;
}

/* ── Empty / error / guest states ── */
.act-empty {
  display:         flex;
  flex-direction:  column;
  align-items:     center;
  justify-content: center;
  gap:             10px;
  padding:         64px 24px;
  text-align:      center;
  color:           var(--muted);
}

.act-empty-icon   { font-size: 56px; line-height: 1; }
.act-empty-title  { font-size: 16px; font-weight: 700; color: var(--text); }
.act-empty-sub    { font-size: 13px; color: var(--muted); max-width: 280px; line-height: 1.5; }

.act-signin-btn,
.act-retry-btn {
  margin-top:    8px;
  background:    var(--teal);
  color:         #000;
  border:        none;
  border-radius: 50px;
  padding:       10px 28px;
  font-size:     14px;
  font-weight:   700;
  cursor:        pointer;
  transition:    transform .15s;
}
.act-signin-btn:hover,
.act-retry-btn:hover  { transform: scale(1.04); }

/* ── Mobile ── */
@media (max-width: 768px) {
  .act-page   { padding-bottom: calc(var(--bottom-h) + 16px); }
  .act-header { padding-top: 14px; }
}

/* ── Sidebar activity badge positioning ── */
/* .nav-icon is the positioned ancestor; badge sits just   */
/* outside the top-right corner of the icon area.          */
.nav-item .nav-icon { position: relative; }

.sidebar-notif-dot {
  top:   -4px;
  right: -4px;
}

/* ── Light theme ── */
[data-theme="light"] .act-item-dismiss { background: var(--surface); }
