/* DevCalc Hub — Zero-CDN Developer Utility Stylesheet */
:root {
  --bg: #0b1020;
  --surface: #121933;
  --surface-2: #182244;
  --border: #26335e;
  --text: #e8edf8;
  --muted: #9aa7c7;
  --accent: #60a5fa;
  --accent-strong: #3b82f6;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --radius: 12px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

/* Header & Nav */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(11, 16, 32, 0.92);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  flex-wrap: wrap;
}

.brand {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.brand-badge {
  background: var(--accent-strong);
  color: #fff;
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 6px;
  font-family: var(--font-mono);
}

.nav-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 0.92rem;
}

.nav-links a { color: var(--muted); }
.nav-links a:hover, .nav-links a.active { color: var(--text); text-decoration: none; }

/* Breadcrumbs */
.breadcrumbs {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 18px 0 8px;
}
.breadcrumbs span { margin: 0 6px; }

/* Hero */
.hero {
  padding: 36px 0 24px;
}
.hero h1 {
  font-size: clamp(1.75rem, 3.2vw, 2.55rem);
  line-height: 1.2;
  margin: 0 0 12px;
  letter-spacing: -0.025em;
}
.hero p.lead {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 760px;
  margin: 0 0 16px;
}

.trust-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.pill {
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}

/* Tool Directory Grid */
.filter-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin: 18px 0 22px;
}
.search-input {
  flex: 1;
  min-width: 240px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
}
.cat-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
}
.cat-btn.active, .cat-btn:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #fff;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px;
  margin-bottom: 36px;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.tool-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.tool-card .cat-tag {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 6px;
}
.tool-card h2 {
  font-size: 1.12rem;
  margin: 0 0 8px;
  line-height: 1.35;
}
.tool-card p {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 14px;
}
.tool-card .card-link {
  font-weight: 600;
  font-size: 0.9rem;
}

/* Tool Workspace */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 22px;
}
.panel h2, .panel h3 {
  margin-top: 0;
  font-size: 1.15rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 5px;
  font-weight: 600;
}

.field input, .field select, .field textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.93rem;
  font-family: var(--font-sans);
}

.field textarea {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  min-height: 150px;
  resize: vertical;
}

.actions-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0 4px;
}

.btn {
  padding: 9px 15px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn-primary {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #fff;
}
.btn-primary:hover { filter: brightness(1.08); }

/* KPI Strip */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.kpi {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}
.kpi .kpi-label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.kpi .kpi-value {
  font-size: 1.45rem;
  font-weight: 800;
  font-family: var(--font-mono);
  margin-top: 4px;
  color: var(--text);
}
.kpi .kpi-sub {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
}

/* Tables & Code */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
th {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
tr.highlight-row { background: rgba(59, 130, 246, 0.14); }

pre.code-out {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.5;
  margin: 8px 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
}
.badge-critical, .badge-expired { background: rgba(248, 113, 113, 0.2); color: var(--red); }
.badge-high { background: rgba(251, 191, 36, 0.2); color: var(--amber); }
.badge-medium { background: rgba(96, 165, 250, 0.2); color: var(--accent); }
.badge-valid, .badge-ok { background: rgba(52, 211, 153, 0.2); color: var(--green); }

.alert-error {
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #fecaca;
  font-size: 0.9rem;
}

/* Progress Bar */
.bar-track {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  height: 10px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: var(--accent-strong);
}

/* AdSense Placeholder */
.ad-slot {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 22px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  background: rgba(18, 25, 51, 0.5);
}

/* Contextual CTA Banner */
.cta-card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.16), rgba(52, 211, 153, 0.10));
  border: 1px solid rgba(96, 165, 250, 0.45);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.cta-card h3 { margin: 0 0 6px; font-size: 1.08rem; }
.cta-card p { margin: 0; color: var(--muted); font-size: 0.9rem; max-width: 680px; }
.cta-btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 8px;
  background: var(--accent-strong);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}
.cta-btn:hover { text-decoration: none; filter: brightness(1.1); }

/* FAQ Section */
.faq-section { margin: 28px 0 36px; }
.faq-section h2 { font-size: 1.3rem; margin-bottom: 14px; }
details.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
details.faq-item summary {
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
details.faq-item p {
  color: var(--muted);
  margin: 10px 0 0;
  font-size: 0.93rem;
}

/* Related Tools */
.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 24px;
}
.related-links a {
  padding: 7px 12px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.86rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 40px;
  margin-top: 40px;
  color: var(--muted);
  font-size: 0.86rem;
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--green);
  color: #062118;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.86rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  z-index: 99;
}
