/* ToolPilot - Shared Stylesheet
   Design: Clean, fast, mobile-first, ad-ready
   Fonts: System stack (zero load time)
   Colors: Blue primary (trust), white/gray bg (clean) */

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --accent: #f59e0b;
  --text: #1e293b;
  --text-light: #64748b;
  --bg: #f8fafc;
  --white: #ffffff;
  --border: #e2e8f0;
  --success: #10b981;
  --error: #ef4444;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --max-width: 1200px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }

/* === HEADER / NAV === */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo span { color: var(--text); }
.logo svg { width: 28px; height: 28px; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: 0.3s;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 0.25rem;
}

.main-nav a {
  display: block;
  padding: 0.5rem 0.875rem;
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--primary);
  background: var(--primary-light);
}

/* === AD ZONES === */
.ad-zone {
  background: var(--white);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  color: var(--text-light);
  font-size: 0.8rem;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-zone-header {
  max-width: var(--max-width);
  margin: 0.75rem auto;
  padding: 0 1.5rem;
}

.ad-zone-content {
  margin: 1.5rem 0;
}

.ad-zone-sidebar {
  min-height: 250px;
}

/* === MAIN LAYOUT === */
.page-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
  width: 100%;
}

.tool-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: start;
}

.tool-main { min-width: 0; }

.tool-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* === HERO (Homepage) === */
.hero {
  text-align: center;
  padding: 3rem 1.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  color: white;
  border-radius: 16px;
  margin-bottom: 2.5rem;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.hero p {
  font-size: 1.15rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* === TOOL CARDS (Homepage Grid) === */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.tool-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.25s;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tool-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--primary);
}

.tool-card-icon {
  width: 48px;
  height: 48px;
  background: var(--primary-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.tool-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.tool-card p {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.5;
}

.tool-card .card-link {
  margin-top: auto;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.tool-card .card-link::after { content: ' →'; }

/* === TOOL PAGE COMMON === */
.tool-header {
  margin-bottom: 1.5rem;
}

.tool-header h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.tool-header p {
  color: var(--text-light);
  font-size: 1rem;
}

.tool-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.tool-box + .tool-box { margin-top: 1.25rem; }

.tool-box h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}

/* === FORMS & INPUTS === */
textarea,
input[type="text"],
input[type="number"],
input[type="date"],
select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}

textarea:focus,
input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

textarea {
  resize: vertical;
  min-height: 180px;
  line-height: 1.7;
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.375rem;
  color: var(--text);
}

.form-group { margin-bottom: 1rem; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover { background: var(--primary-dark); }

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

.btn-secondary:hover { background: var(--border); }

.btn-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* === RESULTS / STATS === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
}

.stat-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}

.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

.result-display {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1.25rem;
  font-size: 1rem;
  margin-top: 1rem;
}

.result-display .result-label {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.result-display .result-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

/* === OUTPUT BOX (Password gen, Lorem, etc) === */
.output-box {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.95rem;
  word-break: break-all;
  min-height: 50px;
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.375rem 0.75rem;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text-light);
  font-family: inherit;
  transition: all 0.2s;
}

.copy-btn:hover { color: var(--primary); border-color: var(--primary); }
.copy-btn.copied { color: var(--success); border-color: var(--success); }

/* === RANGE SLIDER === */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
}

/* === CHECKBOX / TOGGLE === */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* === SEO CONTENT SECTION (below tool) === */
.seo-content {
  margin-top: 2rem;
}

.seo-content h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
}

.seo-content h2:first-child { margin-top: 0; }

.seo-content p {
  color: var(--text-light);
  margin-bottom: 0.75rem;
  line-height: 1.7;
}

/* === INFO SIDEBAR BOXES === */
.info-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}

.info-box h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.info-box ul {
  list-style: none;
  padding: 0;
}

.info-box li {
  padding: 0.375rem 0;
  font-size: 0.9rem;
  color: var(--text-light);
  border-bottom: 1px solid var(--border);
}

.info-box li:last-child { border: none; }

.related-tools a {
  display: block;
  padding: 0.5rem 0;
  font-size: 0.9rem;
  color: var(--primary);
  border-bottom: 1px solid var(--border);
}

.related-tools a:last-child { border: none; }
.related-tools a:hover { color: var(--primary-dark); }

/* === FOOTER === */
.site-footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  margin-top: auto;
  padding: 2rem 1.5rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
}

.footer-brand p {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-top: 0.5rem;
}

.footer-col h4 {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.footer-col ul { list-style: none; }

.footer-col li { margin-bottom: 0.375rem; }

.footer-col a {
  font-size: 0.875rem;
  color: var(--text-light);
}

.footer-col a:hover { color: var(--primary); }

.footer-bottom {
  max-width: var(--max-width);
  margin: 1.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-light);
}

/* === BMI GAUGE === */
.bmi-gauge {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(to right, #3b82f6 0%, #10b981 25%, #f59e0b 55%, #ef4444 80%, #991b1b 100%);
  position: relative;
  margin: 1.5rem 0 0.5rem;
}

.bmi-marker {
  position: absolute;
  top: -6px;
  width: 24px;
  height: 24px;
  background: var(--text);
  border: 3px solid white;
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: var(--shadow);
  transition: left 0.5s ease;
}

.bmi-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 0.5rem;
}

/* === CATEGORY FILTER (Homepage) === */
.category-filter {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--white);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-light);
  font-family: inherit;
  transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .tool-layout {
    grid-template-columns: 1fr;
  }
  .tool-sidebar { order: 2; }
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .nav-toggle { display: block; }

  .main-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: 0.5rem;
  }

  .main-nav.open { display: block; }

  .main-nav ul {
    flex-direction: column;
  }

  .main-nav a {
    padding: 0.75rem 1rem;
  }

  .hero h1 { font-size: 1.75rem; }
  .hero { padding: 2rem 1rem; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr; }
  .page-wrapper { padding: 1.25rem 1rem; }
}

/* === UTILITY === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
