/* ============================================================
   STOPWORD REMOVER — style.css
   Matches Tooleble site theme: #1e1e2f base, #00DFD8 accent
   ============================================================ */

/* ---- Settings Bar ---- */
.sw-subtitle {
  color: #6b7280;
  font-size: 1rem;
}

.sw-settings-bar {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}

.sw-settings-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.sw-setting-group {
  padding: 12px 16px;
  flex: 1 1 auto;
  min-width: 200px;
  border-right: 1px solid #e5e7eb;
}

.sw-setting-group:last-child {
  border-right: none;
}

.sw-setting-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
  margin-bottom: 8px;
}

/* ---- Language Chips ---- */
.sw-lang-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sw-lang-chip {
  background: #fff;
  border: 1.5px solid #d1d5db;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  color: #374151;
  white-space: nowrap;
}

.sw-lang-chip:hover {
  border-color: #00dfd8;
  color: #1e1e2f;
  background: #f0fffe;
}

.sw-lang-chip.active {
  background: #1e1e2f;
  border-color: #1e1e2f;
  color: #00dfd8;
  font-weight: 600;
}

/* ---- Toggle Switches ---- */
.sw-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.sw-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  color: #374151;
  user-select: none;
  white-space: nowrap;
}

.sw-toggle-label input[type="checkbox"] {
  display: none;
}

.sw-toggle-track {
  width: 36px;
  height: 20px;
  background: #d1d5db;
  border-radius: 20px;
  position: relative;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.sw-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.sw-toggle-label input:checked + .sw-toggle-track {
  background: #1e1e2f;
}

.sw-toggle-label input:checked + .sw-toggle-track .sw-toggle-thumb {
  transform: translateX(16px);
  background: #00dfd8;
}

/* ---- Stats Bar ---- */
.sw-stats-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  background: #1e1e2f;
  border-radius: 10px;
  padding: 10px 20px;
  margin-top: 4px;
}

.sw-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 20px;
}

.sw-stat-divider {
  width: 1px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
}

.sw-stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: #00dfd8;
  line-height: 1;
  transition: all 0.2s;
}

.sw-stat-removed {
  color: #f87171;
}

.sw-stat-reduction {
  color: #fbbf24;
}

.sw-stat-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 2px;
}

@keyframes statPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.18);
  }
  100% {
    transform: scale(1);
  }
}

.sw-stat-pulse {
  animation: statPulse 0.4s ease;
}

/* ---- Label Row ---- */
.sw-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sw-char-counter {
  font-size: 0.75rem;
  color: #9ca3af;
  font-weight: 500;
}

/* ---- View Tabs ---- */
.sw-view-tabs {
  display: flex;
  gap: 2px;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 2px;
}

.sw-view-tab {
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.18s;
  white-space: nowrap;
}

.sw-view-tab:hover {
  color: #1e1e2f;
}

.sw-view-tab.active {
  background: #1e1e2f;
  color: #00dfd8;
}

/* ---- Textareas ---- */
.sw-input-textarea,
.sw-output-textarea {
  min-height: 200px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #1f2937;
  background: #fff;
  border-color: #d1d5db;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  font-family: inherit;
}

.sw-input-textarea:focus {
  border-color: #00dfd8;
  box-shadow: 0 0 0 3px rgba(0, 223, 216, 0.12);
}

.sw-output-textarea {
  background: #f9fafb;
  color: #374151;
}

/* ---- Output views ---- */
.sw-output-highlight,
.sw-output-removed {
  min-height: 200px;
  font-size: 0.88rem;
  line-height: 1.8;
  background: #fff;
  border-color: #d1d5db;
  color: #374151;
  word-break: break-word;
  overflow-y: auto;
  font-family: inherit;
}

.sw-highlight-removed {
  background: rgba(248, 113, 113, 0.18);
  color: #dc2626;
  text-decoration: line-through;
  border-radius: 3px;
  padding: 0 2px;
  font-weight: 500;
  transition: background 0.2s;
}

.sw-highlight-removed:hover {
  background: rgba(248, 113, 113, 0.35);
}

.sw-highlight-kept {
  color: #166534;
  font-weight: 500;
}

.sw-removed-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.8rem;
  color: #991b1b;
  margin: 3px;
  font-weight: 500;
}

.sw-removed-count {
  background: #dc2626;
  color: #fff;
  border-radius: 10px;
  padding: 1px 5px;
  font-size: 0.7rem;
  font-weight: 700;
}

.sw-no-removed {
  color: #9ca3af;
  font-style: italic;
}

/* ---- Paste Button ---- */
.sw-textarea-wrap {
  position: relative;
}

.sw-paste-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.18s;
  line-height: 1.5;
}

.sw-paste-btn:hover {
  background: #1e1e2f;
  border-color: #1e1e2f;
  color: #00dfd8;
}

/* ---- Action Buttons ---- */
.sw-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.sw-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.sw-btn:active {
  transform: scale(0.97);
}

.sw-btn-primary {
  background: #1e1e2f;
  color: #00dfd8;
}

.sw-btn-primary:hover {
  background: #2d2d46;
  box-shadow: 0 0 0 3px rgba(0, 223, 216, 0.18);
}

.sw-btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1.5px solid #d1d5db;
}

.sw-btn-secondary:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
}

.sw-btn-danger {
  background: #dc2626;
  color: #fff;
}

.sw-btn-danger:hover {
  background: #b91c1c;
}

.sw-btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* ---- Message Box ---- */
.sw-message {
  display: inline-flex;
  align-items: center;
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Custom Section & Wordlist Panel ---- */
.sw-custom-section,
.sw-preview-section {
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}

.sw-custom-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f9fafb;
  border: none;
  padding: 12px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  color: #1f2937;
  transition: background 0.18s;
  text-align: left;
}

.sw-custom-toggle:hover {
  background: #f3f4f6;
}

.sw-custom-toggle.open {
  background: #1e1e2f;
  color: #00dfd8;
}

.sw-custom-toggle.open svg {
  stroke: #00dfd8;
}

.sw-custom-badge {
  background: #1e1e2f;
  color: #00dfd8;
  border-radius: 12px;
  padding: 1px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 22px;
  text-align: center;
}

.sw-custom-toggle.open .sw-custom-badge {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.sw-chevron {
  margin-left: auto;
  transition: transform 0.25s ease;
}

.sw-custom-toggle.open .sw-chevron {
  transform: rotate(180deg);
}

/* Custom Panel content */
.sw-custom-panel,
.sw-wordlist-panel {
  border-top: 1px solid #e5e7eb;
  padding: 16px;
  background: #fff;
}

.sw-custom-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sw-custom-add {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.sw-custom-input {
  flex: 1 1 180px;
  min-width: 150px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 0.875rem;
  color: #1f2937;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  font-family: inherit;
  background: #fff;
}

.sw-custom-input:focus {
  border-color: #00dfd8;
  box-shadow: 0 0 0 3px rgba(0, 223, 216, 0.1);
}

.sw-custom-hint {
  font-size: 0.78rem;
  color: #9ca3af;
  margin: 0;
}

.sw-link {
  color: #00dfd8;
  text-decoration: underline;
  cursor: pointer;
}

.sw-link:hover {
  color: #1e1e2f;
}

/* Custom Chips */
.sw-custom-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 32px;
}

.sw-empty-msg {
  color: #9ca3af;
  font-size: 0.82rem;
  font-style: italic;
}

.sw-custom-chip-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 20px;
  padding: 3px 8px 3px 12px;
  font-size: 0.8rem;
  color: #1d4ed8;
  font-weight: 500;
  animation: chipIn 0.2s ease;
}

@keyframes chipIn {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.sw-chip-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: #3b82f6;
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
  transition: color 0.15s;
  display: flex;
  align-items: center;
}

.sw-chip-remove:hover {
  color: #dc2626;
}

/* ---- Wordlist Panel ---- */
.sw-wordlist-search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.sw-wordlist-count {
  font-size: 0.78rem;
  color: #6b7280;
  white-space: nowrap;
  font-weight: 500;
}

.sw-wordlist-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 200px;
  overflow-y: auto;
  padding: 2px;
}

.sw-wordlist-item {
  display: inline-block;
  background: #f3f4f6;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.75rem;
  color: #4b5563;
  font-family: "Courier New", monospace;
  line-height: 1.6;
}

.sw-wordlist-grid::-webkit-scrollbar {
  width: 6px;
}
.sw-wordlist-grid::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}
.sw-wordlist-grid::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

/* ---- Textarea scrollbars ---- */
textarea::-webkit-scrollbar {
  width: 8px;
}
textarea::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}
textarea::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}
textarea::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* ---- Responsive Tweaks ---- */
@media (max-width: 768px) {
  .sw-settings-inner {
    flex-direction: column;
  }

  .sw-setting-group {
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
  }

  .sw-setting-group:last-child {
    border-bottom: none;
  }

  .sw-stats-bar {
    gap: 4px;
    padding: 10px 8px;
  }

  .sw-stat {
    padding: 6px 10px;
  }

  .sw-stat-value {
    font-size: 1.1rem;
  }

  .sw-stat-divider {
    display: none;
  }

  .sw-actions {
    gap: 6px;
  }

  .sw-btn {
    padding: 8px 12px;
    font-size: 0.82rem;
  }

  .sw-view-tabs {
    flex-wrap: wrap;
  }

  .sw-view-tab {
    font-size: 0.7rem;
    padding: 3px 8px;
  }

  .sw-label-row {
    flex-wrap: wrap;
    gap: 4px;
  }
}

@media (max-width: 480px) {
  .sw-lang-chip {
    padding: 3px 9px;
    font-size: 0.75rem;
  }

  .sw-stats-bar {
    flex-wrap: wrap;
    justify-content: space-around;
  }

  .sw-stat {
    flex: 1 1 80px;
    min-width: 60px;
  }

  .sw-custom-add {
    flex-direction: column;
    align-items: stretch;
  }

  .sw-btn {
    width: 100%;
    justify-content: center;
  }

  .sw-actions .sw-btn {
    flex: 1 1 calc(50% - 8px);
  }
}

/* ---- Btn transition ---- */
.sw-btn,
.sw-lang-chip,
.sw-view-tab {
  transition: all 0.2s ease;
}
