/* ===========================================================
   UDF Karşılaştırma aracı — arabulucuofis.com.tr
   Tüm seçiciler .udfk altında kapsanmıştır; site stilleriyle
   çakışmaz. Renkler site tasarım jetonlarından türetilir, bu
   sayede koyu mod ([data-theme="dark"]) kendiliğinden çalışır.
   =========================================================== */

.udfk {
  /* Fark durumu renkleri (açık mod) */
  --udfk-added: #207a36;
  --udfk-removed: #b3261e;
  --udfk-changed: #a05a00;
  --udfk-format: #5b4b8a;
  /* Belge önizlemesi her iki modda da "kâğıt" kalır */
  --udfk-paper: #fdfcf8;
  --udfk-paper-ink: #0e0e0e;
  --udfk-mark: #c71c17;

  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  max-width: var(--container-wide);
  margin: 0 auto;
  align-items: start;
}

:root[data-theme="dark"] .udfk {
  --udfk-added: #4cbf6a;
  --udfk-removed: #e5675f;
  --udfk-changed: #e0a44c;
  --udfk-format: #a893e0;
}

@media (max-width: 900px) {
  .udfk { grid-template-columns: 1fr; }
}

/* ───────────── Denetim paneli ───────────── */

.udfk-panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 72px;
}

@media (max-width: 900px) {
  .udfk-panel { position: static; }
}

.udfk-section {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 0 0 10px;
}
.udfk-section + .udfk-section,
.udfk-slot + .udfk-section,
.udfk-panel > * + .udfk-section { margin-top: 22px; }

/* Dosya yuvaları */
.udfk-slot {
  display: flex;
  gap: 11px;
  align-items: center;
  width: 100%;
  text-align: left;
  cursor: pointer;
  padding: 12px 13px;
  border-radius: var(--radius-sm);
  background: var(--paper);
  border: 1px dashed var(--line-strong);
  font-family: var(--sans);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.udfk-slot:hover,
.udfk-slot:focus-visible,
.udfk-slot.is-drag { border-color: var(--gold); outline: none; }
.udfk-slot.is-drag { background: rgba(201, 169, 97, 0.12); }
.udfk-slot.is-filled { border-style: solid; border-color: var(--line-strong); }

.udfk-slot .udfk-ic {
  width: 26px;
  flex-shrink: 0;
  color: var(--gold-deep);
}
.udfk-slot .udfk-ic svg { width: 22px; height: 22px; display: block; }
.udfk-slot .udfk-txt { min-width: 0; }
.udfk-slot .udfk-t1 {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--navy);
}
.udfk-slot .udfk-t2 {
  font-size: 13px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.udfk-slot.is-filled .udfk-t2 { color: var(--ink); font-weight: 500; }
.udfk-slot .udfk-t3 { font-size: 10.5px; color: var(--ink-muted); }

.udfk-swap {
  align-self: center;
  margin: 7px 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--white);
  color: var(--navy);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  transition: border-color 0.15s ease;
}
.udfk-swap:hover { border-color: var(--gold); }

/* Özet */
.udfk-sumrow {
  display: flex;
  gap: 9px;
  align-items: baseline;
  font-size: 13px;
  color: var(--ink-soft);
  margin: 7px 0;
}
.udfk-sumrow .udfk-dot {
  width: 17px;
  flex-shrink: 0;
  text-align: center;
  font-weight: 700;
}

/* Gezinti */
.udfk-nav { display: flex; gap: 8px; align-items: center; }
.udfk-nav button {
  width: 32px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: var(--white);
  color: var(--navy);
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  transition: border-color 0.15s ease;
}
.udfk-nav button:hover { border-color: var(--gold); }
.udfk-navlabel { font-family: var(--mono); font-size: 12px; color: var(--ink-muted); }

/* Hata */
.udfk-error {
  display: none;
  margin-top: 14px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  line-height: 1.5;
  background: rgba(179, 38, 30, 0.08);
  color: var(--udfk-removed);
  border: 1px solid rgba(179, 38, 30, 0.32);
}
.udfk-error.is-on { display: block; }

/* Gizlilik rozeti */
.udfk-privacy {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-muted);
}
.udfk-privacy svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; color: var(--udfk-added); }

/* ───────────── Belge alanı ───────────── */

.udfk-stage {
  background: var(--cream-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  height: clamp(460px, 72vh, 820px);
  overflow-y: auto;
  padding: 22px;
  display: flex;
  justify-content: center;
}

.udfk-empty {
  margin: auto;
  text-align: center;
  color: var(--ink-muted);
  max-width: 380px;
  padding: 20px;
}
.udfk-empty svg { width: 46px; height: 46px; margin: 0 auto 14px; color: var(--gold-deep); opacity: 0.8; }
.udfk-empty h2 {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 10px;
}
.udfk-empty p { font-size: 13px; line-height: 1.65; margin: 0; }

/* Kâğıt önizleme — her iki modda da açık kalır (belge simülasyonu) */
.udfk-page {
  display: none;
  background: var(--udfk-paper);
  color: var(--udfk-paper-ink);
  max-width: 860px;
  width: 100%;
  border-radius: 3px;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.2);
  padding: clamp(24px, 4vw, 46px) clamp(20px, 4.5vw, 54px);
  font-family: "Times New Roman", Times, serif;
  font-size: 13.5pt;
  height: max-content;
}
.udfk-page.is-on { display: block; }
.udfk-page .udfk-line {
  min-height: 1.3em;
  line-height: 1.45;
  margin-bottom: 2px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.udfk-page .udfk-ins {
  color: var(--udfk-mark);
  text-decoration: underline;
  text-decoration-color: var(--udfk-mark);
}
.udfk-page .udfk-del {
  color: var(--udfk-mark);
  text-decoration: line-through;
  text-decoration-color: var(--udfk-mark);
}
.udfk-page .udfk-hl {
  background: rgba(201, 169, 97, 0.42);
  border-radius: 2px;
}
.udfk-page table.udfk-tbl {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
  margin: 2px 0;
}
.udfk-page table.udfk-tbl td {
  border: 0.5px solid #8c8c8c;
  padding: 2px 5px;
  vertical-align: top;
  overflow-wrap: break-word;
}
.udfk-page table.udfk-tbl .udfk-line { margin-bottom: 0; }

/* ───────────── Lejant ───────────── */

.udfk-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  justify-content: center;
  margin: 20px auto 0;
  font-size: 12.5px;
  color: var(--ink-muted);
}
.udfk-legend span { display: inline-flex; align-items: center; gap: 7px; }
.udfk-legend .udfk-sw-ins {
  color: var(--udfk-mark);
  text-decoration: underline;
  font-family: "Times New Roman", Times, serif;
}
.udfk-legend .udfk-sw-del {
  color: var(--udfk-mark);
  text-decoration: line-through;
  font-family: "Times New Roman", Times, serif;
}
