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

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Prevent body scroll when mobile menu is open */
body.mobile-menu-open {
  overflow: hidden;
}

/* Header */

.header {
  background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.25);
}

/* Desktop nav links */

.nav-link {
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: #e5e7eb;
  transform: translateY(-1px);
}

/* Dropdown */

.dropdown {
  position: relative;
}

.dropdown-content {
  position: absolute;
  top: 110%;
  right: 0;
  background: #ffffff;
  min-width: 220px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.25);
  border-radius: 12px;
  overflow: hidden;
  padding: 8px 0;
  z-index: 20;

  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.dropdown.open .dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-content a {
  display: block;
  padding: 10px 18px;
  font-size: 0.875rem;
  color: #4b5563;
  text-decoration: none;
  transition: all 0.2s ease;
}

.dropdown-content a:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  padding-left: 24px;
}

/* Mobile menu button */

.mobile-menu-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Mobile menu (slide-down green) */

.mobile-menu {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform-origin: top;
  transition: max-height 0.3s ease, opacity 0.25s ease;
  z-index: 900;
}

.mobile-menu.open {
  max-height: 400px;
  opacity: 1;
}

.mobile-menu a {
  display: block;
  padding: 10px 1.5rem;
  color: #e5e7eb;
  text-decoration: none;
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.mobile-menu a:last-child {
  border-bottom: none;
}

.mobile-menu a:hover {
  background: rgba(15, 118, 110, 0.9);
}

@media (min-width: 768px) {
  .mobile-menu {
    display: none;
  }
}

/* Page hero */

.page-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  padding: 80px 20px 90px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120'><path d='M0,0 Q300,60 600,30 T1200,0 L1200,120 L0,120 Z' fill='rgba(255,255,255,0.06)'/></svg>")
    repeat-x bottom;
  background-size: 1200px 120px;
  opacity: 0.4;
}

.page-header h1 {
  position: relative;
  z-index: 1;
  font-size: 2.9rem;
  font-weight: 900;
  margin: 0 0 10px;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}

.page-header p {
  position: relative;
  z-index: 1;
  font-size: 1.15rem;
  opacity: 0.98;
}

/* Animations */

.float-animation {
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(4deg);
  }
}

/* Calculator wrapper */

.calculator-container {
  max-width: 1200px;
  margin: -60px auto 60px;
  padding: 0 20px;
  position: relative;
  z-index: 10;
  color: #111827;
}

.tiny-meta {
  font-size: 0.8rem;
  color: #4b5563;
  margin-bottom: 12px;
  text-align: right;
}

/* Cards */

.calculator-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 36px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
  margin-bottom: 26px;
}

.card-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #4f46e5;
  margin: 0 0 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Unit toggle */

.unit-toggle {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.unit-btn {
  padding: 10px 26px;
  border-radius: 999px;
  border: 2px solid #4f46e5;
  background: #ffffff;
  color: #4f46e5;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.unit-btn:hover {
  box-shadow: 0 6px 14px rgba(79, 70, 229, 0.25);
  transform: translateY(-1px);
}

.unit-btn.active {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #ffffff;
  transform: scale(1.03);
}

/* Inputs */

.input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-bottom: 24px;
}

.input-group {
  background: linear-gradient(135deg, #e0e7ff 0%, #ddd6fe 100%);
  padding: 18px 18px 20px;
  border-radius: 18px;
  border: 2px solid #4f46e5;
  transition: all 0.2s ease;
}

.input-group:hover {
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.25);
  transform: translateY(-1px);
}

.input-label {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
  color: #4c1d95;
  margin-bottom: 8px;
}

.input-field {
  width: 100%;
  padding: 12px 10px;
  border-radius: 10px;
  border: 2px solid #4f46e5;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  color: #111827;
  outline: none;
  transition: all 0.2s ease;
  background: #ffffff;
}

.input-field:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.25);
  transform: scale(1.02);
}

/* Calculate button */

.calculate-btn {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 15px 18px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  margin-bottom: 20px;
  transition: all 0.2s ease;
}

.calculate-btn:hover {
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.35);
  transform: translateY(-1px);
}

/* Result display */

.result-display {
  display: none;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  border-radius: 20px;
  padding: 30px 22px;
  text-align: center;
  color: #ffffff;
}

.result-display.show {
  display: block;
}

.bmi-value {
  font-size: 3.2rem;
  font-weight: 900;
  margin-bottom: 6px;
}

.bmi-category {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.bmi-description {
  font-size: 0.98rem;
  opacity: 0.95;
}

/* Chart */

.bmi-chart {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.chart-item {
  border-radius: 14px;
  padding: 16px 10px 18px;
  text-align: center;
  border: 3px solid transparent;
  transition: all 0.25s ease;
}

.chart-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}

.chart-item.active {
  transform: scale(1.04);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
}

.chart-underweight {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #1e3a8a;
}

.chart-normal {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
}

.chart-overweight {
  background: linear-gradient(135deg, #fee2e2 0%, #fed7aa 100%);
  color: #7c2d12;
}

.chart-obese {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #7f1d1d;
}

.chart-icon {
  font-size: 1.6rem;
  margin-bottom: 4px;
}

.chart-title {
  font-weight: 700;
  margin-bottom: 2px;
}

.chart-range {
  font-size: 0.85rem;
}

/* Health insights */

.health-insights {
  background: #f8fafc;
  border-radius: 14px;
  padding: 18px 18px 12px;
  margin-bottom: 18px;
}

.insight-item {
  display: flex;
  gap: 10px;
  padding: 12px 10px;
  margin-bottom: 8px;
  background: #ffffff;
  border-radius: 10px;
  border-left: 4px solid #4f46e5;
}

.insight-icon {
  font-size: 1.4rem;
}

.insight-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.insight-text {
  font-size: 0.9rem;
  color: #4b5563;
}

/* Weight range */

.weight-range-box {
  background: #f1f5f9;
  border-radius: 14px;
  padding: 18px 18px 16px;
  margin-bottom: 18px;
}

.weight-range-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 10px;
  color: #1f2937;
}

.weight-range-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 10px;
}

.weight-range-card {
  background: #ffffff;
  border-radius: 10px;
  padding: 14px 14px 12px;
  border-left: 4px solid #4f46e5;
}

.weight-range-label {
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 4px;
}

.weight-range-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: #111827;
}

.weight-range-status {
  font-size: 0.9rem;
  color: #374151;
}

/* Download buttons */

.download-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.download-btn {
  flex: 1 1 170px;
  border-radius: 999px;
  border: none;
  padding: 11px 16px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.download-btn:hover {
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.35);
  transform: translateY(-1px);
}

/* Table */

.table-wrapper {
  overflow-x: auto;
}

.bmi-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 16px;
}

.bmi-table thead th {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #ffffff;
  text-align: left;
  padding: 10px;
  font-weight: 600;
}

.bmi-table tbody td {
  padding: 10px;
  border-bottom: 1px solid #e5e7eb;
}

.bmi-cat.under {
  color: #1d4ed8;
  font-weight: 600;
}

.bmi-cat.normal {
  color: #059669;
  font-weight: 600;
}

.bmi-cat.over {
  color: #d97706;
  font-weight: 600;
}

.bmi-cat.obese {
  color: #dc2626;
  font-weight: 600;
}

.bmi-risk.low {
  color: #059669;
}

.bmi-risk.medium {
  color: #f97316;
}

.bmi-risk.high,
.bmi-risk.very-high {
  color: #dc2626;
}

/* Blog section */

.blog-section {
  max-width: 900px;
  margin: 70px auto 40px;
  padding: 0 20px;
}

.blog-content {
  background: #ffffff;
  border-radius: 24px;
  padding: 40px 30px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.2);
  line-height: 1.8;
}

.blog-content h2 {
  font-size: 2rem;
  font-weight: 900;
  margin-top: 0;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.blog-content h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 26px;
  margin-bottom: 10px;
  color: #111827;
}

.blog-content p {
  font-size: 0.97rem;
  color: #4b5563;
  margin-bottom: 16px;
}

.blog-content ul {
  margin: 0 0 16px 22px;
  color: #4b5563;
  font-size: 0.95rem;
}

.blog-content li {
  margin-bottom: 6px;
}

.blog-intro-links {
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.blog-intro-links a {
  color: #4f46e5;
  text-decoration: none;
}

.blog-intro-links a:hover {
  text-decoration: underline;
}

.highlight-box,
.example-box {
  background: #eef2ff;
  border-radius: 14px;
  padding: 14px 16px;
  margin: 16px 0;
  border-left: 4px solid #4f46e5;
  font-size: 0.9rem;
}

.disclaimer-text {
  font-size: 0.9rem;
  color: #6b7280;
}

/* FAQ */

.faq-section {
  background: #0f172a;
  padding: 50px 0 60px;
  color: #e5e7eb;
}

.faq-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 24px;
  text-align: left;
}

.faq-item {
  background: #111827;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.faq-item h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 6px;
}

.faq-item p {
  font-size: 0.9rem;
  margin: 0;
}

/* Footer */

.footer {
  background: linear-gradient(135deg, #1f2937 0%, #020617 100%);
  color: #ffffff;
  padding: 50px 0 20px;
  margin-top: 0;
}

.footer-column h3 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 14px;
  color: #9ca3af;
}

.footer-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-column li {
  margin-bottom: 8px;
}

.footer-column a {
  color: #e5e7eb;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.footer-column a:hover {
  color: #a5b4fc;
  transform: translateX(3px);
}

.footer-bottom {
  border-top: 1px solid rgba(148, 163, 184, 0.3);
  margin-top: 26px;
  padding-top: 16px;
  text-align: center;
  font-size: 0.85rem;
  color: #9ca3af;
}

/* Logo sizing */

.header-logo {
  height: 28px;
  width: auto;
  display: block;
}

@media (max-width: 768px) {
  .header-logo {
    height: 22px;
  }
}

/* Responsive */

@media (max-width: 1024px) {
  .bmi-chart {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .page-header {
    padding: 60px 16px 70px;
  }

  .page-header h1 {
    font-size: 2.1rem;
  }

  .page-header p {
    font-size: 0.98rem;
  }

  .calculator-card {
    padding: 24px 18px;
  }

  .input-grid {
    grid-template-columns: 1fr;
  }

  .weight-range-grid {
    grid-template-columns: 1fr;
  }

  .download-buttons {
    flex-direction: column;
  }

  .blog-content {
    padding: 28px 18px;
  }

  .blog-content h2 {
    font-size: 1.6rem;
  }

  .blog-content h3 {
    font-size: 1.15rem;
  }
}
