/**
 * YOOAdmin - Activity page styles
 *
 * @package YOOAdmin
 */

.yooadmin-activity-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 20px 32px;
  color: var(--yp-text, var(--ysh-text, #2a3340));
}

.yooadmin-activity-page a {
  text-decoration: none !important;
  box-shadow: none !important;
}

/* Hero — compact, search + admin filter on the right */
.yoo-activity-hero {
  background: var(--ysh-card, #fff);
  border: 1px solid var(--ysh-border, #dcdcde);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(15, 18, 24, 0.04);
}

.yoo-activity-hero__top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.yoo-activity-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: color-mix(in srgb, var(--ysh-card, #fff) 88%, var(--ysh-brand, #eda934) 12%);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ysh-muted, #667085);
}

.yoo-activity-hero__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex: 1 1 auto;
  justify-content: flex-end;
  flex-wrap: wrap;
  min-width: 0;
}

.yoo-activity-search-wrapper {
  position: relative;
  flex: 1 1 180px;
  min-width: 160px;
  max-width: 320px;
}

.yoo-activity-search-wrapper .dashicons {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ysh-muted, #8c8f94);
  font-size: 17px;
  width: 17px;
  height: 17px;
  pointer-events: none;
  z-index: 1;
}

.yoo-activity-search-input {
  width: 100%;
  color: var(--ysh-text, #2c3338);
  height: 36px;
  padding: 8px 12px 8px 36px !important;
  border: 1px solid var(--ysh-border, #dcdcde) !important;
  border-radius: 6px;
  font-size: 13px;
  background: var(--ysh-card, #fff);
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.yoo-activity-search-input:focus {
  outline: none !important;
  border-color: var(--yp-input-border-focus, color-mix(in srgb, var(--_yp-primary, #eda934) 38%, #c3c4c7)) !important;
  box-shadow: 0 0 0 1px var(--yp-input-focus-ring, color-mix(in srgb, var(--_yp-primary, #eda934) 14%, transparent)) !important;
}

.yoo-activity-search-wrapper:focus-within .dashicons {
  color: var(--ysh-brand, #eda934);
}

.yooadmin-activity-page h1 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--ysh-heading, var(--yp-text, #2a3340));
}

.yooadmin-activity-page h1 .dashicons {
  color: var(--ysh-brand, #eda934);
  font-size: 20px;
  width: 20px;
  height: 20px;
}

.yoo-activity-hero__count {
  font-size: 13px;
  font-weight: 500;
  color: var(--ysh-muted, #667085);
}

/* Content + toolbar */
.yoo-activity-content-section {
  background: var(--ysh-card, #fff);
  border: 1px solid var(--ysh-border, #dcdcde);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 18, 24, 0.04);
}

.yoo-activity-toolbar {
  padding: 12px 16px;
  border-bottom: 1px solid var(--ysh-border, #e5e5e5);
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: color-mix(in srgb, var(--ysh-card, #fff) 97%, var(--ysh-brand, #eda934) 3%);
}

.yoo-activity-filters,
.yoo-activity-range-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.yooadmin-activity-page .yoo-filter-chip {
  border: 1px solid var(--ysh-border, #dcdcde);
  background: var(--ysh-card, #fff);
  color: var(--ysh-text, #2c3338);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.yooadmin-activity-page .yoo-filter-chip--subtle {
  font-size: 11px;
  padding: 5px 10px;
}

.yooadmin-activity-page .yoo-filter-chip:hover {
  background: color-mix(in srgb, var(--ysh-card, #fff) 88%, var(--ysh-brand, #eda934) 12%);
  border-color: color-mix(in srgb, var(--ysh-brand, #eda934) 35%, var(--ysh-border, #dcdcde));
  color: var(--ysh-heading, #2a3340);
}

.yooadmin-activity-page .yoo-filter-chip.is-active {
  background: var(--_yp-primary, var(--ysh-brand, #eda934));
  border-color: var(--_yp-primary, var(--ysh-brand, #eda934));
  color: #fff;
}

/* List */
.yoo-activity-list-panel {
  padding: 0;
}

.yoo-activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.yoo-activity-item {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--ysh-border, #e5e5e5) 75%, transparent);
  transition: background 0.15s ease;
}

.yoo-activity-item:hover {
  background: color-mix(in srgb, var(--ysh-brand, #eda934) 4%, var(--ysh-card, #fff));
}

.yoo-activity-item:last-child {
  border-bottom: none;
}

.yoo-activity-item__icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--ysh-brand, #eda934) 10%, var(--ysh-card, #fff));
  flex-shrink: 0;
}

.yoo-activity-item__icon-wrap .dashicons {
  color: var(--ysh-brand, #eda934);
  font-size: 17px;
  width: 17px;
  height: 17px;
}

.yoo-activity-item__body {
  min-width: 0;
  flex: 1;
}

.yoo-activity-item__line {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.yoo-activity-item__action {
  color: var(--ysh-muted, #667085);
  font-weight: 500;
}

.yoo-activity-item__subject {
  color: var(--ysh-heading, #2a3340);
  font-weight: 600;
  margin-left: 4px;
}

a.yoo-activity-item__subject:hover,
a.yoo-activity-item__subject:focus {
  color: var(--ysh-brand, #eda934);
}

.yoo-activity-item__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--ysh-muted, #667085);
}

.yoo-activity-item__badge {
  display: inline-flex;
  padding: 2px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ysh-brand, #eda934) 10%, var(--ysh-card, #fff));
  border: 1px solid color-mix(in srgb, var(--ysh-brand, #eda934) 18%, transparent);
  color: var(--ysh-text, #444);
  font-weight: 600;
  font-size: 10px;
}

.yoo-activity-item__user::before,
.yoo-activity-item__time::before {
  content: "·";
  margin-right: 6px;
  color: var(--ysh-border, #c8c8c8);
}

.yoo-activity-item__user:first-child::before,
.yoo-activity-item__time:first-child::before {
  content: none;
  margin: 0;
}

.yoo-activity-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 36px 16px;
  text-align: center;
  color: var(--ysh-muted, #667085);
}

.yoo-activity-empty .dashicons {
  font-size: 26px;
  width: 26px;
  height: 26px;
  opacity: 0.65;
}

/* Infinite scroll status */
.yoo-activity-infinite-status {
  padding: 0 16px 14px;
}

.yoo-activity-scroll-sentinel {
  height: 1px;
  width: 100%;
}

.yoo-activity-loading-more {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 0 4px;
}

.yoo-activity-loading-more[hidden] {
  display: none !important;
}

.yoo-activity-loading-more .yp-loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.yoo-activity-loading-more .yp-spinner-circle {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top-color: var(--yp-brand, var(--ysh-brand, #eda934));
  border-radius: 50%;
  animation: yoo-activity-spin 0.8s linear infinite;
}

@keyframes yoo-activity-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.yoo-activity-end {
  margin: 0;
  padding: 10px 0 2px;
  text-align: center;
  font-size: 12px;
  color: var(--ysh-muted, #667085);
}

.yoo-activity-list.is-loading {
  opacity: 0.55;
  pointer-events: none;
}

/* Admin filter dropdown */
.yooadmin-activity-page .yoo-filter-dropdown-wrapper {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
}

.yooadmin-activity-page .yoo-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--ysh-border, #dcdcde);
  border-radius: 6px;
  background: var(--ysh-card, #fff);
  color: var(--ysh-text, #2c3338);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  max-width: 200px;
}

.yooadmin-activity-page .yoo-filter-btn .dashicons-admin-users {
  font-size: 16px;
  width: 16px;
  height: 16px;
  color: var(--ysh-muted, #667085);
}

.yooadmin-activity-page .yoo-filter-btn .yoo-filter-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.yooadmin-activity-page .yoo-filter-btn.is-active {
  background: color-mix(in srgb, var(--ysh-brand, #eda934) 12%, var(--ysh-card, #fff));
  border-color: color-mix(in srgb, var(--ysh-brand, #eda934) 40%, var(--ysh-border, #dcdcde));
  color: var(--ysh-heading, #2a3340);
}

.yooadmin-activity-page .yoo-filter-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: auto;
  min-width: 200px;
  max-height: 280px;
  overflow-y: auto;
  background: var(--ysh-card, #fff);
  border: 1px solid var(--ysh-border, #dcdcde);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 50;
  padding: 4px 0;
}

.yooadmin-activity-page .yoo-filter-dropdown[hidden] {
  display: none !important;
}

.yooadmin-activity-page .yoo-filter-option {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  text-align: left;
  color: var(--ysh-text, #2c3338);
  cursor: pointer;
  font-size: 13px;
}

.yooadmin-activity-page .yoo-filter-option.is-selected,
.yooadmin-activity-page .yoo-filter-option:hover {
  background: color-mix(in srgb, var(--ysh-brand, #eda934) 10%, var(--ysh-card, #fff));
  color: var(--ysh-heading, #2a3340);
}

.yooadmin-activity-page .yoo-filter-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
  cursor: pointer;
}

/* Dark mode */
html[data-yooadmin-studio-color-mode-effective="dark"] .yoo-activity-hero,
html[data-yooadmin-studio-color-mode-effective="dark"] .yoo-activity-content-section,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] .yoo-activity-hero,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] .yoo-activity-content-section {
  background: var(--ysh-card, #1a1d23);
  border-color: var(--ysh-border, rgba(255, 255, 255, 0.1));
}

html[data-yooadmin-studio-color-mode-effective="dark"] .yoo-activity-toolbar,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] .yoo-activity-toolbar {
  background: rgba(255, 255, 255, 0.02);
}

html[data-yooadmin-studio-color-mode-effective="dark"] .yooadmin-activity-page .yoo-filter-chip,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] .yooadmin-activity-page .yoo-filter-chip {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--ysh-border, rgba(255, 255, 255, 0.14));
  color: var(--ysh-text, #cfd6e0);
}

.yoo-activity-search-input {
  color: var(--ysh-text, #2c3338);
}

html[data-yooadmin-studio-color-mode-effective="dark"] .yoo-activity-search-wrapper .dashicons,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] .yoo-activity-search-wrapper .dashicons {
  color: var(--ysh-muted, #8b949e);
}

html[data-yooadmin-studio-color-mode-effective="dark"] .yoo-activity-search-input,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] .yoo-activity-search-input {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: var(--ysh-border, rgba(255, 255, 255, 0.14)) !important;
  color: var(--ysh-text, #cfd6e0) !important;
}

html[data-yooadmin-studio-color-mode-effective="dark"] .yoo-activity-search-input::placeholder,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] .yoo-activity-search-input::placeholder {
  color: var(--ysh-muted, #8b949e);
  opacity: 1;
}

html[data-yooadmin-studio-color-mode-effective="dark"] .yoo-activity-search-wrapper:focus-within .dashicons,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] .yoo-activity-search-wrapper:focus-within .dashicons {
  color: var(--ysh-brand, #eda934);
}

html[data-yooadmin-studio-color-mode-effective="dark"] .yooadmin-activity-page .yoo-filter-btn,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] .yooadmin-activity-page .yoo-filter-btn {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--ysh-border, rgba(255, 255, 255, 0.14));
  color: var(--ysh-text, #cfd6e0);
}

html[data-yooadmin-studio-color-mode-effective="dark"] .yooadmin-activity-page .yoo-filter-btn.is-active,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] .yooadmin-activity-page .yoo-filter-btn.is-active {
  background: color-mix(in srgb, var(--ysh-brand, #eda934) 16%, rgba(255, 255, 255, 0.04));
  border-color: color-mix(in srgb, var(--ysh-brand, #eda934) 45%, rgba(255, 255, 255, 0.14));
  color: var(--ysh-heading, #eceff4);
}

html[data-yooadmin-studio-color-mode-effective="dark"] .yooadmin-activity-page .yoo-filter-btn .dashicons-admin-users,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] .yooadmin-activity-page .yoo-filter-btn .dashicons-admin-users {
  color: var(--ysh-muted, #8b949e);
}

html[data-yooadmin-studio-color-mode-effective="dark"] .yooadmin-activity-page .yoo-filter-dropdown,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] .yooadmin-activity-page .yoo-filter-dropdown {
  background: var(--ysh-card, #1a1d23);
  border-color: var(--ysh-border, rgba(255, 255, 255, 0.14));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

html[data-yooadmin-studio-color-mode-effective="dark"] .yooadmin-activity-page .yoo-filter-option,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] .yooadmin-activity-page .yoo-filter-option {
  color: var(--ysh-text, #cfd6e0);
}

html[data-yooadmin-studio-color-mode-effective="dark"] .yooadmin-activity-page .yoo-filter-option.is-selected,
html[data-yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] .yooadmin-activity-page .yoo-filter-option.is-selected,
html[data-yooadmin-studio-color-mode-effective="dark"] .yooadmin-activity-page .yoo-filter-option:hover,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] .yooadmin-activity-page .yoo-filter-option:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ysh-heading, #eceff4);
}

html[data-yooadmin-studio-color-mode-effective="dark"] .yooadmin-activity-page .yoo-filter-chip.is-active,
html.yooadmin-studio-hub-html[data-yooadmin-studio-color-mode-effective="dark"] .yooadmin-activity-page .yoo-filter-chip.is-active {
  color: #1a1a1a;
}

@media (max-width: 782px) {
  .yooadmin-activity-page {
    padding: 12px 12px 24px;
  }

  .yoo-activity-hero__actions {
    width: 100%;
    justify-content: stretch;
  }

  .yoo-activity-search-wrapper {
    max-width: none;
    flex: 1 1 100%;
  }

  .yooadmin-activity-page .yoo-filter-dropdown-wrapper {
    width: 100%;
  }

  .yooadmin-activity-page .yoo-filter-btn {
    width: 100%;
    max-width: none;
    justify-content: center;
  }
}
