/* ============================================================
   Buluştay Araçlar — tasarım sistemi
   ============================================================ */

:root {
  --bg: #f6f8fb;
  --bg-soft: #eef2f7;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --border: #e3e8ef;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --primary-soft: #eff4ff;
  --success: #059669;
  --success-soft: #ecfdf5;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 16px rgba(15, 23, 42, .06);
  --shadow-lg: 0 4px 8px rgba(15, 23, 42, .06), 0 12px 40px rgba(15, 23, 42, .12);
  --radius: 14px;
  --radius-sm: 9px;
  --header-h: 64px;
}

[data-theme="dark"] {
  --bg: #0b1220;
  --bg-soft: #101a2c;
  --panel: #141f33;
  --panel-2: #0f1828;
  --border: #24334d;
  --border-strong: #38496b;
  --text: #e6edf7;
  --text-2: #a8b6cc;
  --text-3: #64748b;
  --primary: #3b82f6;
  --primary-strong: #60a5fa;
  --primary-soft: #172441;
  --success: #34d399;
  --success-soft: #0c2b22;
  --danger: #f87171;
  --danger-soft: #341418;
  --warn: #fbbf24;
  --warn-soft: #2b2010;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .35);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; line-height: 1.55;
  background: var(--bg); color: var(--text);
  transition: background .25s ease, color .25s ease;
}
img, canvas { max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--panel) 85%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; gap: 16px; height: 100%; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: var(--text); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #2563eb, #7c3aed); display: grid; place-items: center; color: #fff; flex: none; }
.brand .mark svg { width: 20px; height: 20px; }
.brand small { display: block; font-size: 11px; font-weight: 600; color: var(--text-3); letter-spacing: .01em; margin-top: -3px; }
.header-nav { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.header-nav a.nav-link { padding: 8px 14px; border-radius: 8px; color: var(--text-2); font-weight: 600; font-size: 14.5px; }
.header-nav a.nav-link:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.theme-btn { width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--border); background: var(--panel); color: var(--text-2); cursor: pointer; display: grid; place-items: center; }
.theme-btn:hover { border-color: var(--border-strong); color: var(--text); }
.theme-btn svg { width: 18px; height: 18px; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
.icon-sun { display: none; }
.icon-moon { display: block; }

/* ---------- Hero (ana sayfa) ---------- */
.hero { text-align: center; padding: 64px 0 40px; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); font-weight: 800; letter-spacing: -.03em; margin: 0 0 14px; }
.hero h1 .grad { background: linear-gradient(90deg, #2563eb, #7c3aed 60%, #db2777); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { font-size: clamp(16px, 2.2vw, 19px); color: var(--text-2); max-width: 640px; margin: 0 auto; }
.hero .badges { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }
.hero .badge { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; color: var(--text-2); background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 7px 14px; }
.hero .badge svg { width: 15px; height: 15px; color: var(--success); }

/* ---------- Kategori filtreleri ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 26px 0 8px; }
.chip { border: 1px solid var(--border); background: var(--panel); color: var(--text-2); font-weight: 600; font-size: 14px; padding: 8px 16px; border-radius: 999px; cursor: pointer; transition: all .15s; }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Araç ızgarası ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; padding: 28px 0 20px; }
.tool-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 20px 20px; color: var(--text); position: relative;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); text-decoration: none; }
.tool-card .tile { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.tool-card .tile svg { width: 24px; height: 24px; }
.tool-card h3 { margin: 4px 0 0; font-size: 16.5px; font-weight: 700; letter-spacing: -.01em; }
.tool-card p { margin: 0; font-size: 13.5px; color: var(--text-2); line-height: 1.45; }
.tool-card .tag { position: absolute; top: 14px; right: 14px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; }
.tag.client { background: var(--success-soft); color: var(--success); }
.tag.star { background: var(--warn-soft); color: var(--warn); }

/* ---------- Özellik kartları ---------- */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 40px 0; }
.feature { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 24px; }
.feature .f-ic { width: 44px; height: 44px; border-radius: 11px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; margin-bottom: 14px; }
.feature .f-ic svg { width: 22px; height: 22px; }
.feature h3 { margin: 0 0 6px; font-size: 16.5px; }
.feature p { margin: 0; color: var(--text-2); font-size: 14px; }

/* ---------- SSS ---------- */
.faq { max-width: 760px; margin: 20px auto 60px; }
.faq h2 { text-align: center; font-size: 26px; letter-spacing: -.02em; }
.faq details { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; padding: 15px 0; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq summary::after { content: "+"; font-size: 20px; color: var(--text-3); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 16px; color: var(--text-2); font-size: 14.5px; }

.section-title { text-align: center; margin: 44px 0 6px; font-size: 27px; font-weight: 800; letter-spacing: -.02em; }
.section-sub { text-align: center; color: var(--text-2); margin: 0 0 6px; }

/* ---------- Araç sayfası ---------- */
.tool-hero { text-align: center; padding: 40px 0 8px; }
.tool-hero .tile { width: 60px; height: 60px; border-radius: 15px; display: inline-grid; place-items: center; margin-bottom: 14px; }
.tool-hero .tile svg { width: 30px; height: 30px; }
.tool-hero h1 { font-size: clamp(26px, 4vw, 36px); font-weight: 800; letter-spacing: -.025em; margin: 0 0 10px; }
.tool-hero p { color: var(--text-2); max-width: 620px; margin: 0 auto; font-size: 16px; }
.tool-wrap { max-width: 860px; margin: 26px auto 70px; padding: 0 20px; }
.tool-wrap.wide { max-width: 1080px; }

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--panel); padding: 52px 24px; text-align: center; cursor: pointer;
  transition: all .18s ease;
}
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: var(--primary-soft); }
.dropzone .dz-ic { width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 15px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }
.dropzone.drag .dz-ic { background: var(--primary); color: #fff; }
.dropzone .dz-ic svg { width: 28px; height: 28px; }
.dropzone h3 { margin: 0 0 6px; font-size: 18px; }
.dropzone p { margin: 0; color: var(--text-3); font-size: 14px; }
.dropzone .btn { margin-top: 16px; }

/* Panel / opsiyonlar */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-top: 16px; box-shadow: var(--shadow); }
.panel h3 { margin: 0 0 14px; font-size: 16px; }
.opt-row { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; margin-bottom: 12px; }
.opt-row:last-child { margin-bottom: 0; }
label.opt { display: flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--text-2); font-weight: 500; cursor: pointer; }
label.opt b { color: var(--text); font-weight: 600; }
input[type="text"], input[type="password"], input[type="number"], select, textarea {
  font: inherit; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 9px 12px; outline: none; min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
input[type="checkbox"], input[type="radio"] { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }
input[type="range"] { accent-color: var(--primary); }
textarea { width: 100%; resize: vertical; }

/* Radyo kart grubu */
.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.radio-card { border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 13px 14px; cursor: pointer; background: var(--panel-2); transition: all .14s; }
.radio-card:hover { border-color: var(--border-strong); }
.radio-card.selected { border-color: var(--primary); background: var(--primary-soft); }
.radio-card b { display: block; font-size: 14.5px; margin-bottom: 2px; }
.radio-card span { font-size: 12.5px; color: var(--text-2); }
.radio-card input { display: none; }

/* Butonlar */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; font-size: 15px; border-radius: 10px; cursor: pointer;
  padding: 12px 24px; border: 1px solid transparent; transition: all .15s;
  text-decoration: none !important;
}
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-strong); }
.btn.primary:disabled { opacity: .5; cursor: not-allowed; }
.btn.big { padding: 15px 34px; font-size: 16.5px; width: 100%; }
.btn.ghost { background: var(--panel); border-color: var(--border-strong); color: var(--text-2); }
.btn.ghost:hover { color: var(--text); border-color: var(--text-3); }
.btn.success { background: var(--success); color: #fff; }
.btn.success:hover { filter: brightness(1.08); }
.btn.sm { padding: 7px 14px; font-size: 13.5px; border-radius: 8px; }

/* Dosya listesi */
.file-list { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.file-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 14px;
}
.file-item .fi-ic { width: 36px; height: 36px; border-radius: 8px; background: var(--danger-soft); color: var(--danger); display: grid; place-items: center; flex: none; }
.file-item .fi-ic svg { width: 18px; height: 18px; }
.file-item .fi-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .fi-meta { font-size: 12.5px; color: var(--text-3); }
.file-item .fi-body { min-width: 0; flex: 1; }
.file-item .fi-x { margin-left: auto; width: 30px; height: 30px; flex: none; border: none; background: none; color: var(--text-3); cursor: pointer; border-radius: 7px; display: grid; place-items: center; }
.file-item .fi-x:hover { background: var(--danger-soft); color: var(--danger); }
.file-item .drag-handle { cursor: grab; color: var(--text-3); flex: none; }
.file-item.sortable-ghost { opacity: .4; }

/* İlerleme */
.progress-wrap { margin-top: 18px; }
.progress-label { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--text-2); font-weight: 600; margin-bottom: 7px; }
.progress-bar { height: 10px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; border: 1px solid var(--border); }
.progress-bar > div { height: 100%; width: 0%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), #7c3aed); transition: width .2s ease; }

/* Sonuç kartı */
.result-card { text-align: center; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 36px 26px; margin-top: 18px; box-shadow: var(--shadow); }
.result-card .ok-ic { width: 62px; height: 62px; margin: 0 auto 16px; border-radius: 50%; background: var(--success-soft); color: var(--success); display: grid; place-items: center; }
.result-card .ok-ic svg { width: 30px; height: 30px; }
.result-card h3 { margin: 0 0 6px; font-size: 20px; }
.result-card .r-meta { color: var(--text-2); font-size: 14.5px; margin-bottom: 20px; }
.result-card .r-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* Sayfa küçük resim ızgarası */
.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-top: 16px; }
.page-thumb {
  position: relative; background: var(--panel); border: 2px solid var(--border);
  border-radius: 10px; padding: 8px; cursor: pointer; text-align: center;
  transition: border-color .12s, transform .12s;
}
.page-thumb:hover { border-color: var(--border-strong); }
.page-thumb canvas, .page-thumb img { width: 100%; height: auto; border-radius: 5px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.12); display: block; transition: transform .18s; }
.page-thumb .pt-num { font-size: 12px; color: var(--text-3); font-weight: 600; margin-top: 6px; }
.page-thumb.selected { border-color: var(--primary); background: var(--primary-soft); }
.page-thumb.deleted { border-color: var(--danger); }
.page-thumb.deleted canvas { opacity: .3; filter: grayscale(1); }
.page-thumb.deleted::after { content: "✕"; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-60%); font-size: 34px; color: var(--danger); font-weight: 800; }
.page-thumb .pt-check { position: absolute; top: 7px; left: 7px; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; display: none; place-items: center; font-size: 13px; font-weight: 800; z-index: 2; }
.page-thumb.selected .pt-check { display: grid; }
.page-thumb .pt-tools { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; z-index: 2; }
.page-thumb:hover .pt-tools { opacity: 1; }
.page-thumb .pt-tools button { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--border); background: var(--panel); color: var(--text-2); cursor: pointer; display: grid; place-items: center; }
.page-thumb .pt-tools button:hover { color: var(--primary); border-color: var(--primary); }
.page-thumb .pt-tools button svg { width: 14px; height: 14px; }
.page-thumb.sortable-ghost { opacity: .35; }
.page-thumb.sortable-chosen { transform: scale(1.03); box-shadow: var(--shadow-lg); }

/* Bilgi kutuları */
.note { display: flex; gap: 10px; align-items: flex-start; border-radius: var(--radius-sm); padding: 13px 15px; font-size: 14px; margin-top: 14px; }
.note svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.note.info { background: var(--primary-soft); color: var(--text-2); }
.note.info svg { color: var(--primary); }
.note.warn { background: var(--warn-soft); color: var(--text-2); }
.note.warn svg { color: var(--warn); }

/* Toast */
#toast-box { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--text); color: var(--bg); padding: 12px 20px; border-radius: 10px; font-size: 14.5px; font-weight: 600; box-shadow: var(--shadow-lg); animation: toast-in .25s ease; max-width: 90vw; }
.toast.error { background: var(--danger); color: #fff; }
.toast.success { background: var(--success); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Kitap tarayıcı önizleme */
.book-preview { position: relative; margin: 0 auto; max-width: 100%; user-select: none; }
.book-preview canvas { display: block; width: 100%; border-radius: 8px; box-shadow: var(--shadow); }
.bp-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 12px; }
.bp-nav .bp-idx { font-size: 14px; color: var(--text-2); font-weight: 600; min-width: 110px; text-align: center; }
.slider-row { display: grid; grid-template-columns: 150px 1fr 64px; align-items: center; gap: 12px; margin-bottom: 10px; }
.slider-row label { font-size: 14px; font-weight: 600; color: var(--text-2); }
.slider-row output { font-size: 13px; color: var(--text-3); text-align: right; font-variant-numeric: tabular-nums; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--panel); margin-top: 40px; }
.site-footer .container { padding: 30px 20px; display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; }
.site-footer p { margin: 0; color: var(--text-3); font-size: 13.5px; }
.site-footer .f-links { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer .f-links a { color: var(--text-2); font-size: 13.5px; font-weight: 600; }

/* Küçük ekranlar */
@media (max-width: 640px) {
  .hero { padding: 40px 0 24px; }
  .tool-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 11px; }
  .tool-card { padding: 16px 14px; }
  .tool-card .tag { display: none; }
  .slider-row { grid-template-columns: 110px 1fr 52px; }
  .brand small { display: none; }
}

.hidden { display: none !important; }
