/* /google-ads page-scoped only — do not affect /ads or STD Google */

.dashboard-filters-explore.filters-bar > .date-filters-row.wh-hide > .select-wrapper,
.dashboard-filters-explore.filters-bar > .select-wrapper.wh-hide {
  display: none !important;
}

/* Keep Apply hidden — auto-apply clicks #applyfilters like /ads */
.dashboard-filters-explore.filters-bar > .select-wrapper.gads-actions-row,
.dashboard-filters-explore.filters-bar #applyfilters {
  display: none !important;
}

/* Active filter chips — match Meta explore bar */
#active-filters-container .gads-active-filters-label {
  color: inherit;
  opacity: 0.85;
}
html[data-theme="dark"] #active-filters-container .inline-flex.items-center {
  background: rgba(59, 130, 246, 0.18);
  color: #bfdbfe;
  border-color: rgba(96, 165, 250, 0.35);
}

/* Filter capsule values must stay readable in dark mode */
html[data-theme="dark"] .dashboard-filters-explore.filters-bar .select2-selection__rendered,
html[data-theme="dark"] .dashboard-filters-explore.filters-bar .select2-selection__rendered.dashboard-select2-summary-active::before,
html[data-theme="dark"] .dashboard-filters-explore.filters-bar input.form-input,
html[data-theme="dark"] .dashboard-filters-explore.filters-bar .cfd-summary,
html[data-theme="dark"] .dashboard-filters-explore.filters-bar .cfd-trigger {
  color: #e2e8f0 !important;
  -webkit-text-fill-color: #e2e8f0 !important;
}

/*
 * Global explore CSS forces #ad-status-filter (and open singles) to black.
 * That is unreadable in dark mode on /google-ads — override hard.
 */
html[data-theme="dark"] .dashboard-filters-explore.filters-bar .select-wrapper:has(#ad-status-filter) .select2-selection__rendered,
html[data-theme="dark"] .dashboard-filters-explore.filters-bar .select-wrapper:has(#ad-status-filter) .select2-selection__rendered.dashboard-select2-summary-active,
html[data-theme="dark"] .dashboard-filters-explore.filters-bar .select-wrapper:has(#ad-status-filter) .select2-selection__rendered.dashboard-select2-summary-active *,
html[data-theme="dark"] .dashboard-filters-explore.filters-bar .select2-container--open .select2-selection--single .select2-selection__rendered.dashboard-select2-summary-active,
html[data-theme="dark"] .dashboard-filters-explore.filters-bar .select2-container--open .select2-selection--single .select2-selection__rendered.dashboard-select2-summary-active * {
  color: #e2e8f0 !important;
  -webkit-text-fill-color: #e2e8f0 !important;
}

/*
 * Keep Format / Platform capsule labels visible while the dropdown is open
 * (global explore CSS clears ::before on open, which looks like "text vanished").
 */
.dashboard-filters-explore.filters-bar .select-wrapper:has(#Order-2) .select2-container--open .select2-selection__rendered.dashboard-select2-summary-active::before,
.dashboard-filters-explore.filters-bar .select-wrapper:has(#gads-platform) .select2-container--open .select2-selection__rendered.dashboard-select2-summary-active::before {
  content: attr(data-summary) !important;
  display: inline !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  color: var(--es-filter-text, #111827) !important;
  -webkit-text-fill-color: var(--es-filter-text, #111827) !important;
  max-width: calc(100% - 2.5rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
html[data-theme="dark"] .dashboard-filters-explore.filters-bar .select-wrapper:has(#Order-2) .select2-container--open .select2-selection__rendered.dashboard-select2-summary-active::before,
html[data-theme="dark"] .dashboard-filters-explore.filters-bar .select-wrapper:has(#gads-platform) .select2-container--open .select2-selection__rendered.dashboard-select2-summary-active::before {
  color: #e2e8f0 !important;
  -webkit-text-fill-color: #e2e8f0 !important;
}

/* Sort control — match /ads (.tts-cp-btn svg = 15px) */
#ad-results-sort-slot .tts-cp-btn.explore-landers-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}
#ad-results-sort-slot .tts-cp-btn.explore-landers-sort-btn svg,
#ad-results-sort-slot .explore-landers-sort-btn__dir,
#ad-results-sort-slot .explore-landers-sort-btn__chev {
  width: 15px !important;
  height: 15px !important;
  flex: 0 0 15px !important;
  display: block;
}
#ad-results-sort-slot .explore-landers-sort-btn__dir {
  opacity: 0.65;
}
#ad-results-sort-slot .explore-landers-sort-btn__chev {
  opacity: 0.55;
  width: 12px !important;
  height: 12px !important;
  flex: 0 0 12px !important;
}
#ad-results-sort-slot .explore-landers-sort-btn__label {
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* Prefer shared dashboard-sort-dropdown styles; keep z-index for overlay */
.gads-sort-dropdown.dashboard-sort-dropdown,
.gads-sort-dropdown.explore-landers-sort-dropdown {
  min-width: 240px;
}

/* Search suggestions — reuse Meta /ads tokens from dark-mode.css; only fix gaps */
html[data-theme="dark"] #suggested-searches .loading-text {
  color: var(--dk-text-3, #94a3b8) !important;
}
html[data-theme="dark"] #suggested-searches #keyword-search-hint,
html[data-theme="dark"] #suggested-searches .text-slate-500,
html[data-theme="dark"] #suggested-searches .text-slate-600 {
  color: var(--dk-text-3, #94a3b8) !important;
}
html[data-theme="dark"] #suggested-searches .bg-gray-100 {
  background: var(--dk-surface-3, #334155) !important;
  color: var(--dk-text-2, #cbd5e1) !important;
}
html[data-theme="dark"] #suggested-searches hr {
  border-color: var(--dk-border, #334155) !important;
  background: var(--dk-border, #334155) !important;
}
html[data-theme="dark"] #keyword-composite,
html[data-theme="dark"] #keyword-editable {
  color: #e2e8f0 !important;
  -webkit-text-fill-color: #e2e8f0 !important;
}
html[data-theme="dark"] #keyword-editable::placeholder {
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
}

/* Tab filter counts */
.wh-tab .wh-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.3rem;
  margin-left: 0.2rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  background: rgba(34, 90, 234, 0.16);
  color: #225aea;
}
html[data-theme="dark"] .wh-tab .wh-tab-count {
  background: rgba(96, 165, 250, 0.2);
  color: #93c5fd;
}

/* Platform multi-select — same capsule treatment as Media Type (#Order-2) */
.dashboard-filters-explore.filters-bar > .select-wrapper:has(#gads-platform) > span.select2.select2-container {
  width: 100% !important;
}

/* Feed: no boxed wrapper */
.google-ads-page .add_list,
.dashboard-page-shell .add_list {
  border: none;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

/* Google letter avatars */
.fw-ad-card-google-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: linear-gradient(135deg, #dbeafe, #ede9fe);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 4px;
  font-size: 13px;
  font-weight: 700;
  color: #4338ca;
  border: 1px solid #e9eaeb;
  box-sizing: border-box;
  line-height: 1;
  vertical-align: middle;
}

html[data-theme="dark"] .fw-ad-card-google-avatar {
  background: linear-gradient(135deg, #1e3a5f, #312e81);
  color: #c7d2fe;
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] #ad-results-count {
  color: #e2e8f0;
}

.gads-sort-dropdown {
  min-width: 240px;
  background: var(--wh-filter-capsule, #fff);
  border: 1px solid var(--wh-filter-bar-border, #e5e7eb);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  padding: 6px;
}

html[data-theme="dark"] .gads-sort-dropdown {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.gads-sort-option {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.gads-sort-option:hover,
.gads-sort-option.is-active {
  background: var(--wh-filter-surface-focus, #eff6ff);
}

html[data-theme="dark"] .gads-sort-option:hover,
html[data-theme="dark"] .gads-sort-option.is-active {
  background: rgba(59, 130, 246, 0.15);
}

.gads-sort-dropdown__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 6px 4px;
  margin-top: 4px;
  border-top: 1px solid var(--wh-filter-bar-border, #e5e7eb);
}

.gads-sort-dir-toggle {
  display: inline-flex;
  gap: 4px;
}

.gads-sort-dir-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--wh-filter-bar-border, #e5e7eb);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: inherit;
}

.gads-sort-dir-btn.is-active {
  background: #225aea;
  border-color: #225aea;
  color: #fff;
}
