/* ============================================================
   diff-checker.css — Chedders Tools
   ============================================================ */

/* --- Base --- */
:root {
  --primary: #0b1f3a;
  --primary-light: #16345f;
  --background: #ffffff;
  --surface: #f8f9fa;
  --text: #111111;
  --muted: #6c757d;
  --border: #e5e7eb;
  --shadow: rgba(0,0,0,0.05);
  --diff-removed-bg: #fff0f0;
  --diff-removed-border: #ffc5c5;
  --diff-added-bg: #f0fff4;
  --diff-added-border: #b3f0c5;
  --diff-removed-prefix: #c0392b;
  --diff-added-prefix: #1a7a3c;
}

[data-theme="dark"] {
  --background: #081120;
  --surface: #0f1c2e;
  --text: #ffffff;
  --muted: #b0b7c3;
  --border: rgba(255,255,255,0.08);
  --shadow: rgba(0,0,0,0.3);
  --diff-removed-bg: #2d1010;
  --diff-removed-border: rgba(192,57,43,0.4);
  --diff-added-bg: #0d2516;
  --diff-added-border: rgba(26,122,60,0.4);
  --diff-removed-prefix: #ff6b6b;
  --diff-added-prefix: #51cf66;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', 'Plus Jakarta Sans', 'Manrope', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--background);
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* --- Layout --- */
.container-xl {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Navbar --- */
.navbar {
  height: 60px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.navbar .container-xl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.navbar-brand {
  text-decoration: none;
  font-size: 16px;
}

.brand-text {
  font-weight: 700;
  color: var(--primary);
}

[data-theme="dark"] .brand-text {
  color: #ffffff;
}

.brand-dot {
  font-weight: 700;
  color: var(--primary);
}

[data-theme="dark"] .brand-dot {
  color: #ffffff;
}

.brand-tools {
  font-weight: 400;
  color: var(--muted);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-back {
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-back:hover {
  color: var(--primary);
}

[data-theme="dark"] .nav-back:hover {
  color: #ffffff;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 14px;
  transition: border-color 0.2s;
}

.theme-toggle:hover {
  border-color: var(--primary);
}

/* --- Page Header --- */
.tool-header {
  padding: 40px 0 24px;
}

.tool-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

[data-theme="dark"] .tool-title {
  color: #ffffff;
}

.tool-description {
  font-size: 15px;
  color: var(--muted);
  margin-top: 6px;
}

/* --- Tool Main --- */
.tool-main {
  padding: 0 0 80px;
}

/* --- Tool Card --- */
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 2px 8px var(--shadow);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

/* --- Inputs Row --- */
.inputs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.input-pane {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.tool-textarea {
  width: 100%;
  min-height: 200px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  color: var(--text);
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.2s, background-color 0.25s ease, color 0.25s ease;
}

.tool-textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 0;
  border-color: var(--primary);
}

.tool-textarea::placeholder {
  color: var(--muted);
  font-family: 'Inter', sans-serif;
}

/* --- Options Row --- */
.options-row {
  margin-bottom: 16px;
}

/* --- Toggle Switch --- */
.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.toggle-switch input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  display: inline-block;
  width: 40px;
  height: 22px;
  background: var(--border);
  border-radius: 11px;
  position: relative;
  transition: background-color 0.2s;
  flex-shrink: 0;
}

.toggle-track::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-track {
  background: var(--primary);
}

.toggle-switch input:checked + .toggle-track::after {
  transform: translateX(18px);
}

.toggle-label {
  font-size: 14px;
  color: var(--text);
  user-select: none;
}

/* --- Action Row --- */
.action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

/* --- Diff Output --- */
.diff-output {
  border-radius: 6px;
  overflow: hidden;
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  line-height: 1.6;
}

.diff-output:empty {
  display: none;
}

.diff-row {
  display: flex;
  align-items: baseline;
  gap: 0;
  border-bottom: 1px solid var(--border);
}

.diff-row:last-child {
  border-bottom: none;
}

.diff-row--unchanged {
  background: var(--background);
  color: var(--text);
}

.diff-row--removed {
  background: var(--diff-removed-bg);
  border-color: var(--diff-removed-border);
}

.diff-row--added {
  background: var(--diff-added-bg);
  border-color: var(--diff-added-border);
}

.diff-linenum {
  flex-shrink: 0;
  width: 40px;
  text-align: right;
  padding: 6px 10px 6px 6px;
  font-size: 11px;
  color: var(--muted);
  user-select: none;
  border-right: 1px solid var(--border);
}

.diff-prefix {
  flex-shrink: 0;
  width: 24px;
  text-align: center;
  padding: 6px 0;
  font-weight: 700;
  font-size: 13px;
  user-select: none;
}

.diff-row--removed .diff-prefix {
  color: var(--diff-removed-prefix);
}

.diff-row--added .diff-prefix {
  color: var(--diff-added-prefix);
}

.diff-row--unchanged .diff-prefix {
  color: transparent;
}

.diff-content {
  flex: 1;
  padding: 6px 12px;
  word-break: break-all;
  white-space: pre-wrap;
}

.diff-no-changes {
  padding: 16px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  background: var(--background);
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* --- Buttons --- */
.btn-primary-custom {
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 10px 24px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-primary-custom:hover {
  background: var(--primary-light);
}

.btn-secondary-custom {
  background: var(--background);
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 6px;
  padding: 10px 24px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.btn-secondary-custom:hover {
  background: var(--primary);
  color: #ffffff;
}

[data-theme="dark"] .btn-secondary-custom {
  color: #ffffff;
  border-color: rgba(255,255,255,0.3);
}

[data-theme="dark"] .btn-secondary-custom:hover {
  background: var(--primary-light);
  border-color: var(--primary-light);
}

/* --- Footer --- */
.site-footer {
  padding: 24px 0;
  border-top: 1px solid var(--border);
  transition: border-color 0.25s ease;
}

.footer-text {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.footer-text a {
  color: var(--primary);
  text-decoration: none;
}

[data-theme="dark"] .footer-text a {
  color: #ffffff;
}

/* --- Responsive --- */
@media (max-width: 767px) {
  .inputs-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575px) {
  .tool-card {
    padding: 16px;
  }

  .tool-title {
    font-size: 22px;
  }

  .btn-primary-custom,
  .btn-secondary-custom {
    width: 100%;
  }
}
