/* ============================================================
   ToolDesk — shared design system
   ============================================================ */
:root {
  --bg: #0a0e1a;
  --bg-soft: #0e1424;
  --card: rgba(255, 255, 255, 0.04);
  --card-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e8ecf4;
  --muted: #97a2ba;
  --accent-1: #6366f1;
  --accent-2: #22d3ee;
  --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #22d3ee 100%);
  --success: #34d399;
  --danger: #f87171;
  --radius: 16px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Ambient background glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 15% -10%, rgba(99, 102, 241, 0.18), transparent 60%),
    radial-gradient(ellipse 50% 40% at 90% 0%, rgba(34, 211, 238, 0.12), transparent 60%),
    radial-gradient(ellipse 60% 50% at 50% 110%, rgba(139, 92, 246, 0.10), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

body > * { position: relative; z-index: 1; }

::selection { background: rgba(99, 102, 241, 0.4); }

/* ---------- Nav ---------- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1140px;
  margin: 0 auto;
  padding: 22px 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--gradient);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1rem;
  box-shadow: 0 6px 18px -6px rgba(99, 102, 241, 0.7);
}

.logo span.grad {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-back {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 99px;
  transition: all 0.2s;
}

.nav-back:hover { color: var(--text); border-color: var(--border-strong); background: var(--card); }

/* ---------- Hero (landing) ---------- */
.hero {
  max-width: 860px;
  margin: 0 auto;
  padding: 64px 24px 40px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-2);
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.25);
  padding: 6px 14px;
  border-radius: 99px;
  margin-bottom: 24px;
}

.hero-badge .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.12;
  margin-bottom: 18px;
}

.hero h1 .grad {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto;
}

/* ---------- Tool grid ---------- */
.section {
  max-width: 1140px;
  margin: 0 auto;
  padding: 24px 24px 8px;
}

.section-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 26px 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.card:hover {
  transform: translateY(-4px);
  background: var(--card-hover);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.card h3 { font-size: 1.02rem; font-weight: 700; letter-spacing: -0.01em; }

.card p { font-size: 0.88rem; color: var(--muted); line-height: 1.5; }

.tool-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.tool-icon svg { width: 22px; height: 22px; stroke: #fff; }

.ti-violet  { background: linear-gradient(135deg, #6366f1, #8b5cf6); box-shadow: 0 8px 20px -8px rgba(124, 92, 246, .7); }
.ti-cyan    { background: linear-gradient(135deg, #06b6d4, #22d3ee); box-shadow: 0 8px 20px -8px rgba(34, 211, 238, .7); }
.ti-pink    { background: linear-gradient(135deg, #ec4899, #f472b6); box-shadow: 0 8px 20px -8px rgba(236, 72, 153, .7); }
.ti-amber   { background: linear-gradient(135deg, #f59e0b, #fbbf24); box-shadow: 0 8px 20px -8px rgba(245, 158, 11, .7); }
.ti-emerald { background: linear-gradient(135deg, #10b981, #34d399); box-shadow: 0 8px 20px -8px rgba(16, 185, 129, .7); }
.ti-rose    { background: linear-gradient(135deg, #e11d48, #fb7185); box-shadow: 0 8px 20px -8px rgba(225, 29, 72, .7); }
.ti-blue    { background: linear-gradient(135deg, #2563eb, #60a5fa); box-shadow: 0 8px 20px -8px rgba(37, 99, 235, .7); }
.ti-teal    { background: linear-gradient(135deg, #0d9488, #2dd4bf); box-shadow: 0 8px 20px -8px rgba(13, 148, 136, .7); }
.ti-orange  { background: linear-gradient(135deg, #ea580c, #fb923c); box-shadow: 0 8px 20px -8px rgba(234, 88, 12, .7); }
.ti-indigo  { background: linear-gradient(135deg, #4f46e5, #818cf8); box-shadow: 0 8px 20px -8px rgba(79, 70, 229, .7); }

/* ---------- Tool page layout ---------- */
.tool-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}

.tool-head { text-align: center; margin-bottom: 30px; }

.tool-head .tool-icon { margin: 0 auto 18px; width: 58px; height: 58px; border-radius: 17px; }
.tool-head .tool-icon svg { width: 28px; height: 28px; }

.tool-head h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.tool-head p { color: var(--muted); max-width: 480px; margin: 0 auto; font-size: 0.98rem; }

/* ---------- Dropzone ---------- */
.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  background: var(--card);
  transition: all 0.2s;
  margin-bottom: 22px;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent-1);
  background: rgba(99, 102, 241, 0.07);
}

.dropzone .dz-icon {
  width: 52px; height: 52px;
  margin: 0 auto 14px;
  border-radius: 15px;
  background: rgba(99, 102, 241, 0.12);
  display: grid;
  place-items: center;
}

.dropzone .dz-icon svg { width: 24px; height: 24px; stroke: var(--accent-1); }

.dropzone strong { display: block; font-size: 1.05rem; margin-bottom: 4px; }

.dropzone span { color: var(--muted); font-size: 0.88rem; }

.dropzone input[type="file"] { display: none; }

/* ---------- Controls / panels ---------- */
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 22px;
}

.panel h2 { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 16px; }

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}

.field { display: flex; flex-direction: column; gap: 7px; min-width: 130px; flex: 1; }

.field label { font-size: 0.82rem; font-weight: 600; color: var(--muted); }

.field input[type="text"],
.field input[type="number"],
.field select,
textarea {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 13px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.field input:focus, .field select:focus, textarea:focus { border-color: var(--accent-1); }

.field select { cursor: pointer; }

input[type="color"] {
  width: 100%;
  height: 41px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-soft);
  cursor: pointer;
  padding: 4px;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--gradient);
  border: 2px solid #fff;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.6);
  cursor: grab;
}

input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent-1);
  border: 2px solid #fff;
  cursor: grab;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.checkbox-field input { width: 17px; height: 17px; accent-color: var(--accent-1); cursor: pointer; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 11px;
  font-size: 0.94rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--text);
  transition: all 0.2s;
  text-decoration: none;
}

.btn:hover { background: var(--card-hover); border-color: rgba(255,255,255,0.28); }

.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--gradient);
  border: none;
  color: #fff;
  box-shadow: 0 8px 22px -8px rgba(99, 102, 241, 0.8);
}

.btn-primary:hover:not(:disabled) { filter: brightness(1.12); box-shadow: 0 10px 26px -8px rgba(99, 102, 241, 1); background: var(--gradient); }

.btn-sm { padding: 7px 14px; font-size: 0.85rem; border-radius: 9px; }

.btn-danger { color: var(--danger); border-color: rgba(248, 113, 113, 0.3); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.5); }

.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }

/* ---------- Results ---------- */
.results { display: flex; flex-direction: column; gap: 10px; }

.result-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 13px 16px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-thumb {
  width: 46px; height: 46px;
  border-radius: 9px;
  object-fit: cover;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.result-info { flex: 1; min-width: 0; }

.result-name {
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-meta { font-size: 0.8rem; color: var(--muted); }

.result-meta .saved { color: var(--success); font-weight: 600; }
.result-meta .grew { color: var(--danger); font-weight: 600; }

.file-badge {
  width: 46px; height: 46px;
  border-radius: 9px;
  background: rgba(99, 102, 241, 0.12);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--accent-1);
  letter-spacing: 0.04em;
}

/* ---------- Status / progress ---------- */
.status { font-size: 0.9rem; color: var(--muted); margin-bottom: 16px; min-height: 1.4em; }
.status.error { color: var(--danger); }
.status.success { color: var(--success); }

.progress-track {
  height: 8px;
  border-radius: 99px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 18px;
  display: none;
}

.progress-track.active { display: block; }

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: var(--gradient);
  transition: width 0.25s ease;
}

.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- JSON / code output ---------- */
.code-area {
  width: 100%;
  min-height: 300px;
  font-family: var(--mono);
  font-size: 0.87rem;
  line-height: 1.55;
  resize: vertical;
  tab-size: 2;
}

.code-output {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  font-family: var(--mono);
  font-size: 0.87rem;
  line-height: 1.55;
  overflow: auto;
  max-height: 480px;
  min-height: 300px;
  white-space: pre;
}

.j-key { color: #93c5fd; }
.j-str { color: #86efac; }
.j-num { color: #fbbf24; }
.j-bool { color: #f472b6; }
.j-null { color: #94a3b8; font-style: italic; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }

/* ---------- QR preview ---------- */
.qr-preview {
  display: grid;
  place-items: center;
  padding: 26px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 22px;
}

.qr-preview canvas {
  border-radius: 12px;
  max-width: 100%;
  height: auto !important;
  box-shadow: 0 12px 40px -12px rgba(0, 0, 0, 0.7);
}

/* ---------- Merge list ---------- */
.merge-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }

.merge-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 14px;
}

.merge-item .order {
  width: 26px; height: 26px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-1);
  font-size: 0.8rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.merge-item .name { flex: 1; font-size: 0.9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.merge-item .size { font-size: 0.8rem; color: var(--muted); }

.icon-btn {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
  display: grid;
  place-items: center;
  transition: all 0.15s;
}

.icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--card-hover); }
.icon-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.icon-btn.remove:hover { color: var(--danger); border-color: rgba(248, 113, 113, 0.4); }

/* ---------- Info strip ---------- */
.privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 34px;
  text-align: center;
}

.privacy-note svg { width: 15px; height: 15px; stroke: var(--success); flex-shrink: 0; }

/* ---------- Footer ---------- */
footer {
  max-width: 1140px;
  margin: 60px auto 0;
  padding: 28px 24px 40px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }

.footer-links a { color: var(--muted); text-decoration: none; transition: color 0.2s; }

.footer-links a:hover { color: var(--text); }

/* ---------- Ad slots (reserved) ----------
   Hidden until AdSense is live. To enable: paste the ad unit code
   inside each .ad-slot and change `display: none` to `display: block`. */
.ad-slot {
  display: none;
  min-height: 100px;
  margin: 34px 0;
  border-radius: var(--radius);
  overflow: hidden;
}

/* ---------- Content / FAQ sections (tool pages + info pages) ---------- */
.content-section {
  margin-top: 56px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.content-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 34px 0 12px;
}

.content-section h3 { font-size: 1.02rem; font-weight: 700; margin: 22px 0 8px; }

.content-section p, .content-section li {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.content-section p { margin-bottom: 12px; }

.content-section a { color: var(--accent-2); text-decoration: none; }
.content-section a:hover { text-decoration: underline; }

.content-section ul, .content-section ol { padding-left: 22px; margin-bottom: 12px; }

.content-section li { margin-bottom: 6px; }

.content-section li strong, .content-section p strong { color: var(--text); font-weight: 600; }

/* Numbered how-to steps */
.steps { list-style: none; padding-left: 0 !important; counter-reset: step; }

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 40px;
  margin-bottom: 10px;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 26px; height: 26px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-1);
  font-size: 0.8rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

/* FAQ accordions */
.faq details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 13px;
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.faq details[open] { border-color: var(--border-strong); }

.faq summary {
  cursor: pointer;
  padding: 15px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  position: relative;
  padding-right: 40px;
  user-select: none;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1.15rem;
  font-weight: 500;
  transition: transform 0.2s;
}

.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }

.faq details p {
  padding: 0 18px 15px;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

/* ---------- Info pages (privacy, terms, about, contact) ---------- */
.page-main .content-section:first-of-type { margin-top: 0; border-top: none; }

.page-updated { font-size: 0.82rem; color: var(--muted); margin-bottom: 26px; }

@media (max-width: 560px) {
  .hero { padding-top: 40px; }
  .dropzone { padding: 36px 16px; }
  footer { justify-content: center; text-align: center; }
  .footer-links { justify-content: center; }
}
