/* =============================================
   Text Difference Checker — tdc-style.css
   SeriesWire.com | v1.0.0
   ============================================= */

:root {
  --tdc-primary:   #e97b33;
  --tdc-accent:    #01266f;
  --tdc-added-bg:  #d4edda;
  --tdc-added-fg:  #155724;
  --tdc-del-bg:    #f8d7da;
  --tdc-del-fg:    #721c24;
  --tdc-radius:    8px;
  --tdc-shadow:    0 2px 12px rgba(0,0,0,.08);
  --tdc-font:      -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.tdc-wrap *,
.tdc-wrap *::before,
.tdc-wrap *::after { box-sizing: border-box; }

.tdc-wrap {
  font-family: var(--tdc-font);
  color: #222;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 0 40px;
}

/* ── Section heading (H2) ── */
.tdc-section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--tdc-accent);
  margin: 0 0 10px;
  padding: 0;
  border: none;
  line-height: 1.3;
}

.tdc-intro {
  font-size: .97rem;
  color: #444;
  margin: 0 0 22px;
  line-height: 1.7;
}

/* ── Toggle row ── */
.tdc-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.tdc-toggle-label {
  font-size: .9rem;
  font-weight: 600;
  color: var(--tdc-accent);
}
.tdc-toggle-btn-group {
  display: flex;
  border: 2px solid var(--tdc-accent);
  border-radius: var(--tdc-radius);
  overflow: hidden;
}
.tdc-mode-btn {
  background: #fff;
  border: none;
  padding: 7px 18px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--tdc-accent);
  transition: background .2s, color .2s;
}
.tdc-mode-btn:hover {
  background: #eef2ff;
}
.tdc-mode-btn.tdc-mode-active {
  background: var(--tdc-accent);
  color: #fff;
}

/* ── Textarea row ── */
.tdc-textarea-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}
.tdc-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.tdc-label {
  font-size: .88rem;
  font-weight: 700;
  color: var(--tdc-accent);
  margin-bottom: 6px;
  display: block;
}
.tdc-textarea {
  width: 100%;
  height: 220px;
  resize: vertical;
  border: 2px solid #d0d7e3;
  border-radius: var(--tdc-radius);
  padding: 12px 14px;
  font-size: .93rem;
  font-family: var(--tdc-font);
  color: #222;
  line-height: 1.6;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.tdc-textarea:focus {
  border-color: var(--tdc-primary);
  box-shadow: 0 0 0 3px rgba(233,123,51,.18);
}

/* ── Action buttons ── */
.tdc-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.tdc-btn {
  border: none;
  border-radius: var(--tdc-radius);
  padding: 10px 24px;
  font-size: .93rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, transform .1s, box-shadow .2s;
  outline: none;
}
.tdc-btn:active { transform: translateY(1px); }
.tdc-btn-primary {
  background: var(--tdc-primary);
  color: #fff;
  box-shadow: 0 3px 10px rgba(233,123,51,.35);
}
.tdc-btn-primary:hover {
  background: #d46a22;
  box-shadow: 0 4px 14px rgba(233,123,51,.45);
}
.tdc-btn-secondary {
  background: #f0f4ff;
  color: var(--tdc-accent);
  border: 2px solid #d0d7e3;
}
.tdc-btn-secondary:hover {
  background: #e2e9ff;
}
.tdc-btn-ghost {
  background: #fff;
  color: var(--tdc-accent);
  border: 2px solid var(--tdc-accent);
}
.tdc-btn-ghost:hover {
  background: var(--tdc-accent);
  color: #fff;
}

/* ── Stats panel ── */
.tdc-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 26px;
}
.tdc-stat {
  flex: 1 1 130px;
  background: #fff;
  border-radius: var(--tdc-radius);
  box-shadow: var(--tdc-shadow);
  padding: 16px 18px;
  text-align: center;
  border-top: 4px solid #ccc;
  transition: transform .15s;
}
.tdc-stat:hover { transform: translateY(-2px); }
.tdc-stat-added    { border-top-color: #28a745; }
.tdc-stat-removed  { border-top-color: #dc3545; }
.tdc-stat-unchanged{ border-top-color: #6c757d; }
.tdc-stat-orig     { border-top-color: var(--tdc-accent); }
.tdc-stat-rev      { border-top-color: var(--tdc-accent); }
.tdc-stat-sim      { border-top-color: var(--tdc-primary); }

.tdc-stat-value {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--tdc-accent);
  line-height: 1.1;
}
.tdc-stat-sim .tdc-stat-value { color: var(--tdc-primary); }
.tdc-stat-desc {
  display: block;
  font-size: .78rem;
  color: #666;
  margin-top: 4px;
  font-weight: 500;
}

/* ── Result area ── */
.tdc-result-wrap {
  background: #fff;
  border: 2px solid #d0d7e3;
  border-radius: var(--tdc-radius);
  padding: 20px 22px;
  box-shadow: var(--tdc-shadow);
}
.tdc-result-heading {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--tdc-accent);
  margin: 0 0 10px;
  padding: 0;
  border: none;
}
.tdc-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-size: .82rem;
  font-weight: 600;
}
.tdc-legend-item { display: flex; align-items: center; gap: 5px; }
.tdc-legend-added    { color: var(--tdc-added-fg); }
.tdc-legend-removed  { color: var(--tdc-del-fg); }
.tdc-legend-unchanged{ color: #555; }

.tdc-result {
  font-size: .95rem;
  line-height: 2;
  word-break: break-word;
  white-space: pre-wrap;
}

/* ── Diff tokens ── */
.tdc-ins {
  background: var(--tdc-added-bg);
  color: var(--tdc-added-fg);
  border-radius: 3px;
  padding: 1px 3px;
  font-weight: 600;
}
.tdc-del {
  background: var(--tdc-del-bg);
  color: var(--tdc-del-fg);
  text-decoration: line-through;
  border-radius: 3px;
  padding: 1px 3px;
}

/* ── Toast ── */
.tdc-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--tdc-accent);
  color: #fff;
  padding: 12px 22px;
  border-radius: var(--tdc-radius);
  font-size: .9rem;
  font-weight: 600;
  box-shadow: 0 4px 18px rgba(0,0,0,.2);
  z-index: 99999;
  animation: tdcFadeIn .25s ease;
}
@keyframes tdcFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ── */
@media (max-width: 700px) {
  .tdc-textarea-row { flex-direction: column; }
  .tdc-textarea     { height: 160px; }
  .tdc-stat         { flex: 1 1 calc(50% - 14px); }
  .tdc-section-title{ font-size: 1.25rem; }
  .tdc-actions      { flex-direction: column; }
  .tdc-btn          { width: 100%; text-align: center; }
}
@media (max-width: 420px) {
  .tdc-stat { flex: 1 1 100%; }
}
