/* RankAppear - Shared Stylesheet */
:root {
  --wa-green: #25D366;
  --wa-dark: #128C7E;
  --wa-teal: #075E54;
  --saffron: #FF9933;
  --ink: #1a1a1a;
  --muted: #5a6470;
  --line: #e6e9ee;
  --bg: #f7f8fa;
  --card: #ffffff;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.10);
  --radius: 12px;
  --radius-sm: 8px;
  --maxw: 1100px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

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

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}
.logo {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.1;
  text-decoration: none;
}
.logo:hover { text-decoration: none; }
.logo-name {
  font-weight: 800;
  font-size: 22px;
  color: var(--wa-teal);
  letter-spacing: -0.5px;
}
.logo-name .accent { color: var(--saffron); }
.logo-tag {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-top: 2px;
}
.nav-links {
  display: flex;
  gap: 22px;
  list-style: none;
  align-items: center;
}
.nav-links a {
  color: var(--ink);
  font-weight: 500;
  font-size: 15px;
}
.nav-links a:hover { color: var(--wa-dark); text-decoration: none; }

/* Hero */
.hero {
  padding: 60px 0 40px;
  text-align: center;
}
.hero h1 {
  font-size: 44px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 18px;
  color: var(--ink);
}
.hero h1 .accent { color: var(--wa-dark); }
.hero p.lead {
  font-size: 19px;
  color: var(--muted);
  max-width: 680px;
  margin: 0 auto 28px;
}
.hero-badges {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.badge {
  background: #fff;
  border: 1px solid var(--line);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.badge.green { background: #e8f8ee; color: var(--wa-dark); border-color: #c8edd5; }

/* Tool grid */
.section { padding: 48px 0; }
.section-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}
.section-sub { color: var(--muted); margin-bottom: 28px; font-size: 16px; }
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.tool-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  transition: all 0.18s ease;
  display: block;
  color: inherit;
}
.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--wa-green);
  text-decoration: none;
}
.tool-card .icon {
  font-size: 32px;
  margin-bottom: 12px;
  display: block;
}
.tool-card h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--ink);
  line-height: 1.3;
}
.tool-card p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}
.tool-card .meta {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tool-card .meta span {
  font-size: 11px;
  background: #f0f4f8;
  color: var(--muted);
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 500;
}

/* Tool page */
.tool-hero {
  padding: 40px 0 20px;
  text-align: center;
}
.tool-hero .tool-icon {
  font-size: 48px;
  margin-bottom: 14px;
}
.tool-hero h1 {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
  line-height: 1.2;
}
.tool-hero p.lead {
  font-size: 17px;
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto;
}

.tool-app {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  max-width: 720px;
  margin: 24px auto 0;
}
.tool-app .form-row {
  margin-bottom: 16px;
}
.tool-app label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.tool-app input[type="text"],
.tool-app input[type="number"],
.tool-app input[type="date"],
.tool-app input[type="time"],
.tool-app select,
.tool-app textarea {
  width: 100%;
  padding: 11px 14px;
  font-size: 15px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: inherit;
  background: #fff;
  transition: border-color 0.15s ease;
}
.tool-app input:focus,
.tool-app textarea:focus,
.tool-app select:focus {
  outline: none;
  border-color: var(--wa-green);
}
.tool-app textarea { min-height: 90px; resize: vertical; }
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 540px) {
  .form-grid-2 { grid-template-columns: 1fr; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
  text-decoration: none;
}
.btn-primary {
  background: var(--wa-dark);
  color: #fff;
  width: 100%;
  font-size: 16px;
  padding: 14px 22px;
}
.btn-primary:hover { background: var(--wa-teal); }
.btn-secondary {
  background: #f0f4f8;
  color: var(--ink);
}
.btn-secondary:hover { background: #e6ecf2; }
.btn-wa {
  background: var(--wa-green);
  color: #fff;
}
.btn-wa:hover { background: var(--wa-dark); }

/* Output */
.output-box {
  margin-top: 22px;
  background: #ecf6ed;
  border: 1.5px solid #c8edd5;
  border-radius: var(--radius-sm);
  padding: 18px;
  display: none;
}
.output-box.active { display: block; }
.output-box .output-text {
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-wrap;
  color: var(--ink);
  background: #fff;
  padding: 14px 16px;
  border-radius: 6px;
  border: 1px solid #d8ead9;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.output-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.output-actions .btn { flex: 1; min-width: 130px; }
.variations {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.variations button {
  background: #fff;
  border: 1.5px solid var(--line);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--muted);
  font-family: inherit;
}
.variations button.active {
  background: var(--wa-dark);
  color: #fff;
  border-color: var(--wa-dark);
}

/* Content sections */
.content-section {
  max-width: 720px;
  margin: 48px auto 0;
}
.content-section h2 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 14px;
  letter-spacing: -0.3px;
}
.content-section h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 24px 0 10px;
}
.content-section p { margin-bottom: 14px; color: #2a2f36; }
.content-section ul, .content-section ol {
  margin-bottom: 14px;
  padding-left: 22px;
  color: #2a2f36;
}
.content-section li { margin-bottom: 8px; }

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.step {
  background: #fff;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.step .num {
  display: inline-block;
  width: 28px;
  height: 28px;
  background: var(--wa-dark);
  color: #fff;
  border-radius: 50%;
  text-align: center;
  line-height: 28px;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 8px;
}
.step h4 { font-size: 15px; margin-bottom: 6px; font-weight: 700; }
.step p { font-size: 14px; color: var(--muted); margin: 0; }

.faq-item {
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-item h3 { font-size: 16px; margin-bottom: 8px; }
.faq-item p { font-size: 15px; color: #2a2f36; margin: 0; }

.related-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.related-tools .tool-card { padding: 18px; }
.related-tools .tool-card .icon { font-size: 26px; }
.related-tools .tool-card h3 { font-size: 15px; }

/* Footer */
.site-footer {
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 36px 0 28px;
  margin-top: 60px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 24px;
}
.footer-grid h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink);
}
.footer-grid ul { list-style: none; }
.footer-grid ul li { margin-bottom: 8px; }
.footer-grid ul a { color: var(--muted); font-size: 14px; }
.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
  .tool-hero h1 { font-size: 26px; }
  .section-title { font-size: 22px; }
  .tool-app { padding: 20px; }
}

/* AdSense ad slots */
.ad-slot {
  max-width: 720px;
  margin: 28px auto;
  min-height: 90px;
  text-align: center;
}
.ad-slot::before {
  content: "Advertisement";
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  opacity: 0.7;
}
.ad-slot ins {
  display: block;
  min-height: 90px;
  background: #fafbfc;
  border-radius: var(--radius-sm);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 100;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =========================================
   RESPONSIVE BREAKPOINTS
   - small mobile: <=480px
   - mobile:       <=600px
   - tablet:       601-900px
   - laptop:       901-1200px
   - desktop:      >1200px
   ========================================= */

/* Fluid typography for hero — scales smoothly across all sizes */
.hero h1 { font-size: clamp(26px, 5vw, 44px); line-height: 1.18; }
.tool-hero h1 { font-size: clamp(22px, 4vw, 34px); line-height: 1.22; }
.section-title { font-size: clamp(20px, 2.8vw, 28px); }

/* Prevent iOS auto-zoom on input focus (requires >=16px font-size) */
.tool-app input[type="text"],
.tool-app input[type="number"],
.tool-app input[type="date"],
.tool-app input[type="time"],
.tool-app input[type="email"],
.tool-app select,
.tool-app textarea {
  font-size: 16px;
}

/* Output text wraps long URLs/strings cleanly on narrow screens */
.output-box .output-text {
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Better touch targets: every button is at least 44x44 on touch devices */
@media (hover: none) and (pointer: coarse) {
  .btn, .variations button, .nav-links a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* === Tablet: 601-900px === */
@media (min-width: 601px) and (max-width: 900px) {
  .container { padding: 0 24px; }
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .related-tools { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 48px 0 32px; }
  .section { padding: 40px 0; }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; gap: 24px; }
}

/* === Mobile: <=600px === */
@media (max-width: 600px) {
  .container { padding: 0 16px; }

  /* Header: stack logo and nav vertically so neither gets cramped */
  .site-header .container {
    flex-direction: column;
    gap: 8px;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .logo-name { font-size: 20px; }
  .logo-tag { font-size: 10px; letter-spacing: 0.3px; }
  .nav-links {
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .nav-links a { font-size: 14px; }

  /* Hero */
  .hero { padding: 32px 0 20px; }
  .hero p.lead { font-size: 16px; padding: 0 4px; }
  .hero-badges { gap: 6px; margin-bottom: 14px; }
  .badge { font-size: 11px; padding: 4px 10px; }

  /* Sections */
  .section { padding: 28px 0; }
  .section-sub { font-size: 15px; }

  /* Tool grid */
  .tools-grid { gap: 12px; grid-template-columns: 1fr 1fr; }
  .tool-card { padding: 14px; }
  .tool-card .icon { font-size: 24px; margin-bottom: 6px; }
  .tool-card h3 { font-size: 14px; line-height: 1.25; }
  .tool-card p { font-size: 12px; line-height: 1.4; }
  .tool-card .meta { display: none; }

  /* Tool app form */
  .tool-hero { padding: 28px 0 14px; }
  .tool-hero .tool-icon { font-size: 40px; margin-bottom: 10px; }
  .tool-hero p.lead { font-size: 15px; padding: 0 8px; }
  .tool-app { padding: 16px; margin-top: 18px; }
  .tool-app .form-row { margin-bottom: 12px; }
  .tool-app label { font-size: 12px; }
  .variations { gap: 6px; }
  .variations button { font-size: 12px; padding: 6px 10px; }
  .btn-primary { padding: 12px 18px; font-size: 15px; }

  /* Output box */
  .output-box { padding: 14px; margin-top: 18px; }
  .output-box .output-text { padding: 12px; font-size: 14px; }
  .output-actions { flex-direction: column; gap: 8px; }
  .output-actions .btn { width: 100%; min-width: 0; padding: 12px; }

  /* Content / FAQ */
  .content-section { margin-top: 32px; }
  .content-section h2 { font-size: 19px; margin-bottom: 10px; }
  .content-section h3 { font-size: 15px; }
  .content-section p, .content-section li { font-size: 15px; }
  .faq-item { padding: 14px 0; }
  .faq-item h3 { font-size: 15px; }
  .faq-item p { font-size: 14px; }

  /* Steps grid: stack on mobile */
  .steps { grid-template-columns: 1fr; gap: 10px; }
  .step { padding: 14px; }

  /* Related tools: stack on mobile */
  .related-tools { grid-template-columns: 1fr; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
  .site-footer { padding: 28px 0 20px; margin-top: 40px; }
  .footer-bottom { font-size: 12px; line-height: 1.6; padding: 14px 0; }
}

/* === Small mobile: <=380px (older / budget Android) === */
@media (max-width: 380px) {
  .container { padding: 0 12px; }
  .tools-grid { grid-template-columns: 1fr; }
  .tool-card .meta { display: flex; }
  .hero-badges { display: none; }
  .nav-links { gap: 12px; }
  .nav-links a { font-size: 13px; }
}

/* === Laptop / large desktop: keep content readable, avoid stretching === */
@media (min-width: 1400px) {
  :root { --maxw: 1200px; }
  .hero { padding: 80px 0 56px; }
  .hero h1 { font-size: 52px; }
  .section { padding: 64px 0; }
}

/* Prevent horizontal overflow site-wide (guards against any wide content) */
html, body { overflow-x: hidden; }
img, table, pre, .output-text { max-width: 100%; }
