/* Containers that host the add button need relative positioning */
.chart-container--has-add-btn,
.chart-card--has-add-btn,
.top-sites-container--has-add-btn,
.recent-activities-container--has-add-btn,
.dashboard-stats-wrap--has-add-btn,
.dashboard-stat-card-wrap--has-add-btn {
  position: relative;
}

.dashboard-add-to-personalized {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #e2e8f0;
  color: #64748b;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Light mode: keep grayish appearance */
.light-mode .dashboard-add-to-personalized {
  background: #e2e8f0;
  color: #64748b;
  border-color: #cbd5e1;
}

.dashboard-add-to-personalized:hover {
  color: var(--primary, #1976d2);
  background: #cbd5e1;
  border-color: var(--primary, #1976d2);
  transform: scale(1.05);
}

.light-mode .dashboard-add-to-personalized:hover {
  background: #cbd5e1;
  color: var(--primary, #f21b23);
  border-color: var(--primary, #f21b23);
}

.dashboard-add-to-personalized:focus-visible {
  outline: 2px solid var(--primary, #f21b23);
  outline-offset: 2px;
}

.dashboard-add-to-personalized:active {
  transform: scale(0.98);
}

/* Dark theme: visible on dark cards */
body.night-mode .dashboard-add-to-personalized,
.night-mode .dashboard-add-to-personalized {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.2);
}

body.night-mode .dashboard-add-to-personalized:hover,
.night-mode .dashboard-add-to-personalized:hover {
  background: rgba(248, 113, 113, 0.2);
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.5);
}
