/* ------------------------------
   Global Styles
------------------------------ */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f7f7f7;
  color: #222;
  line-height: 1.6;
}

main {
  max-width: 960px;
  margin: 20px auto 40px;
  padding: 0 16px;
}

/* Card-style sections */
main > section {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  padding: 20px;
  margin-bottom: 20px;
}

main h1 {
  text-align: center;
  margin-top: 30px;
  margin-bottom: 20px;
}

/* ------------------------------
   Mobile-first Navigation Bar
------------------------------ */

.navbar {
  background: #1a73e8;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.nav-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  color: #fff;
  font-size: 20px;
  font-weight: bold;
  text-decoration: none;
}

/* Toggle button (mobile) */
.nav-toggle {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

/* Nav links (hidden by default on mobile) */
.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
  flex-direction: column;
  width: 100%;
  margin-top: 10px;
}

.nav-links li {
  margin: 4px 0;
}

.nav-links a {
  color: #fff;
  text-decoration: none;
  font-size: 16px;
  display: block;
  padding: 6px 0;
}

/* When nav is open on mobile */
.nav-links.nav-open {
  display: flex;
}

/* ------------------------------
   Desktop Navigation
------------------------------ */

@media (min-width: 700px) {
  .nav-container {
    align-items: center;
  }

  .nav-toggle {
    display: none;
  }

  .nav-links {
    display: flex;
    flex-direction: row;
    width: auto;
    margin-top: 0;
    gap: 20px;
  }

  .nav-links li {
    margin: 0;
  }

  .nav-links a {
    padding: 0;
  }

  .nav-links a:hover {
    opacity: 0.8;
  }
}

/* ------------------------------
   Hero Section
------------------------------ */

.hero {
  text-align: center;
}

.hero h1 {
  margin-top: 0;
  font-size: 1.8rem;
  color: #1a1a1a;
}

.hero p {
  margin: 10px 0 20px;
  color: #444;
}

.hero-cta {
  display: inline-block;
  padding: 10px 20px;
  background: #1a73e8;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.95rem;
}

.hero-cta:hover {
  opacity: 0.9;
}

/* ------------------------------
   Tools Grid
------------------------------ */

.tools-section h2,
.categories-section h2,
.about-teaser h2 {
  margin-top: 0;
}

.tool-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.tool-card {
  display: block;
  padding: 14px;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  text-decoration: none;
  color: #222;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.tool-card h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.tool-card p {
  margin: 0;
  color: #555;
}

.tool-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transform: translateY(-1px);
}

/* ------------------------------
   Categories Grid
------------------------------ */

.category-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.category-card {
  padding: 14px;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  background: #fafafa;
}

.category-card h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

/* Larger screens: 2 columns */
@media (min-width: 700px) {
  .tool-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ------------------------------
   About Teaser
------------------------------ */

.about-teaser ul {
  padding-left: 20px;
}

.about-teaser li {
  margin-bottom: 6px;
}

/* ------------------------------
   Footer
------------------------------ */

footer {
  text-align: center;
  padding: 16px;
  color: #555;
  font-size: 14px;
}


/* Compact converter box matching screenshot style */
.converter-box {
  background: #ffffff;
  padding: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  max-width: 420px;
  margin: 0 auto 20px auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.converter-box label {
  font-size: 14px;
  font-weight: bold;
}

.converter-box input,
.converter-box select {
  width: 100%;
  padding: 6px 8px;
  font-size: 15px;
  border: 1px solid #bbb;
  border-radius: 4px;
}

.converter-box button {
  padding: 8px 12px;
  font-size: 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.converter-box .convert-btn {
  background: #1a73e8;
  color: white;
}

.converter-box .clear-btn {
  background: #e0e0e0;
  color: #333;
}

.converter-box .convert-btn:hover,
.converter-box .clear-btn:hover {
  opacity: 0.9;
}

.converter-box h3 {
  margin: 6px 0 0;
  font-size: 16px;
}

.converter-box p {
  margin: 0;
  font-size: 16px;
  font-weight: bold;
}
/* Search Icon */
.search-icon {
  width: 25px;
  height: 25px;
  vertical-align: middle;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.search-icon:hover {
  opacity: 0.7;
}

@media (max-width: 600px) {
  .nav-search img {
    width: 24px;
    height: 24px;
  }
}
/* Title Header */

header h1 {
  text-align: center;
  font-size: 2.2rem;
  margin: 40px auto 25px;
  color: #1a73e8;
  display: inline-block;
  padding-bottom: 8px;
}

header {
  width: 100%;
  text-align: center;
  margin: 40px 0 20px;
}

header h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin: 0 auto;
}

/* BMI Bar */

.bmi-bar {
  position: relative;
  display: flex;
  height: 28px;
  border-radius: 6px;
  overflow: hidden;
  margin: 15px 0 25px;
}

.bmi-zone {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: #fff;
  line-height: 28px;
  font-weight: 600;
}

.underweight { background: #4aa3ff; } /* Blue */
.normal      { background: #3cb371; } /* Green */
.overweight  { background: #f4c542; } /* Yellow */
.obesity     { background: #e74c3c; } /* Red */

#bmiPointer {
  position: absolute;
  top: -6px;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 10px solid #000;
  left: 0;
  transition: left 0.3s ease;
}