/* Dedup tool-specific component styles */

/* Whitelist Section Modernization */
.whitelist-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem;
  background-color: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 10px;
}

.whitelist-item {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem 0.25rem 0.75rem;
  background-color: #e2e8f0;
  border-radius: 9999px; /* Pill shape */
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-main);
}
.remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  margin-left: 0.5rem;
  padding: 0;
  background-color: #cbd5e1;
  color: #475569;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  line-height: 1;
}

.remove-btn:hover {
  background-color: var(--accent);
  color: white;
}

/* Modal and UI States */
.details-popup {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
.details-box {
  background: white;
  width: 650px;
  max-height: 80vh;
  overflow: auto;
  padding: 1.25rem;
  border-radius: var(--radius);
}
.popup-close {
  float: right;
  cursor: pointer;
}
.popup-close-button {
  border: 0;
  background: transparent;
  color: var(--text-main);
  font-size: 1.5rem;
  line-height: 1;
  min-width: 2.5rem;
  min-height: 2.5rem;
}

.blocklist-tools__heading,
.blocklist-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.blocklist-count {
  color: var(--text-muted, #64748b);
  font-size: 0.8125rem;
  white-space: nowrap;
}

.blocklist-tools .form-row {
  align-items: stretch;
}

.blocklist-tools .btn {
  flex: 1;
}

.blocklist-modal__box {
  width: min(calc(100% - 2rem), 42rem);
}

.blocklist-help {
  margin-top: 0;
  color: var(--text-muted, #64748b);
  line-height: 1.5;
}

.blocklist-modal__box textarea {
  width: 100%;
  min-height: 6rem;
  margin-top: 0.35rem;
}

.blocklist-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.blocklist-feedback {
  min-height: 1.25rem;
  margin: 0.35rem 0 0;
  color: var(--text-muted, #64748b);
  line-height: 1.4;
}

.blocklist-feedback.is-error {
  color: #b42318;
}

.blocklist-list-heading {
  margin-top: 1.25rem;
}

.blocklist-list-heading h3 {
  margin: 0;
}

.blocklist-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.blocklist-entry {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-main);
}

.blocklist-entry input {
  min-width: 0;
  flex: 1;
}

.blocklist-entry input[readonly] {
  border-color: transparent;
  background: transparent;
}

.blocklist-entry__source {
  color: var(--text-muted, #64748b);
  font-size: 0.75rem;
  white-space: nowrap;
}

.blocklist-entry .btn {
  flex: 0 0 auto;
  min-height: 2.25rem;
}

@media (max-width: 36rem) {
  .blocklist-tools .form-row,
  .blocklist-entry {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .blocklist-tools .btn,
  .blocklist-entry input {
    flex-basis: 100%;
  }

  .blocklist-entry__source {
    order: 3;
  }
}

/* Dedup workspace layout */
.page--dedup .page-container {
  width: min(calc(100% - (var(--page-gutter) * 2)), 64rem);
}

@media (min-width: 72rem) {
  .page--dedup .page-shell {
    grid-template-columns:
      minmax(0, 1fr)
      minmax(0, 64rem)
      minmax(0, 1fr);
  }

  .page--dedup .page-shell > .page-container {
    width: 100%;
  }
}

.page--dedup .dedupBody {
  display: flex;
  gap: 2rem; /* This provides the space between the sections */
  margin-top: 1rem;
}
.page--dedup .left-side {
  flex: 0 0 35%;
  background-color: var(--bg-main);
  padding: 1.5rem;
  border-radius: var(--radius);
}
.page--dedup .right-side {
  flex: 1; /* Right side occupies all remaining width, respecting the gap */
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.page--dedup .dedup-table-wrapper,
.page--dedup .right-side .domain-table-wrapper {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
}
.page--dedup .right-side .data-table,
.page--dedup .right-side .domain-table-wrapper {
  min-height: 4rem;
}
@media (max-width: 48rem) {
  .page--dedup .dedupBody {
    flex-direction: column;
    gap: 1.5rem;
  }
  .page--dedup .left-side,
  .page--dedup .right-side {
    flex: 1; /* Stack them on mobile */
  }
}

.file-upload {
  margin-top: 10px;
}
.whitelist-domains {
  margin-top: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 1rem;
}
.form-row {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
}

.disabled-container {
  opacity: 0.5;
  pointer-events: none; /* <- This blocks all mouse actions inside */
}
#detailsContent {
  margin-top: 15px;
  white-space: pre-wrap;
  font-family: monospace;
  max-height: 55vh;
  overflow: auto;
}
.page--dedup {
  background-color: #f4f5f6;
}
.page--dedup textarea {
  height: 100px;
}
.page--dedup .left-side textarea {
  width: 100%;
}
@media (max-width: 48rem) {
  .page--dedup .details-box {
    width: min(calc(100% - 2rem), 650px);
  }
}

#limitPerDomain {
  width: 100px;
}

/* Keep Save/Download aligned and full width of the left rail. */
.dedup-actions {
  margin-top: 1rem;
}
.dedup-actions .btn {
  flex: 1;
  min-width: 0;
}

@media (max-width: 36rem) {
  .dedup-actions {
    flex-wrap: wrap;
  }

  .dedup-actions .btn {
    flex-basis: 100%;
  }
}

.dedup-filter-controls textarea {
  height: 2.25rem;
  min-height: 2.25rem;
  resize: vertical;
}

.dedup-filter-controls .form-row {
  align-items: stretch;
}

.dedup-filter-controls .form-row textarea {
  flex: 1;
  width: auto;
}
