/* ===== Text Cleaner ===== */

.text-cleaner-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}

/* --- Left panel --- */
.text-cleaner-left {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.text-cleaner-paste-zone {
  min-height: 220px;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  cursor: text;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  overflow-y: auto;
}
.text-cleaner-paste-zone:focus {
  border-color: var(--color-primary);
  background: var(--color-bg);
}
.text-cleaner-paste-zone.state-loaded {
  border-style: solid;
  border-color: #22c55e;
  cursor: default;
}

.paste-placeholder {
  text-align: center;
  padding: 44px 24px;
  pointer-events: none;
  user-select: none;
}
.paste-placeholder .paste-icon {
  font-size: 2.4rem;
  margin-bottom: 12px;
}
.paste-placeholder p {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
}
.paste-placeholder .paste-hint {
  margin-top: 6px !important;
  font-size: 0.82rem !important;
  font-weight: 400 !important;
  color: var(--color-text-muted) !important;
  line-height: 1.5 !important;
}

.paste-loaded {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.paste-loaded-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #22c55e;
}
.paste-loaded-preview {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.55;
  max-height: 100px;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent);
  mask-image: linear-gradient(to bottom, black 50%, transparent);
}

.paste-zone-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 28px;
}

/* --- Options panel --- */
.text-cleaner-options {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}
.text-cleaner-options-heading {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin: 0 0 14px;
}
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 28px;
}
.option-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--color-text);
}
.option-item input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--color-primary);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* --- Right panel: output --- */
.text-cleaner-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 80px;
}

.text-cleaner-empty-state {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 40px 24px;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  gap: 8px;
}
.text-cleaner-empty-state .empty-icon {
  font-size: 2rem;
  opacity: 0.35;
}

.text-cleaner-output {
  width: 100%;
  min-height: 340px;
  resize: vertical;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 0.9rem;
  line-height: 1.7;
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-bg);
  box-sizing: border-box;
}

.text-cleaner-stats {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  min-height: 1.2em;
}

.text-cleaner-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Copy toast */
.copy-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: #1a1a2e;
  color: #fff;
  padding: 12px 24px;
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 9999;
  white-space: nowrap;
}
.copy-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 768px) {
  .text-cleaner-layout {
    grid-template-columns: 1fr;
  }
  .text-cleaner-right {
    position: static;
  }
  .options-grid {
    grid-template-columns: 1fr;
  }
}
