/* ============================================================
   InstantToolsPro — Main Stylesheet
   Design: Clean SaaS / iLovePDF-inspired minimal professional
   ============================================================ */

/* ── Google Fonts loaded via PHP head ── */

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

:root {
  /* Brand */
  --accent:       #1a56db;
  --accent-dark:  #1341b5;
  --accent-lt:    #eff4ff;
  --accent-bdr:   #c0d4fb;

  /* Category colours */
  --pdf:     #dc2626; --pdf-lt:  #fef2f2; --pdf-bdr:  #fecaca;
  --img:     #7c3aed; --img-lt:  #f5f3ff; --img-bdr:  #ddd6fe;
  --fin:     #047857; --fin-lt:  #ecfdf5; --fin-bdr:  #a7f3d0;
  --utl:     #b45309; --utl-lt:  #fffbeb; --utl-bdr:  #fcd34d;

  /* Neutrals */
  --bg:      #f5f7fc;
  --surface: #ffffff;
  --border:  #e5e9f5;
  --text:    #111827;
  --muted:   #6b7280;
  --subtle:  #9ca3af;

  /* Tokens */
  --radius-sm:  8px;
  --radius:     12px;
  --radius-lg:  18px;
  --shadow-sm:  0 1px 4px rgba(0,0,0,.06);
  --shadow:     0 2px 12px rgba(0,0,0,.08);
  --shadow-lg:  0 8px 30px rgba(0,0,0,.12);
  --transition: .2s ease;

  /* Typography */
  --font-head: 'Sora', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
}

html { scroll-behavior: smooth; }

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

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ── Layout ─────────────────────────────── */
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ══════════════════════════════════════════
   HEADER
══════════════════════════════════════════ */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
  height: 64px;
}
.header-inner {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.site-logo {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -.02em;
  white-space: nowrap;
  flex-shrink: 0;
}
.site-logo span { color: var(--text); }

.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}
.main-nav a {
  font-size: .875rem;
  font-weight: 500;
  color: var(--muted);
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}
.main-nav a:hover,
.main-nav a.active { color: var(--accent); background: var(--accent-lt); }

.header-badge {
  margin-left: auto;
  font-size: .78rem;
  font-weight: 600;
  color: var(--fin);
  background: var(--fin-lt);
  border: 1px solid var(--fin-bdr);
  padding: 5px 14px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Hamburger */
.ham-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
  margin-left: auto;
}
.ham-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}
.ham-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.ham-btn.open span:nth-child(2) { opacity: 0; }
.ham-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav */
.mobile-nav {
  display: none;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px 18px;
  flex-direction: column;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  font-size: .95rem;
  font-weight: 500;
  color: var(--text);
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.mobile-nav a:last-of-type { border-bottom: none; }
.mobile-nav .header-badge { margin-top: 14px; width: fit-content; }

/* ══════════════════════════════════════════
   HERO
══════════════════════════════════════════ */
.hero {
  background: linear-gradient(150deg, #eef3ff 0%, #f9fafb 55%, #edfdf4 100%);
  border-bottom: 1px solid var(--border);
  padding: 88px 20px 96px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
/* Decorative circles */
.hero::before,
.hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.hero::before {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(26,86,219,.07) 0%, transparent 70%);
  top: -150px; left: -150px;
}
.hero::after {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(4,120,87,.06) 0%, transparent 70%);
  bottom: -120px; right: -80px;
}
.hero-inner { position: relative; z-index: 1; }

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-lt);
  border: 1px solid var(--accent-bdr);
  padding: 5px 16px;
  border-radius: 99px;
  margin-bottom: 26px;
}
.hero-pill-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .5; transform: scale(1.3); }
}

.hero h1 {
  font-family: var(--font-head);
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.03em;
  color: var(--text);
  max-width: 740px;
  margin: 0 auto 18px;
}
.hero h1 .hl {
  color: var(--accent);
  position: relative;
}
.hero-sub {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  color: var(--muted);
  max-width: 530px;
  margin: 0 auto 10px;
}
.hero-note {
  font-size: .875rem;
  font-weight: 600;
  color: var(--fin);
  margin-bottom: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.hero-note svg { flex-shrink: 0; }

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 600;
  padding: 13px 26px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px rgba(26,86,219,.3);
}
.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26,86,219,.35);
}
.btn-outline {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ══════════════════════════════════════════
   STATS BAR
══════════════════════════════════════════ */
.stats-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.stats-inner {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}
.stat-item {
  padding: 18px 36px;
  text-align: center;
  border-right: 1px solid var(--border);
}
.stat-item:last-child { border-right: none; }
.stat-num {
  font-family: var(--font-head);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -.02em;
  line-height: 1;
  margin-bottom: 3px;
}
.stat-lbl {
  font-size: .78rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

/* ══════════════════════════════════════════
   TOOLS WRAPPER
══════════════════════════════════════════ */
.tools-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 64px 20px 80px;
}

/* ── Section ─────────────────────────────── */
.tool-section { margin-bottom: 68px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.section-label {
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-icon-wrap {
  width: 42px; height: 42px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.si-pdf { background: var(--pdf-lt); border: 1px solid var(--pdf-bdr); }
.si-img { background: var(--img-lt); border: 1px solid var(--img-bdr); }
.si-fin { background: var(--fin-lt); border: 1px solid var(--fin-bdr); }
.si-utl { background: var(--utl-lt); border: 1px solid var(--utl-bdr); }

.section-head h2 {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.015em;
}

.view-all-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .83rem;
  font-weight: 600;
  color: var(--accent);
  padding: 6px 13px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.view-all-link:hover { background: var(--accent-lt); }

/* ── Tool Grid ───────────────────────────── */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* ── Tool Card ───────────────────────────── */
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  text-decoration: none;
  color: inherit;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  box-shadow: var(--shadow-sm);
}
.tool-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.card-icon {
  width: 46px; height: 46px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ci-pdf { background: var(--pdf-lt); }
.ci-img { background: var(--img-lt); }
.ci-fin { background: var(--fin-lt); }
.ci-utl { background: var(--utl-lt); }

.card-info { flex: 1; }
.card-info h3 {
  font-size: .92rem;
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.3;
}
.card-info p {
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.45;
}
.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .8rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .01em;
  margin-top: 2px;
}
.card-cta svg { transition: transform var(--transition); }
.tool-card:hover .card-cta svg { transform: translateX(4px); }

/* ══════════════════════════════════════════
   SEO SECTION
══════════════════════════════════════════ */
.seo-section {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 48px 20px;
}
.seo-section .container { max-width: 820px; }
.seo-section h2 {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}
.seo-section p {
  font-size: .88rem;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 12px;
}
.seo-section p:last-child { margin-bottom: 0; }

/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 56px 20px 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 44px;
  padding-bottom: 40px;
  border-bottom: 1px solid #1e2d45;
  margin-bottom: 28px;
}
.footer-brand .site-logo { color: #e2e8f0; font-size: 1.05rem; }
.footer-brand .site-logo span { color: #60a5fa; }
.footer-brand p {
  font-size: .84rem;
  line-height: 1.7;
  margin-top: 10px;
}
.footer-col h4 {
  font-family: var(--font-head);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #e2e8f0;
  margin-bottom: 16px;
}
.footer-col a {
  display: block;
  font-size: .84rem;
  color: #94a3b8;
  margin-bottom: 10px;
  transition: color var(--transition);
}
.footer-col a:hover { color: #fff; }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: .8rem;
}
.footer-bottom a { color: #94a3b8; transition: color var(--transition); }
.footer-bottom a:hover { color: #fff; }
.footer-links { display: flex; gap: 20px; }

/* ══════════════════════════════════════════
   CATEGORY PAGE HERO
══════════════════════════════════════════ */
.cat-hero {
  padding: 56px 20px 60px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.cat-hero.pdf { background: linear-gradient(135deg, #fff5f5 0%, #f9fafb 70%); }
.cat-hero.img { background: linear-gradient(135deg, #f5f3ff 0%, #f9fafb 70%); }
.cat-hero.fin { background: linear-gradient(135deg, #ecfdf5 0%, #f9fafb 70%); }
.cat-hero.utl { background: linear-gradient(135deg, #fffbeb 0%, #f9fafb 70%); }

.cat-icon-lg {
  width: 68px; height: 68px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.cat-hero.pdf .cat-icon-lg { background: var(--pdf-lt); border: 2px solid var(--pdf-bdr); }
.cat-hero.img .cat-icon-lg { background: var(--img-lt); border: 2px solid var(--img-bdr); }
.cat-hero.fin .cat-icon-lg { background: var(--fin-lt); border: 2px solid var(--fin-bdr); }
.cat-hero.utl .cat-icon-lg { background: var(--utl-lt); border: 2px solid var(--utl-bdr); }

.cat-hero h1 {
  font-family: var(--font-head);
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -.025em;
  margin-bottom: 10px;
}
.cat-hero p {
  font-size: 1rem;
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto;
}

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 1024px) {
  .tool-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
  .stat-item { padding: 16px 24px; }
}

@media (max-width: 768px) {
  .main-nav, .header-badge { display: none; }
  .ham-btn { display: flex; }

  .hero { padding: 56px 20px 64px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { justify-content: center; }

  .tool-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

  .stat-item { padding: 14px 18px; }
  .stat-num { font-size: 1.2rem; }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }
}

@media (max-width: 480px) {
  .tool-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tool-card { padding: 16px 14px 14px; }
  .stat-item { padding: 12px 14px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { font-size: .75rem; }
}

/* ── Fade-in animation on load ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp .5s ease forwards; }
.fade-up-2 { animation: fadeUp .5s .1s ease both; }
.fade-up-3 { animation: fadeUp .5s .2s ease both; }
.fade-up-4 { animation: fadeUp .5s .3s ease both; }
