/* Araçlar bölümü – portföy sitesiyle aynı koyu tema (Tailwind CDN yerine) */
:root {
  --bg: #121212;
  --card: #1e1e1f;
  --card-2: #2b2b2c;
  --line: #383838;
  --text: #fafafa;
  --text-2: #d6d6d6;
  --muted: #b5b5b5;
  --accent: #ffdb70;
  --ok: #6fcf97;
  --warn: #f2c94c;
  --bad: #ff7b7b;
  --radius: 16px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-2);
  font-family: Poppins, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.65;
}

a { color: var(--accent); }
a:hover { text-decoration: none; }

h1, h2, h3 { color: var(--text); line-height: 1.3; margin: 0 0 12px; font-weight: 600; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
h2 { font-size: 1.3rem; margin-top: 4px; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 12px; }
ul, ol { padding-left: 20px; margin: 0 0 12px; }
code { background: var(--card-2); padding: 1px 6px; border-radius: 6px; font-size: .9em; color: var(--text); word-break: break-all; }

.t-wrap { width: 100%; max-width: 980px; margin: 0 auto; padding: 0 16px; }

/* Üst bar */
.t-header { border-bottom: 1px solid var(--line); background: var(--card); }
.t-header-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.t-brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 600; }
.t-brand img { border-radius: 10px; background: var(--card-2); height: auto; }
.t-nav { display: flex; gap: 6px; }
.t-nav a { color: var(--text-2); text-decoration: none; padding: 12px 12px; border-radius: 10px; min-height: 44px; }
.t-nav a:hover, .t-nav a[aria-current] { color: var(--accent); background: var(--card-2); }

.t-main { padding-top: 18px; padding-bottom: 40px; }

.t-crumbs { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.t-crumbs a { color: var(--muted); }

.t-hero { margin-bottom: 18px; }
.t-hero p { color: var(--text-2); max-width: 760px; }

.t-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }

/* Form */
.t-form { display: flex; gap: 10px; flex-wrap: wrap; }
.t-form label { width: 100%; font-weight: 500; color: var(--text); }
.t-input {
  flex: 1 1 260px; min-width: 0; padding: 13px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit; font-size: 16px;
}
.t-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.t-btn {
  padding: 13px 22px; border: 0; border-radius: 12px; background: var(--accent); color: #121212;
  font: inherit; font-weight: 600; cursor: pointer; min-height: 48px;
}
.t-btn:disabled { opacity: .6; cursor: progress; }
.t-hint { font-size: 13px; color: var(--muted); margin: 10px 0 0; width: 100%; }

/* Sonuç */
.t-result:empty { display: none; }
.t-status { padding: 12px 14px; border-radius: 12px; background: var(--card-2); margin-bottom: 12px; }
.t-status.ok { border-left: 4px solid var(--ok); }
.t-status.warn { border-left: 4px solid var(--warn); }
.t-status.bad { border-left: 4px solid var(--bad); }
.t-big { font-size: 1.15rem; color: var(--text); font-weight: 600; }

.t-kv { display: grid; grid-template-columns: minmax(130px, 220px) 1fr; gap: 8px 16px; margin: 0 0 12px; }
.t-kv dt { color: var(--muted); }
.t-kv dd { margin: 0; color: var(--text); word-break: break-word; }

.t-table-wrap { overflow-x: auto; margin-bottom: 12px; }
.t-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.t-table th, .t-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.t-table th { color: var(--muted); font-weight: 500; white-space: nowrap; }
.t-table td { color: var(--text); word-break: break-word; }

.t-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; background: var(--card-2); }
.t-badge.ok { color: var(--ok); }
.t-badge.warn { color: var(--warn); }
.t-badge.bad { color: var(--bad); }

.t-list { list-style: none; padding: 0; }
.t-list li { padding: 6px 0 6px 22px; position: relative; }
.t-list li::before { content: "•"; position: absolute; left: 6px; color: var(--accent); }

details.t-raw summary { cursor: pointer; color: var(--accent); margin: 6px 0; }
details.t-raw pre {
  white-space: pre-wrap; word-break: break-word; background: var(--bg); padding: 12px; border-radius: 12px;
  max-height: 420px; overflow: auto; font-size: 12.5px; color: var(--text-2);
}

/* Google önizleme */
.t-serp { background: #fff; color: #202124; border-radius: 12px; padding: 16px 18px; max-width: 640px; font-family: Arial, sans-serif; }
.t-serp-site { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.t-serp-site img { width: 26px; height: 26px; border-radius: 50%; background: #f1f3f4; padding: 4px; }
.t-serp-site small { display: block; color: #4d5156; font-size: 12px; }
.t-serp-title { color: #1a0dab; font-size: 20px; line-height: 1.3; margin: 6px 0 3px; }
.t-serp-desc { color: #4d5156; font-size: 14px; line-height: 1.58; }
.t-edit { display: grid; gap: 10px; margin-top: 14px; }
.t-edit label { display: grid; gap: 4px; color: var(--text); font-weight: 500; }
.t-edit textarea { resize: vertical; min-height: 70px; }
.t-count { font-size: 12px; color: var(--muted); font-weight: 400; }
.t-count.over { color: var(--bad); }

/* İçerik */
.t-content h2 { margin-top: 10px; }
.t-content h3 { margin-top: 14px; }

.t-faq details { border-bottom: 1px solid var(--line); padding: 10px 0; }
.t-faq details:last-child { border-bottom: 0; }
.t-faq summary { cursor: pointer; color: var(--text); font-weight: 500; }
.t-faq details p { margin: 8px 0 0; }

/* Araç kartları */
.t-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.t-tile {
  display: block; height: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; text-decoration: none; color: var(--text-2); transition: border-color .2s, transform .2s;
}
.t-tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.t-tile strong, .t-tile h2 { display: block; color: var(--accent); font-size: 1.05rem; margin: 0 0 6px; }
.t-tile span { font-size: 14px; }
.t-related { margin-top: 26px; }

.t-footer { border-top: 1px solid var(--line); padding: 22px 0; font-size: 14px; }
.t-footer p { margin: 0 0 6px; }
.t-muted { color: var(--muted); font-size: 13px; }

.t-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 560px) {
  .t-kv { grid-template-columns: 1fr; gap: 2px; }
  .t-kv dd { margin-bottom: 8px; }
  .t-btn { width: 100%; }
  .t-brand span { font-size: 14px; }
}

/* ---------- Kategoriler ---------- */
.t-cat { margin-bottom: 26px; }
.t-cat > h2 { margin-bottom: 4px; }
.t-cat > p { margin-bottom: 12px; }
.t-tile h3 { display: block; color: var(--accent); font-size: 1.05rem; margin: 0 0 6px; }

/* ---------- Geliştirici araçları: ortak form bileşenleri ---------- */
.t-label { display: block; font-weight: 500; color: var(--text); margin: 0; font-size: 14px; }
.t-mono { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: 13.5px; word-break: break-all; }

.t-area {
  display: block; width: 100%; min-height: 220px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: 13.5px/1.6 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  resize: vertical; tab-size: 2; transition: border-color .15s, box-shadow .15s;
}
.t-area::placeholder, .t-input::placeholder { color: #6f6f6f; }
.t-area:focus, .t-input:focus, .t-select:focus, .t-num:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 219, 112, .18); }
.t-area[readonly] { background: #161616; }

/* Panel: başlık satırı (etiket + küçük düğmeler) ve içerik */
.t-panel { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.t-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; }
.t-panel-tools { display: flex; gap: 6px; }
.t-panel .t-area { flex: 1; }

/* İki yönlü dönüştürücü: [giriş] [düğmeler] [çıkış] */
.t-converter { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 16px; align-items: stretch; }
.t-converter-actions { display: flex; flex-direction: column; justify-content: center; gap: 10px; padding-top: 40px; }
.t-converter-actions .t-btn { min-width: 132px; }

/* Seçenek çubuğu */
.t-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 16px; padding: 12px 16px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
}
.t-toolbar .t-spacer { flex: 1; }
.t-field { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); }

.t-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 14px 0 0; }

/* İkincil ve küçük düğmeler */
.t-btn-2 {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; min-height: 42px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--card-2); color: var(--text);
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; transition: border-color .15s, background .15s;
}
.t-btn-2:hover { border-color: var(--accent); }
.t-btn-sm {
  padding: 4px 10px; min-height: 32px; border-radius: 9px; border: 1px solid var(--line); background: transparent;
  color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer;
}
.t-btn-sm:hover { color: var(--accent); border-color: var(--accent); }
.t-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: filter .15s; }
.t-btn:hover { filter: brightness(1.06); }

/* Açılır liste ve sayı alanı */
.t-select, .t-num {
  height: 42px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background-color: var(--card-2);
  color: var(--text); font: inherit; font-size: 14px;
}
.t-select {
  appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23ffdb70' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.t-select option { background: var(--card); color: var(--text); }
.t-num { width: 96px; }

/* Anahtar (switch) görünümlü onay kutusu */
.t-check { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); cursor: pointer; min-height: 42px; user-select: none; }
.t-check input[type=checkbox] {
  appearance: none; -webkit-appearance: none; width: 38px; height: 22px; border-radius: 999px; background: var(--line);
  position: relative; cursor: pointer; flex: 0 0 auto; transition: background .2s; margin: 0;
}
.t-check input[type=checkbox]::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-2); transition: transform .2s, background .2s;
}
.t-check input[type=checkbox]:checked { background: rgba(255, 219, 112, .45); }
.t-check input[type=checkbox]:checked::after { transform: translateX(16px); background: var(--accent); }
.t-check input[type=checkbox]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Dosya seçici */
.t-file { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.t-file input[type=file] { color: var(--muted); font: inherit; font-size: 13px; max-width: 100%; }
.t-file input[type=file]::file-selector-button {
  margin-right: 12px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--card-2);
  color: var(--text); font: inherit; font-weight: 500; cursor: pointer;
}
.t-file input[type=file]::file-selector-button:hover { border-color: var(--accent); }

.t-divider { height: 1px; background: var(--line); margin: 22px 0 18px; border: 0; }
.t-subhead { font-size: 1.05rem; margin: 0 0 12px; }

/* Mesajlar */
.t-err { color: var(--bad); font-size: 14px; margin: 12px 0 0; min-height: 1.4em; }
.t-ok { color: var(--ok); font-size: 14px; margin: 12px 0 0; min-height: 1.4em; }
.t-note { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; margin: 14px 0 0; }
.t-note::before { content: "🔒"; font-size: 12px; }

/* Çok sütunlu yerleşim */
.t-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.t-cols > div { min-width: 0; }

mark.t-hl { background: rgba(255, 219, 112, .35); color: var(--text); border-radius: 3px; }
.t-pre { white-space: pre-wrap; word-break: break-word; background: var(--bg); border: 1px solid var(--line); padding: 14px 16px; border-radius: 12px; font: 13.5px/1.6 ui-monospace, Consolas, monospace; color: var(--text-2); max-height: 420px; overflow: auto; margin: 0; }
.t-jwt-part { font: 13.5px/1.6 ui-monospace, Consolas, monospace; word-break: break-all; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.t-jwt-part .h { color: #ff7b7b; } .t-jwt-part .p { color: #c792ea; } .t-jwt-part .s { color: #6fcf97; }

/* Regex satırı: /desen/bayrak */
.t-regex { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); overflow: hidden; }
.t-regex:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 219, 112, .18); }
.t-regex span { display: flex; align-items: center; padding: 0 12px; color: var(--accent); font: 16px ui-monospace, Consolas, monospace; background: var(--card-2); }
.t-regex input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); padding: 13px 14px; font: 15px ui-monospace, Consolas, monospace; }
.t-regex input:focus { outline: none; }
.t-regex input.t-flags { flex: 0 0 72px; border-left: 1px solid var(--line); text-align: center; }

@media (max-width: 820px) {
  .t-converter { grid-template-columns: minmax(0, 1fr); }
  .t-converter-actions { flex-direction: row; padding-top: 0; }
  .t-converter-actions .t-btn { flex: 1; min-width: 0; }
  .t-cols { grid-template-columns: minmax(0, 1fr); }
  .t-area { min-height: 160px; }
}
@media (max-width: 560px) {
  .t-toolbar { gap: 8px 16px; }
  .t-converter-actions .t-btn { width: auto; }
}

.t-err:empty, .t-ok:empty { min-height: 0; margin: 0; }
.t-panel > .t-input { flex: 0 0 auto; width: 100%; }
.t-btn-sm, .t-btn-2 { white-space: nowrap; }
.t-table td:last-child:has(.t-btn-sm) { width: 1%; }
.t-field .t-select { max-width: 100%; min-width: 0; text-overflow: ellipsis; }
@media (max-width: 820px) {
  .t-converter-actions > * { flex: 1 1 0; min-width: 0; }
}
@media (max-width: 560px) {
  .t-toolbar .t-field { width: 100%; }
  .t-toolbar .t-field .t-select { flex: 1; }
  .t-toolbar .t-spacer { display: none; }
}
