/* ── WATT Design System ─────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  --font-head: 'Inter', sans-serif;
  --font-body: 'DM Sans', 'Inter', sans-serif;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-light: #eff6ff;
  --green: #16a34a;
  --bg: #f8f9fb;
  --surface: #ffffff;
  --surface2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text2: #475569;
  --text3: #94a3b8;
  --radius: 10px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --transition: .15s ease;
}

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

html { scroll-behavior: smooth; }

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

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

/* ── Header ─────────────────────────────────────────────────── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  height: 56px;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
}
.logo {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -.03em;
  text-decoration: none;
  flex-shrink: 0;
}
.logo span { color: var(--accent); }
.header-search {
  flex: 1;
  max-width: 400px;
  position: relative;
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
}
.search-input:focus { border-color: var(--accent); background: #fff; }
.header-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
  font-size: 14px;
  font-weight: 500;
}
.header-nav a { color: var(--text2); text-decoration: none; }
.header-nav a:hover { color: var(--accent); }
.btn-pro {
  padding: 7px 16px;
  background: var(--accent);
  color: #fff !important;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none !important;
  transition: background var(--transition);
}
.btn-pro:hover { background: var(--accent-dark) !important; }

/* ── Ad Placeholder ─────────────────────────────────────────── */
.ad-slot {
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-family: var(--font-body);
}
.ad-slot-leaderboard {
  width: 100%;
  height: 90px;
  max-width: 728px;
  margin: 0 auto;
}
.ad-slot-banner {
  width: 100%;
  height: 90px;
}
.ad-slot-sidebar {
  width: 300px;
  height: 250px;
}
.ad-slot-inline {
  width: 100%;
  height: 90px;
  margin: 24px 0;
}

/* ── Category Grid (homepage) ───────────────────────────────── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}
.cat-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 20px 24px;
  text-align: center;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: all .2s;
  cursor: pointer;
}
.cat-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(37,99,235,.1);
  text-decoration: none;
}
.cat-card .cat-icon { font-size: 40px; line-height: 1; }
.cat-card .cat-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-head);
}
.cat-card .cat-count {
  font-size: 12px;
  color: var(--text3);
  font-weight: 500;
}

/* ── Tool Grid (category pages) ────────────────────────────── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}
.tool-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  text-decoration: none;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: all .15s;
  position: relative;
}
.tool-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37,99,235,.08);
  text-decoration: none;
}
.tool-card .tc-icon { font-size: 26px; flex-shrink: 0; line-height: 1; margin-top: 1px; }
.tool-card .tc-name { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 3px; line-height: 1.3; }
.tool-card .tc-desc { font-size: 12px; color: var(--text3); line-height: 1.4; }
.tc-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: .03em;
}
.tc-badge.free { background: #f0fdf4; color: #15803d; }
.tc-badge.new { background: var(--accent-light); color: var(--accent); }

/* ── Tool Page ──────────────────────────────────────────────── */
.tool-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}
.tool-page-header { margin-bottom: 28px; }
.tool-page-header h1 {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -.02em;
}
.tool-page-header p { font-size: 15px; color: var(--text2); line-height: 1.6; }

/* ── Category Page Layout ───────────────────────────────────── */
.cat-page { max-width: 1100px; margin: 0 auto; padding: 32px 20px 60px; }
.cat-page-header { margin-bottom: 32px; }
.cat-page-header h1 {
  font-family: var(--font-head);
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -.02em;
}
.cat-page-header p { font-size: 16px; color: var(--text2); line-height: 1.6; }

/* ── Pro Banner (PDF pages only) ────────────────────────────── */
.pro-banner {
  background: linear-gradient(135deg, #1e40af, #2563eb);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.pro-banner .pb-text { color: #fff; }
.pro-banner .pb-title { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.pro-banner .pb-sub { font-size: 13px; opacity: .8; }
.pro-banner a {
  padding: 10px 22px;
  background: #fff;
  color: var(--accent);
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity .15s;
}
.pro-banner a:hover { opacity: .9; }

/* ── Footer ─────────────────────────────────────────────────── */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: var(--text3);
}
.footer-bottom a { color: var(--text3); }
.footer-bottom a:hover { color: var(--accent); }

/* ── Toast ──────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e293b;
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: all .25s;
  pointer-events: none;
  z-index: 9000;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Misc utilities ─────────────────────────────────────────── */
.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text3);
  margin-bottom: 14px;
  margin-top: 32px;
}
.section-label:first-child { margin-top: 0; }

@media (max-width: 600px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cat-card { padding: 20px 12px 18px; }
  .cat-card .cat-icon { font-size: 32px; }
  .cat-card .cat-name { font-size: 14px; }
  .header-search { display: none; }
}
