:root {
  --bg: #090d18;
  --card: rgba(255, 255, 255, 0.035);
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #e7eaf3;
  --muted: #8a93ab;
  --accent: #7c6cff;
  --accent-2: #a855f7;
  --valid: #22c55e;
  --invalid: #f43f5e;
  --dup: #f59e0b;
  --radius: 18px;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.bg-glow {
  position: fixed;
  width: 620px; height: 620px;
  border-radius: 50%;
  filter: blur(140px);
  opacity: .28;
  pointer-events: none;
  z-index: 0;
}
.bg-glow.g1 { background: var(--accent); top: -220px; left: -160px; }
.bg-glow.g2 { background: #06b6d4; bottom: -260px; right: -200px; opacity: .16; }

.container {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 24px 40px;
}

/* ---------- HERO ---------- */
.hero { text-align: center; margin-bottom: 36px; }
.logo {
  width: 64px; height: 64px;
  margin: 0 auto 18px;
  border-radius: 18px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 40px -8px rgba(124, 108, 255, .6);
}
.logo svg { width: 32px; height: 32px; color: #fff; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); font-weight: 800; letter-spacing: -0.03em; }
.hero h1 span {
  background: linear-gradient(90deg, var(--accent), #22d3ee);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--muted); margin-top: 10px; font-size: 16px; }

/* ---------- CARD ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-head h2 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

/* ---------- INPUT ---------- */
.dropzone { position: relative; }
textarea {
  width: 100%;
  height: 230px;
  resize: vertical;
  background: rgba(0, 0, 0, .28);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 16px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.65;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(124, 108, 255, .15); }
textarea::placeholder { color: #5b6380; }

.drop-overlay {
  position: absolute; inset: 0;
  border-radius: 14px;
  border: 2px dashed var(--accent);
  background: rgba(124, 108, 255, .14);
  display: flex; flex-direction: column; gap: 8px;
  align-items: center; justify-content: center;
  font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.drop-overlay svg { width: 34px; height: 34px; }
.dropzone.dragging .drop-overlay { opacity: 1; }

.options { display: flex; gap: 22px; flex-wrap: wrap; margin: 16px 0; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: #c9cfe0; user-select: none; }
.switch input { display: none; }
.slider {
  width: 38px; height: 22px;
  background: rgba(255, 255, 255, .12);
  border-radius: 999px;
  position: relative;
  transition: background .2s;
}
.slider::after {
  content: '';
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: #fff; border-radius: 50%;
  transition: transform .2s;
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::after { transform: translateX(16px); }

/* ---------- BUTTONS ---------- */
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 18px;
  font: inherit; font-size: 14px; font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: transform .12s, background .2s, border-color .2s, box-shadow .2s;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 17px; height: 17px; }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 8px 24px -8px rgba(124, 108, 255, .7);
}
.btn.primary:hover { box-shadow: 0 10px 30px -6px rgba(124, 108, 255, .9); }
.btn.ghost { background: rgba(255, 255, 255, .05); border-color: var(--card-border); }
.btn.ghost:hover { background: rgba(255, 255, 255, .09); }
.btn.danger-ghost { background: transparent; border-color: rgba(244, 63, 94, .35); color: #fda4af; }
.btn.danger-ghost:hover { background: rgba(244, 63, 94, .1); }
.btn.success { background: rgba(34, 197, 94, .15); border-color: rgba(34, 197, 94, .4); color: #86efac; }
.btn.success:hover { background: rgba(34, 197, 94, .25); }
.btn.small { padding: 8px 13px; font-size: 13px; border-radius: 10px; }

/* ---------- STATS ---------- */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat {
  border-radius: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--card-border);
  display: flex; flex-direction: column; gap: 4px;
  position: relative; overflow: hidden;
}
.stat::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--c, var(--accent));
}
.stat.total { --c: var(--accent); }
.stat.valid { --c: var(--valid); }
.stat.invalid { --c: var(--invalid); }
.stat.dup { --c: var(--dup); }
.stat-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; color: var(--c); }
.stat.total .stat-value { color: var(--text); }

.ratio { margin: 18px 0 20px; }
.ratio-bar {
  height: 10px; border-radius: 999px; overflow: hidden;
  background: rgba(255, 255, 255, .07);
  display: flex;
}
.seg { height: 100%; width: 0; transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.seg.valid { background: var(--valid); }
.seg.invalid { background: var(--invalid); }
.seg.dup { background: var(--dup); }
.ratio-text { margin-top: 8px; font-size: 13px; color: var(--muted); }

.ops-title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.ops { display: flex; flex-wrap: wrap; gap: 8px; }
.op-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--card-border);
}
.op-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--oc); display: inline-block; }
.op-chip b { color: var(--muted); font-weight: 600; }

/* ---------- RESULTS ---------- */
.results-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px; flex-wrap: wrap;
  padding-bottom: 16px; margin-bottom: 8px;
  border-bottom: 1px solid var(--card-border);
}
.tabs { display: flex; gap: 6px; background: rgba(0, 0, 0, .25); padding: 4px; border-radius: 12px; }
.tab {
  border: none; background: transparent; color: var(--muted);
  font: inherit; font-size: 13px; font-weight: 600;
  padding: 8px 14px; border-radius: 9px; cursor: pointer;
  display: inline-flex; gap: 7px; align-items: center;
  transition: background .2s, color .2s;
}
.tab b {
  font-size: 11px; padding: 2px 7px; border-radius: 999px;
  background: rgba(255, 255, 255, .08); color: var(--text);
}
.tab:hover { color: var(--text); }
.tab.active { background: rgba(255, 255, 255, .09); color: var(--text); }
.tab[data-filter="valid"].active b { background: var(--valid); color: #052e16; }
.tab[data-filter="invalid"].active b { background: var(--invalid); color: #fff; }
.tab[data-filter="dup"].active b { background: var(--dup); color: #3b2300; }
.tab[data-filter="all"].active b { background: var(--accent); color: #fff; }

.list-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.list-title h2 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.pill {
  font-size: 12px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px;
  background: var(--valid); color: #052e16;
}
.row .num-main { font-size: 16px; letter-spacing: .06em; color: #fff; }

.tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: rgba(0, 0, 0, .25);
  border: 1px solid var(--card-border);
  border-radius: 10px; padding: 0 12px;
}
.search svg { width: 15px; height: 15px; color: var(--muted); }
.search input {
  background: none; border: none; outline: none; color: var(--text);
  font: inherit; font-size: 13px; padding: 9px 0; width: 150px;
}
select {
  background: rgba(0, 0, 0, .25);
  border: 1px solid var(--card-border);
  color: var(--text);
  border-radius: 10px; padding: 8px 10px;
  font-family: var(--mono); font-size: 12px; outline: none; cursor: pointer;
}
select option { background: #141a2b; }

.results { list-style: none; max-height: 620px; overflow-y: auto; padding-right: 4px; }
.results::-webkit-scrollbar { width: 8px; }
.results::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .1); border-radius: 8px; }

.row {
  display: grid;
  grid-template-columns: 46px 34px 1fr auto 38px;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  border-radius: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
  animation: rowIn .35s cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: calc(var(--i, 0) * 18ms);
  transition: background .15s;
}
.row:hover { background: rgba(255, 255, 255, .04); }
@keyframes rowIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.idx { font-family: var(--mono); font-size: 12px; color: #5b6380; text-align: right; }
.status-ico {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
}
.status-ico svg { width: 16px; height: 16px; }
.row.valid .status-ico { background: rgba(34, 197, 94, .15); color: var(--valid); }
.row.invalid .status-ico { background: rgba(244, 63, 94, .15); color: var(--invalid); }
.row.dup .status-ico { background: rgba(245, 158, 11, .15); color: var(--dup); }

.num { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.num-main { font-family: var(--mono); font-size: 15px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.invalid .num-main { color: #fecdd3; }
.num-raw { font-family: var(--mono); font-size: 11px; color: #5b6380; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.op-tag {
  justify-self: start;
  font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, .04);
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.op-tag i { width: 7px; height: 7px; border-radius: 50%; background: var(--oc, #64748b); }
.op-tag.none { color: #5b6380; }

.reason { font-size: 13px; color: var(--muted); }
.row.valid .reason { color: #86efac; }
.row.invalid .reason { color: #fda4af; }
.row.dup .reason { color: #fcd34d; }

.copy-btn {
  width: 32px; height: 32px; border-radius: 9px;
  border: 1px solid transparent; background: transparent;
  color: var(--muted); cursor: pointer;
  display: grid; place-items: center;
  opacity: 0; transition: opacity .15s, background .15s, color .15s;
}
.copy-btn svg { width: 15px; height: 15px; }
.row:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: rgba(255, 255, 255, .08); color: var(--text); }

.empty {
  text-align: center; padding: 60px 20px; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.empty svg { width: 46px; height: 46px; opacity: .4; margin-bottom: 6px; }
.empty p { font-size: 15px; color: #b6bdd1; }
.hidden { display: none !important; }

.foot { text-align: center; margin-top: 26px; line-height: 1.6; }

/* ---------- KAYDET / DIŞA AKTAR ---------- */
.export-card { margin-top: 20px; }
.card-head h2 { display: flex; align-items: center; gap: 10px; }
.h-ico { width: 18px; height: 18px; color: var(--accent); }
.export-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 22px; }
.export-opts { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.field select { padding: 11px 12px; font-size: 13px; border-radius: 12px; }

.ftype { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 12px 16px; border-radius: 12px;
  background: rgba(0, 0, 0, .25);
  border: 1.5px solid var(--card-border);
  color: var(--muted); font: inherit; cursor: pointer; text-align: left;
  transition: border-color .2s, background .2s, color .2s;
}
.seg-btn b { font-family: var(--mono); font-size: 16px; color: var(--text); }
.seg-btn small { font-size: 12px; }
.seg-btn:hover { border-color: rgba(255, 255, 255, .2); }
.seg-btn.active { border-color: var(--accent); background: rgba(124, 108, 255, .12); color: #c4bcff; }

.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: #c9cfe0; cursor: pointer; user-select: none; }
.check input { display: none; }
.check span {
  width: 18px; height: 18px; border-radius: 5px;
  border: 1.5px solid rgba(255, 255, 255, .25);
  display: grid; place-items: center; transition: background .15s, border-color .15s;
}
.check input:checked + span { background: var(--accent); border-color: var(--accent); }
.check input:checked + span::after { content: '✓'; color: #fff; font-size: 12px; font-weight: 800; line-height: 1; }

.fname {
  display: flex; align-items: center;
  background: rgba(0, 0, 0, .25);
  border: 1px solid var(--card-border);
  border-radius: 12px; overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.fname:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(124, 108, 255, .15); }
.fname input { flex: 1; min-width: 0; background: none; border: none; outline: none; color: var(--text); font-family: var(--mono); font-size: 13px; padding: 11px 12px; }
.fname span { padding: 11px 14px; font-family: var(--mono); font-size: 13px; color: #c4bcff; background: rgba(124, 108, 255, .12); border-left: 1px solid var(--card-border); }

.save-btn { justify-content: center; padding: 14px 18px; font-size: 15px; }
.save-btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

.export-preview { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.export-preview pre {
  flex: 1; min-height: 220px; max-height: 360px; overflow: auto;
  background: rgba(0, 0, 0, .35);
  border: 1px solid var(--card-border);
  border-radius: 12px; padding: 14px 16px;
  font-family: var(--mono); font-size: 13px; line-height: 1.7;
  color: #b8f5cc; white-space: pre-wrap; word-break: break-all;
}

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

/* ---------- TOAST ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px;
  transform: translate(-50%, 20px);
  background: #161c2e; border: 1px solid var(--card-border);
  padding: 12px 20px; border-radius: 12px;
  font-size: 14px; font-weight: 500;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, .6);
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 920px) {
  .grid { grid-template-columns: 1fr; }
  .row { grid-template-columns: 30px 30px 1fr auto 34px; gap: 8px; }
  .copy-btn { opacity: 1; }
}
@media (max-width: 560px) {
  .container { padding: 32px 14px; }
  .tools { width: 100%; }
  .search { flex: 1; }
  .search input { width: 100%; }
}
