/* 
  Calctoolkits — Pixel-Perfect iLovePDF Design Clone
  Font: Inter (closest free match to Graphik)
  Header: 60px fixed
  Background: #f5f6fa flat
  Cards: 5-col grid, 16px radius, 1px #e8e8e8 border
*/
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

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

:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --bg: #f5f6fa;
  --white: #ffffff;
  --black: #1d1d1f;
  --gray-900: #222222;
  --gray-700: #444444;
  --gray-600: #666666;
  --gray-500: #888888;
  --gray-400: #aaabac;
  --gray-300: #d5d5d5;
  --gray-200: #e8e8e8;
  --gray-100: #f0f0f0;
  --accent: #e5322d;
  --accent-hover: #c9201b;
  --radius-card: 16px;
  --radius-pill: 100px;
  --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.08);
  --transition: all 0.2s ease;
  --container: 1700px;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: var(--font);
  background: #f5f5fa;
  color: #47474f;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
  line-height: 1.3;
  font-size: 16px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
}

ul,
ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ===== CONTAINER ===== */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== NAVBAR — 60px, fixed, white ===== */
.header {
  width: 100%;
  height: 60px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
}

.header nav {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 0;
}

/* Brand Logo */
.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  margin-right: 28px;
  margin-left: 0;
  padding-left: 0;
  flex-shrink: 0;
}

.brand-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  margin-right: 10px;
  border-radius: 50%;
  display: inline-block;
  vertical-align: middle;
}

.brand-icon {
  font-size: 24px;
  margin-right: 6px;
  line-height: 1;
}

.brand-text {
  font-size: 22px;
  font-weight: 800;
  color: var(--black);
  letter-spacing: -0.5px;
  line-height: 1;
}

/* Nav Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0;
}

.nav-link-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 12px;
  height: 60px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-900);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transition: var(--transition);
  white-space: nowrap;
  border: none;
  background: none;
  cursor: pointer;
  text-decoration: none;
}

.nav-link:hover {
  color: var(--accent);
}

.nav-link .chevron {
  font-size: 8px;
  margin-left: 2px;
  opacity: 0.6;
}

/* ===== MEGAMENU (iLovePDF Style) ===== */
.nav-link-item.megamenu-item {
  position: static;
}

.megamenu-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100vw - 48px);
  max-width: 1200px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
  padding: 24px 28px;
  display: none;
  z-index: 1001;
  margin-top: 2px;
}

.megamenu-arrow {
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: var(--white);
  border-left: 1px solid var(--gray-200);
  border-top: 1px solid var(--gray-200);
  z-index: 1002;
}

.nav-link-item:hover .megamenu-dropdown {
  display: block;
  animation: fadeInDown 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.megamenu-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.megamenu-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.megamenu-col-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  padding: 0 10px;
}

/* Fallback / Single Dropdown */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 260px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
  padding: 8px;
  display: none;
  flex-direction: column;
  z-index: 1001;
}

.nav-link-item:hover .dropdown-menu {
  display: flex;
  animation: fadeInDown 0.15s ease-out;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gray-700);
  border-radius: 8px;
  transition: var(--transition);
  text-decoration: none;
}

.dropdown-item:hover {
  background: #f5f6fa;
  color: var(--black);
  transform: translateX(2px);
}

.dropdown-item .dropdown-icon {
  font-size: 17px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

@media (max-width: 991px) {
  .megamenu-dropdown {
    position: static;
    transform: none;
    width: 100%;
    max-width: 100%;
    box-shadow: none;
    border: none;
    padding: 12px 0;
    margin-top: 0;
    display: none;
  }

  .megamenu-arrow {
    display: none;
  }

  .megamenu-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Nav Right */
.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.login-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  transition: var(--transition);
  text-decoration: none;
}

.login-link:hover {
  color: var(--black);
}

.signup-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 20px;
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  background: var(--accent);
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.signup-btn:hover {
  background: var(--accent-hover);
}

.grid-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  color: var(--gray-700);
  border-radius: 8px;
  transition: var(--transition);
  cursor: pointer;
}

.grid-btn:hover {
  background: var(--gray-100);
}

/* Hamburger (mobile only) */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--black);
  border-radius: 2px;
  transition: var(--transition);
}

/* ===== MAIN CONTENT (offset for fixed header) ===== */
.main {
  margin-top: 60px;
}

/* ===== HERO SECTION ===== */
.hero {
  padding: 40px 24px 15px;
  text-align: center;
  background: #f7f7fa;
}

.hero-title,
.home-title__title {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.1;
  color: #3a3635;

  max-width: none;
  /* Remove width restriction */
  width: 100%;

  white-space: nowrap;
  /* Keep on one line */
  text-align: center;

  margin: 0 auto 16px;
}

.hero-subtitle,
.home-title__subtitle {
  margin-bottom: 4px;
}

/* ===== FILTER PILLS ===== */
.filter-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 24px 18px;
  max-width: 860px;
  margin: 0 auto;
}

.filter-pill {
  height: 38px;
  padding: 0 20px;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1b;
  background: var(--white);
  border: 1px solid #d5d7e0;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.filter-pill:hover {
  background: #f0f1f5;
  border-color: #bdc0cc;
  color: #1a1a1f;
}

.filter-pill.active {
  background: #2b2b36;
  color: var(--white);
  border-color: #2b2b36;
}

/* ===== TOOL CARDS GRID ===== */
.tools-section {
  padding: 0 24px 60px;
  max-width: var(--container);
  margin: 0 auto;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

/* ===== TOOL CARD ===== */
.tool-card,
.tools__item a {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;

  width: 100%;
  height: 180px;
  /* <-- Same height as iLovePDF */

  padding: 28px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;

  transition: .2s;
}

@media (max-width: 98.75em) {

  .tool-card,
  .tools__item a {
    padding: 22px;
  }
}

.tool-card,
.tools__item a {
  border: 1px solid #e5e7eb;
  transition: border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.tool-card:hover,
.tools__item a:hover {
  border-color: #333;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .08);
}

/* Card Header (Icon Box + Title side by side) */
.tool-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

/* Icon Box */
.tool-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 0;
  transition: transform 0.2s ease;
}

.tool-card:hover .tool-icon {
  transform: scale(1.08);
}

/* Icon Color Variants */
.icon-red {
  background: #fef2f2;
}

.icon-blue {
  background: #eff6ff;
}

.icon-green {
  background: #ecfdf5;
}

.icon-purple {
  background: #f5f3ff;
}

.icon-orange {
  background: #fff7ed;
}

.tool-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1f;
  line-height: 1.3;
  margin-bottom: 0;
}

.tool-desc {
  font-size: 14px;
  font-weight: 400;
  color: #5a5b66;
  line-height: 1.5;
  flex: 1;
}

.tool-desc code {
  font-size: 12px;
  background: var(--gray-100);
  padding: 2px 5px;
  border-radius: 4px;
  font-family: 'SF Mono', 'Consolas', monospace;
}

/* ===== CATEGORIZED SECTION ===== */
.categorized-section {
  max-width: var(--container);
  margin: 0 auto 60px;
  padding: 32px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-card);
}

.cat-heading {
  font-size: 22px;
  font-weight: 800;
  color: var(--black);
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--gray-200);
}

.cat-group {
  margin-bottom: 28px;
}

.cat-group:last-child {
  margin-bottom: 0;
}

.cat-group-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 6px;
}

.cat-group-desc {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 12px;
}

.cat-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cat-list-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 15px;
  padding-left: 14px;
  border-left: 3px solid var(--accent);
}

.cat-list-link {
  font-weight: 700;
  color: var(--black);
  text-decoration: none;
  transition: var(--transition);
}

.cat-list-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.cat-list-desc {
  color: var(--gray-500);
  font-size: 14px;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  padding: 48px 0 32px;
  color: var(--gray-600);
  font-size: 14px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-brand .brand {
  margin-right: 0;
}

.footer-brand p {
  color: var(--gray-500);
  font-size: 14px;
  line-height: 1.5;
}

.footer-col-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 14px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  font-size: 14px;
  color: var(--gray-600);
  text-decoration: none;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--gray-200);
  font-size: 13px;
  color: var(--gray-500);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .tools-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .nav-left {
    display: flex;
    align-items: center;
  }

  .brand {
    order: 1;
    margin-right: 12px;
    margin-left: 0;
  }

  .hamburger {
    display: flex;
    order: 2;
    margin-left: 4px;
  }

  .nav-links {
    display: none;
  }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    padding: 12px;
    z-index: 999;
  }

  .nav-links.open .nav-link {
    height: 48px;
    padding: 0 16px;
    font-size: 14px;
  }

  .hero {
    padding: 32px 16px 18px;
  }

  .hero-title {
    font-size: 26px;
    line-height: 1.25;
    margin-bottom: 8px;
  }

  .hero-subtitle {
    font-size: 14px;
    line-height: 1.45;
  }

  .filter-pills {
    justify-content: center;
    flex-wrap: wrap;
    padding: 16px;
    gap: 8px;
  }

  .filter-pill {
    height: 36px;
    padding: 0 16px;
    font-size: 13px;
  }

  .tools-section {
    padding: 0 16px 48px;
  }

  .tools-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .tool-card {
    padding: 18px 16px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .login-link,
  .signup-btn {
    display: none;
  }

  .grid-btn {
    display: flex;
  }
}

@media (max-width: 430px) {
  .hero-title {
    font-size: 23px;
  }

  .filter-pill {
    font-size: 12.5px;
    padding: 0 14px;
  }
}


/* ===== TOOL PAGE SPECIFIC STYLES ===== */
.tool-page-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 1rem;
}

@media (min-width: 992px) {
  .tool-page-layout {
    grid-template-columns: 1fr 320px;
  }
}

.tool-header {
  margin-bottom: 1.5rem;
}

.tool-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 0.75rem;
  line-height: 1.25;
}

.tool-intro {
  font-size: 1.05rem;
  color: var(--gray-600);
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

.calc-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-card);
  padding: 1.75rem;

  width: 100%;
  max-width: 900px;
  /* Change this value */
  margin: 0 auto 2rem;
}

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

.form-label {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 0.5rem;
  color: var(--black);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--black);
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(229, 50, 45, 0.1);
}

.input-suffix {
  position: absolute;
  right: 1rem;
  font-weight: 700;
  color: var(--gray-500);
  pointer-events: none;
}

.form-select {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--black);
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  outline: none;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  color: white;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

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

.btn-secondary {
  background: rgba(229, 50, 45, 0.08);
  color: var(--accent);
  box-shadow: none;
}

.btn-secondary:hover {
  background: var(--accent);
  color: white;
}

.btn-danger {
  background: #fee2e2;
  color: #ef4444;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

.btn-danger:hover {
  background: #ef4444;
  color: white;
}

.toggle-group {
  display: flex;
  background: var(--gray-100);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 1.5rem;
}

.toggle-btn {
  flex: 1;
  padding: 0.6rem 1rem;
  border: none;
  background: transparent;
  font-weight: 700;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--gray-500);
  border-radius: 8px;
  cursor: pointer;
}

.toggle-btn.active {
  background: white;
  color: var(--accent);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.result-card {
  background: rgba(229, 50, 45, 0.04);
  border: 1px solid rgba(229, 50, 45, 0.15);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  text-align: center;
}

.result-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  margin-bottom: 0.5rem;
}

.result-badge.success {
  background: #d1fae5;
  color: #059669;
}

.result-badge.warning {
  background: #fef3c7;
  color: #d97706;
}

.result-badge.danger {
  background: #fee2e2;
  color: #dc2626;
}

.result-value {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 800;
  color: var(--accent);
  margin: 0.4rem 0;
}

.result-message {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--black);
}

.breakdown-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.25rem;
  font-size: 0.95rem;
}

.breakdown-table th,
.breakdown-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

.breakdown-table th {
  font-weight: 700;
  color: var(--gray-500);
  background: var(--bg);
}

.subject-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 40px;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

@media (max-width: 576px) {
  .subject-row {
    grid-template-columns: 1fr 1fr 40px;
  }

  .subject-row .subject-name {
    grid-column: 1 / -1;
  }
}

.faq-section {
  margin-top: 3rem;
}

.faq-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
}

.faq-item {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.faq-question {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 0.5rem;
}

.faq-answer {
  font-size: 0.95rem;
  color: var(--gray-600);
  line-height: 1.6;
}

.related-tools {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--gray-200);
}

.related-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
}

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

.sidebar-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 1.25rem;
}

.sidebar-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
}

/* Ad slot */
.ad-slot {
  width: 100%;
  margin: 1.5rem 0;
  background: rgba(245, 246, 250, 0.8);
  border: 1px dashed var(--gray-300);
  border-radius: 12px;
  padding: 0.85rem;
  text-align: center;
  color: var(--gray-500);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
}

/* Utility */
.text-center {
  text-align: center;
}

.text-success {
  color: #059669;
}

.text-warning {
  color: #d97706;
}

.text-danger {
  color: #dc2626;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-4 {
  margin-top: 1rem;
}

.mb-4 {
  margin-bottom: 1rem;
}