/* ============================================
   TOOLBOX PRO — Design System
   Aesthetic: Clean editorial utility-first
   Font: Syne (display) + DM Sans (body)
   Theme: Light with deep teal accent
============================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

/* ---------- Tokens ---------- */
:root {
  --bg:           #f4f3ef;
  --bg-card:      #ffffff;
  --bg-input:     #f9f8f5;
  --border:       #e4e2da;
  --border-focus: #0d9488;
  --text:         #1a1a1a;
  --text-2:       #5a5a5a;
  --text-3:       #9a9a9a;
  --accent:       #0d9488;
  --accent-dark:  #0a7a70;
  --accent-light: #e6f7f5;
  --accent-2:     #f59e0b;
  --danger:       #ef4444;
  --success:      #22c55e;
  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --radius-sm:    8px;
  --radius:       14px;
  --radius-lg:    22px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:       0 4px 16px rgba(0,0,0,.07), 0 1px 4px rgba(0,0,0,.05);
  --shadow-lg:    0 12px 40px rgba(0,0,0,.1), 0 4px 12px rgba(0,0,0,.06);
  --transition:   0.18s cubic-bezier(.4,0,.2,1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: var(--font-body); border: none; }
input, textarea, select { font-family: var(--font-body); }

/* ---------- Layout ---------- */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.container--narrow { max-width: 760px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--text);
  letter-spacing: -0.3px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--accent), #14b8a6);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 17px;
  flex-shrink: 0;
}
.logo-text em { color: var(--accent); font-style: normal; }

.nav-search {
  flex: 1; max-width: 340px;
  position: relative;
}
.nav-search input {
  width: 100%;
  padding: 8px 14px 8px 38px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  font-size: 14px;
  color: var(--text);
  transition: var(--transition);
  outline: none;
}
.nav-search input:focus { border-color: var(--accent); background: #fff; }
.nav-search input::placeholder { color: var(--text-3); }
.nav-search-icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); pointer-events: none;
}
.header-cta {
  background: var(--accent);
  color: #fff;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.header-cta:hover { background: var(--accent-dark); text-decoration: none; }

/* ---------- Ad Slots ---------- */
.ad-slot {
  background: var(--bg-input);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.ad-slot--leaderboard { height: 90px; margin: 16px 0; }
.ad-slot--inline      { height: 250px; margin: 28px 0; }
.ad-slot--banner      { height: 90px; margin: 24px 0 0; }

/* ---------- Hero ---------- */
.hero {
  padding: 56px 0 48px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; right: -100px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(13,148,136,.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 18px;
  letter-spacing: 0.4px;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1px;
  max-width: 600px;
  margin-bottom: 16px;
}
.hero h1 span { color: var(--accent); }
.hero-sub {
  font-size: 1.05rem;
  color: var(--text-2);
  max-width: 520px;
  margin-bottom: 28px;
  line-height: 1.65;
}
.hero-stats {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.hero-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}
.hero-stat span { font-size: 13px; color: var(--text-3); }

/* ---------- Category Pills ---------- */
.cats {
  padding: 8px 0 24px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.cat-pill:hover, .cat-pill.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ---------- Section Title ---------- */
.section-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 20px;
}
.section-title span { color: var(--accent); }

/* ---------- Tool Grid ---------- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  padding-bottom: 60px;
}

/* ---------- Tool Card ---------- */
.tool-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.tool-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(13,148,136,.04));
  opacity: 0;
  transition: var(--transition);
}
.tool-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  text-decoration: none;
}
.tool-card:hover::after { opacity: 1; }

.tool-card-icon {
  width: 44px; height: 44px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.tool-card-body { flex: 1; }
.tool-card-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
  line-height: 1.3;
}
.tool-card-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.45;
}
.tool-card-arrow {
  color: var(--text-3);
  font-size: 16px;
  transition: var(--transition);
  align-self: flex-end;
}
.tool-card:hover .tool-card-arrow {
  color: var(--accent);
  transform: translateX(3px);
}
.tool-card-badge {
  position: absolute;
  top: 12px; right: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 100px;
  background: var(--accent-light);
  color: var(--accent-dark);
}

/* Icon color families */
.ic-teal   { background: #e6f7f5; color: #0d9488; }
.ic-amber  { background: #fef9e7; color: #d97706; }
.ic-blue   { background: #eff6ff; color: #2563eb; }
.ic-violet { background: #f5f3ff; color: #7c3aed; }
.ic-rose   { background: #fff1f2; color: #e11d48; }
.ic-green  { background: #f0fdf4; color: #16a34a; }
.ic-orange { background: #fff7ed; color: #ea580c; }
.ic-slate  { background: #f8fafc; color: #475569; }

/* ---------- Tool Page Layout ---------- */
.tool-page { padding: 40px 0 64px; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 28px;
}
.breadcrumb a { color: var(--accent); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: var(--border); }

.tool-header { margin-bottom: 28px; }
.tool-header-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
}
.tool-header-icon {
  width: 54px; height: 54px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.tool-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.15;
}
.tool-header-desc {
  font-size: 1rem;
  color: var(--text-2);
  max-width: 600px;
  line-height: 1.6;
}

/* ---------- Tool Card/Panel ---------- */
.tool-panel {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.tool-panel + .tool-panel { margin-top: 16px; }

/* ---------- Form Controls ---------- */
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }

label.lbl {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
  letter-spacing: 0.1px;
}

.input, .textarea, .select {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  font-size: 14px;
  color: var(--text);
  transition: var(--transition);
  outline: none;
  appearance: none;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--border-focus);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(13,148,136,.12);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%239a9a9a' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

/* Range */
.range-wrap { display: flex; align-items: center; gap: 12px; }
.range {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  background: var(--border);
  border-radius: 100px;
  outline: none;
  cursor: pointer;
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(13,148,136,.4);
  transition: var(--transition);
}
.range::-webkit-slider-thumb:hover { transform: scale(1.15); }
.range-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  min-width: 36px;
  text-align: center;
  background: var(--accent-light);
  padding: 2px 8px;
  border-radius: 6px;
}

/* Checkbox */
.checkbox-group { display: flex; flex-wrap: wrap; gap: 10px 20px; }
.checkbox-item { display: flex; align-items: center; gap: 7px; cursor: pointer; font-size: 14px; }
.checkbox-item input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  white-space: nowrap;
}
.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(13,148,136,.3); }
.btn--primary:active { transform: translateY(0); }

.btn--secondary {
  background: var(--bg-input);
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn--secondary:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

.btn--ghost {
  background: transparent;
  color: var(--text-2);
  padding: 8px 12px;
}
.btn--ghost:hover { color: var(--accent); background: var(--accent-light); }

.btn--danger {
  background: #fff1f2;
  color: var(--danger);
  border: 1.5px solid #fecdd3;
}
.btn--danger:hover { background: var(--danger); color: #fff; }

.btn--sm { padding: 6px 14px; font-size: 13px; }
.btn--lg { padding: 13px 28px; font-size: 15px; }

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

/* ---------- Output Box ---------- */
.output-wrap {
  margin-top: 20px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.output-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.output-body {
  padding: 14px;
  font-size: 14px;
  line-height: 1.7;
  min-height: 60px;
  word-break: break-all;
  white-space: pre-wrap;
  color: var(--text);
  font-family: 'DM Mono', 'Fira Code', 'Consolas', monospace;
}
.output-body.plain { font-family: var(--font-body); }

/* ---------- Copy Button ---------- */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid rgba(13,148,136,.2);
  cursor: pointer;
  transition: var(--transition);
}
.copy-btn:hover { background: var(--accent); color: #fff; }
.copy-btn.copied { background: var(--success); color: #fff; border-color: transparent; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1a1a1a;
  color: #fff;
  padding: 10px 20px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  opacity: 0;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .3s;
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ---------- Stats Bar ---------- */
.stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 16px;
}
.stat-item { text-align: center; flex: 1; min-width: 80px; }
.stat-item strong { display: block; font-size: 1.3rem; font-weight: 700; color: var(--accent); letter-spacing: -0.5px; }
.stat-item span { font-size: 11px; color: var(--text-3); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }

/* ---------- Tag chips ---------- */
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-2);
  cursor: pointer;
  transition: var(--transition);
}
.tag-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

/* ---------- Color swatch ---------- */
.color-swatch {
  width: 100%;
  height: 100px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.color-swatch::after {
  content: 'Click to copy';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.25);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transition: var(--transition);
}
.color-swatch:hover::after { opacity: 1; }

/* ---------- QR Preview ---------- */
#qr-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #fff;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
}

/* ---------- Related Tools ---------- */
.related-section { margin-top: 48px; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.related-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
}
.related-card:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.related-card span { font-size: 18px; }

/* ---------- Footer ---------- */
.site-footer {
  background: #1a1a1a;
  color: #a0a0a0;
  padding: 40px 0 24px;
  margin-top: 64px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 32px;
  margin-bottom: 32px;
}
.footer-brand .logo { color: #fff; }
.footer-brand p {
  font-size: 13px;
  color: #6a6a6a;
  margin-top: 10px;
  line-height: 1.6;
  max-width: 240px;
}
.footer-col h4 {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: 0.3px;
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 7px; }
.footer-col ul li a {
  color: #6a6a6a;
  font-size: 13px;
  text-decoration: none;
  transition: var(--transition);
}
.footer-col ul li a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid #2a2a2a;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: #5a5a5a;
}

/* ---------- No Results ---------- */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
}
.no-results p { margin-top: 12px; font-size: 15px; }

/* ---------- Divider ---------- */
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ---------- Animations ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }

.fade-up { animation: fadeInUp .35s ease both; }

.tool-card { animation: fadeInUp .3s ease both; }
.tool-card:nth-child(2) { animation-delay: .03s; }
.tool-card:nth-child(3) { animation-delay: .06s; }
.tool-card:nth-child(4) { animation-delay: .09s; }
.tool-card:nth-child(5) { animation-delay: .12s; }
.tool-card:nth-child(6) { animation-delay: .15s; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .nav-search { max-width: none; flex: 1; }
  .header-cta { display: none; }
  .hero { padding: 36px 0 32px; }
  .hero-stats { gap: 16px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .tool-panel { padding: 20px; }
}
@media (max-width: 520px) {
  .tools-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .tool-header-top { flex-direction: column; align-items: flex-start; gap: 10px; }
  .container { padding: 0 14px; }
}
@media (max-width: 380px) {
  .tools-grid { grid-template-columns: 1fr; }
}
