* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  background: #f8fafc;
  color: #0f172a;
  padding-top: 40px;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: auto;
}

.center {
  text-align: center;
}

/* NAVBAR */

.navbar {
  padding: 15px 0;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  background: white;
  border-bottom: 1px solid #e2e8f0;
}

/* .nav-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
} */

.nav-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

/* .logo {
  font-weight: bold;
  font-size: 22px;
  color: #4f46e5;
} */

.logo a {
  text-decoration: none;
  font-size: 20px;
  font-weight: 700;
  color: #4f46e5;
  transition: 0.3s ease;
}

.logo a:hover {
  color: #e7510b;
}

/* .nav-links a {
  margin: 0 15px;
  text-decoration: none;
  color: #334155;
  font-size: 14px;
} */
/* 
.nav-links {
  display: flex;
  align-items: center;
  gap: 25px;
} */

.nav-links > a {
  font-size: 14px;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 0.25s ease;
}

.nav-links > a:hover {
  background: rgba(79, 70, 229, 0.08);
  color: #4f46e5;
}

.small-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
  display: none;
  min-width: 200px;
}

.category-dropdown:hover .small-dropdown {
  display: block;
}

.small-dropdown a {
  display: block;
  text-decoration: none;
  color: #334155;
  padding: 6px 0;
  font-size: 14px;
}

.small-dropdown a:hover {
  color: #4f46e5;
}

/* Small category style */
.small-menu {
  position: absolute;
  top: 55px;
  left: 0;

  width: 220px;
  background: white;
  padding: 18px;
  border-radius: 12px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);

  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: 0.25s ease;
}

.small-menu-dropdown:hover .small-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.small-menu h4 {
  font-size: 13px;
  margin-bottom: 10px;
  color: #4f46e5;
}

.small-menu a {
  display: block;
  text-decoration: none;
  color: #334155;
  padding: 6px 0;
  font-size: 14px;
  transition: 0.2s ease;
}

.small-menu a:hover {
  color: #4f46e5;
}

.nav-links a,
.nav-links .dropdown > a {
  text-decoration: none;
  color: #334155;
  font-size: 14px;
  white-space: nowrap;

  position: relative;
  text-decoration: none;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 0;
  transition: color 0.3s ease;
}

.nav-links a,
.dropbtn {
  position: relative;
  text-decoration: none;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 0;
  transition: color 0.3s ease;
}

.nav-links a::after,
.dropbtn::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, #4f46e5, #06b6d4);
  transition: width 0.3s ease;
  border-radius: 4px;
}

.nav-links a:hover::after,
.dropdown:hover .dropbtn::after {
  width: 100%;
}

.nav-links a:hover,
.dropdown:hover .dropbtn {
  color: #4f46e5;
}

.nav-links a,
.dropbtn {
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.25s ease;
}

.nav-links a:hover,
.dropdown:hover .dropbtn {
  background: rgba(79, 70, 229, 0.08);
  color: #4f46e5;
}

.navbar.scrolled {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
  transition: 0.3s ease;
}

.dropdown1 {
  position: relative;
  display: flex;
  align-items: center;
}
.dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

/* .dropbtn {
  cursor: pointer;
} */

/* MEGA MENU */
.mega-menu {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);

  width: 1000px;
  max-width: 95vw;

  background: white;
  border-radius: 16px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.12);
  padding: 40px;

  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 35px;

  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  z-index: 2000;
}

.mega-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Keep open when hovering anywhere inside dropdown */
.dropdown:hover .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Column styling */
.mega-column h4 {
  font-size: 14px;
  margin-bottom: 12px;
  color: #4f46e5;
}

.mega-column a {
  display: block;
  text-decoration: none;
  color: #334155;
  margin-bottom: 8px;
  font-size: 14px;
  padding: 4px 0;
}

.mega-column a:hover {
  color: #4f46e5;
}

.dropdown:hover .mega-menu {
  display: grid;
}

.arrow {
  display: inline-block;
  margin-left: 5px;
  transition: transform 0.3s ease;
}

.dropdown:hover .arrow {
  transform: rotate(180deg);
}

/* .nav-right .login {
  margin-right: 15px;
  text-decoration: none;
  color: #333;
  } */
.login {
  margin-right: 15px;
  color: #333;
  text-decoration: none;
  /* color: #334155; */
  font-weight: 600;
  transition: 0.25s ease;
  margin-top: 8px;
}

.login:hover {
  color: #4f46e5;
}

/* .nav-right .signup {
  background: #4f46e5;
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  } */
.signup {
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  background: linear-gradient(76deg, #4f46e5, #06b6d4);
  color: white;
  padding: 8px 18px;
  border-radius: 8px;
  font-weight: 500;
  transition: 0.3s ease;
}

.signup:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}

/* HERO */

.hero {
  padding: 60px 0;
}

.hero h1 {
  font-size: 36px;
  margin-bottom: 15px;
}

.hero p {
  color: #666;
  margin-bottom: 25px;
}

.filters {
  margin-bottom: 40px;
}

.filters button {
  padding: 8px 18px;
  border-radius: 20px;
  background: white;
  border: 1px solid #cbd5e1;
  color: #334155;
  margin: 5px;
  cursor: pointer;
}

.filters .active {
  background: #4f46e5;
  color: white;
  border-color: #4f46e5;
}

.tool-grid {
  /* display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 25px; */

  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 25px;
}

.tool-card {
  border-radius: 14px;
  padding: 25px;
  transition: 0.2s;
  cursor: pointer;
  text-align: left;

  background: white;
  border: 1px solid #e2e8f0;
  transition: 0.2s ease;
}

.tool-card:hover {
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.08);
  transform: translateY(-4px);
}

/* .tool-grid >a {
  text-decoration: none;
} */

.tool-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.tool-icon {
  width: 42px;
  height: 42px;
  background: #eef2ff;
  color: #4f46e5;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  margin-bottom: 15px;
  font-size: 18px;
}

.tool-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: #0f172a;
}

.tool-card p {
  font-size: 14px;
  /* color:#666; */
  color: #64748b;
}

/* SECTIONS */
.section-title {
  text-align: center;
  font-size: 28px;
  margin-bottom: 40px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 30px;
}

.category-card {
  background: white;
  border: 1px solid #e2e8f0;
  padding: 30px;
  border-radius: 16px;
  text-align: left;
  transition: 0.25s ease;
}

.category-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(79, 70, 229, 0.08);
  border-color: #c7d2fe;
}

.category-icon {
  width: 44px;
  height: 44px;
  background: #eef2ff;
  color: #4f46e5;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  margin-bottom: 18px;
  font-size: 20px;
}

.category-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: #0f172a;
}

.category-card p {
  font-size: 14px;
  color: #64748b;
}

.section-light {
  background: #f0f0f0;
  padding: 70px 0;
  text-align: center;
}

.section-white {
  background: white;
  padding: 70px 0;
}

.features {
  padding: 80px 0;
  background: #f1f5f9;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.feature-card {
  background: white;
  padding: 30px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  text-align: left;
  transition: 0.25s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: #4f46e5;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-bottom: 18px;
  font-size: 18px;
}

.feature-card h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

.feature-card p {
  font-size: 14px;
  color: #64748b;
}

/* FOOTER */

/* .footer {
  color: white;
  padding-top: 60px;
  background: #0f172a;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 40px;
}

.footer-grid h4 {
  margin-bottom: 15px;
  font-size: 14px;
  color: #94a3b8;
}

.footer-grid a {
  display: block;
  text-decoration: none;
  margin-bottom: 8px;
  font-size: 14px;

  color: #cbd5e1;
}

.footer-bottom {
  margin-top: 50px;
  padding: 20px 0;
  border-top: 1px solid #1e293b;
}

.bottom-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.social span {
  margin: 0 8px;
} */

/* =========================================
   PREMIUM FOOTER
========================================= */

.footer {
  background: #0f172a;
  color: #cbd5e1;
  padding: 60px 20px 30px;
  width: 100%;
}

.footer-container {
  max-width: 1300px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 40px;
}

.footer h3 {
  color: #ffffff;
  margin-bottom: 15px;
}

.footer h4 {
  color: #ffffff;
  margin-bottom: 15px;
  font-size: 15px;
}

.footer p {
  line-height: 1.6;
  font-size: 14px;
}

.footer a {
  display: block;
  text-decoration: none;
  color: #cbd5e1;
  margin-bottom: 8px;
  font-size: 14px;
  transition: 0.3s ease;
}

.footer a:hover {
  color: #ffffff;
}

.footer-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 40px 0 25px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.copyright {
  font-size: 14px;
  color: #94a3b8;
}

/* ===== Social Icons ===== */

.social {
  display: flex;
  gap: 18px;
}

.social a {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: 0.3s ease;
}

.social a:hover {
  background: #4f46e5;
  transform: translateY(-3px);
}

.social svg {
  width: 18px;
  height: 18px;
  color: #ffffff;
}

/* ===== Responsive ===== */

@media (max-width: 768px) {
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .social {
    justify-content: center;
  }
}


/* Mobile Responsive */
.hamburger {
  display: none;
  font-size: 24px;
  cursor: pointer;
}

/* MOBILE */
/* ===== Responsive Navbar ===== */

/* Hide mobile‑only elements by default */
.close-menu,
.mobile-nav-right {
  display: none;
}

/* Tablet (861px – 979px) */
@media (min-width: 861px) and (max-width: 979px) {
  /* Hide direct links (BMI, Word Count, Case Convert) */
  .nav-links > a:not([class*="dropdown"]) {
    display: none;
  }
  /* Hide Calculators dropdown */
  .dropdown1 {
    display: none;
  }
  /* Show All Tools dropdown and desktop login/signup normally */
  .dropdown {
    display: flex;
  }
  .nav-right {
    display: flex;
  }
  /* Ensure mega‑menu hover works */
  .dropdown:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }
  /* Hide mobile elements */
  .close-menu,
  .mobile-nav-right {
    display: none;
  }
}

/* Desktop (≥980px) – everything visible (default) */
@media (min-width: 980px) {
  .nav-links > a,
  .dropdown1,
  .dropdown,
  .nav-right {
    display: flex; /* or block, as appropriate */
  }
  .close-menu,
  .mobile-nav-right {
    display: none;
  }
}

/* Mobile (≤860px) */
/* Mobile (≤860px) */
@media (max-width: 860px) {
  /* Hide desktop login/signup */
  .nav-right {
    display: none;
  }

  /* Show hamburger */
  .hamburger {
    display: block;
  }

  /* Navigation menu – slide from right */
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: white;
    flex-direction: column;
    align-items: flex-start;
    padding: 80px 25px 30px;
    gap: 20px;
    transition: right 0.3s ease;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    overflow-y: auto;
  }
  .nav-links.active {
    right: 0;
  }

  /* Show close button inside menu */
  .close-menu {
    display: block;
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
  }

  /* When menu is active, hide everything except the close button and the All Tools mega menu */
  .nav-links.active > a:not(.dropdown),           /* hide direct links (BMI, Word Count, Case Convert) */
  .nav-links.active > .dropdown1,                  /* hide Calculators dropdown */
  .nav-links.active > .mobile-nav-right {
    /* hide mobile login/signup */
    display: none;
  }

  /* Hide the "All Tools" dropbtn itself */
  .nav-links.active .dropdown .dropbtn {
    display: none;
  }

  /* Show the mega menu as a static, vertical list */
  .nav-links.active .dropdown .mega-menu {
    display: block !important; /* override any other display rules */
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    padding: 0;
    background: transparent;
    width: 100%;
  }

  /* Stack mega menu columns vertically */
  .nav-links.active .mega-menu {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Style column headings and links for mobile */
  .nav-links.active .mega-column h4 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #4f46e5;
  }

  .nav-links.active .mega-column a {
    display: block;
    padding: 8px 0;
    font-size: 15px;
    color: #334155;
    text-decoration: none;
    border-bottom: 1px solid #e2e8f0;
  }

  .nav-links.active .mega-column a:last-child {
    border-bottom: none;
  }

  /* Remove hover effects on mobile */
  .dropdown:hover .mega-menu,
  .small-menu-dropdown:hover .small-menu {
    display: none;
  }

  /* Ensure the dropdown container doesn't interfere */
  .nav-links.active .dropdown {
    width: 100%;
  }
}

.nav-links.active .close-menu {
  display: block !important;
}
