@view-transition {
  navigation: auto;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

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

/* HEADER */

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

.header-logo-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.header-logo-link {
  text-decoration: none;
}

.nav-link {
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-block;
}

.nav-link:hover {
  color: #e2e8f0;
  transform: scale(1.05);
}

/* Dropdown */

.dropdown {
  position: relative;
}

.dropdown-toggle {
  background: none;
  border: none;
  color: #ffffff;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.dropdown-toggle:hover {
  color: #e2e8f0;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 110%;
  right: 0;
  background: #ffffff;
  min-width: 220px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  margin-top: 8px;
  overflow: hidden;
}

.dropdown-content.show {
  display: block;
}

.dropdown-content a {
  color: #4a5568;
  padding: 12px 20px;
  text-decoration: none;
  display: block;
  transition: all 0.3s ease;
  font-size: 14px;
}

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

/* Mobile menu */

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 26px;
  cursor: pointer;
}

.mobile-menu {
  display: none;
  background: #16a34a;
  color: #ffffff;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease-out;
}

.mobile-menu a {
  display: block;
  padding: 12px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  text-decoration: none;
  color: #f9fafb;
  font-weight: 500;
}

.mobile-menu a:hover {
  background: rgba(0, 0, 0, 0.12);
}

.mobile-menu.open {
  display: block;
  max-height: 400px;
}

/* PAGE HEADER */

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

.page-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 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.05)"/></svg>')
    repeat-x bottom;
  background-size: 1200px 120px;
  opacity: 0.3;
}

.page-header h1 {
  font-size: 44px;
  font-weight: 900;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  animation: slideInDown 0.6s ease;
}

.page-header p {
  font-size: 20px;
  opacity: 0.95;
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  animation: slideInUp 0.6s ease;
}

/* Animations */

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

/* MAIN CALCULATOR LAYOUT */

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

.calculator-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  animation: slideUp 0.6s ease;
  margin-bottom: 24px;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-title {
  font-size: 24px;
  font-weight: 800;
  color: #667eea;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Method selector */

.method-selector {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.method-option {
  background: linear-gradient(135deg, #e0e7ff 0%, #ddd6fe 100%);
  padding: 20px;
  border-radius: 16px;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.method-option:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
}

.method-option.active {
  border-color: #667eea;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
}

.method-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.method-description {
  font-size: 13px;
  opacity: 0.9;
}

/* Inputs */

.input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.input-group {
  background: linear-gradient(135deg, #e0e7ff 0%, #ddd6fe 100%);
  padding: 24px;
  border-radius: 16px;
  border: 2px solid #667eea;
  transition: all 0.3s ease;
}

.input-group:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
}

.input-label {
  font-weight: 700;
  color: #4c1d95;
  margin-bottom: 12px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-field,
.select-field {
  width: 100%;
  padding: 14px;
  border: 2px solid #667eea;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 600;
  transition: all 0.3s ease;
  color: #1e293b;
  background: #ffffff;
}

.input-field:focus,
.select-field:focus {
  outline: none;
  border-color: #764ba2;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
  transform: scale(1.02);
}

/* Button */

.calculate-btn {
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 24px;
}

.calculate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

/* Results */

.result-display {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 40px;
  border-radius: 20px;
  color: #ffffff;
  margin-bottom: 32px;
}

.bodyfat-value {
  font-size: 64px;
  font-weight: 900;
  margin-bottom: 8px;
  text-align: center;
}

.bodyfat-label {
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  opacity: 0.95;
  margin-bottom: 24px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  padding: 20px;
  border-radius: 16px;
  text-align: center;
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-4px);
}

.stat-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 28px;
  font-weight: 900;
}

.stat-subtitle {
  font-size: 13px;
  opacity: 0.85;
  margin-top: 6px;
}

.category-badge {
  display: inline-block;
  padding: 10px 28px;
  border-radius: 50px;
  font-size: 18px;
  font-weight: 700;
  margin: 16px 0 8px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Ranges */

.ranges-section {
  background: #f8fafc;
  padding: 24px;
  border-radius: 16px;
  margin-top: 24px;
}

.range-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #ffffff;
  border-radius: 12px;
  margin-bottom: 10px;
  border-left: 4px solid #667eea;
  transition: all 0.3s ease;
}

.range-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.range-name {
  font-weight: 700;
  color: #1e293b;
  font-size: 15px;
}

.range-value {
  font-weight: 600;
  color: #667eea;
  font-size: 15px;
}

/* AdSense placeholders */

.adsense-container {
  background: #e0e7ff;
  border-radius: 16px;
  padding: 20px;
  margin: 24px 0;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed #a5b4fc;
}

.adsense-placeholder {
  text-align: center;
  color: #4c1d95;
  font-size: 14px;
}

/* Download buttons */

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

.download-btn {
  flex: 1;
  padding: 14px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Tips */

.tips-section {
  background: #f8fafc;
  padding: 24px;
  border-radius: 12px;
  margin-top: 24px;
}

.tip-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: #ffffff;
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

/* BLOG SECTION */

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

.blog-content {
  background: #ffffff;
  border-radius: 24px;
  padding: 40px 32px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  line-height: 1.8;
}

.blog-content h2 {
  font-size: 32px;
  font-weight: 900;
  color: #1a202c;
  margin-bottom: 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.blog-content h3 {
  font-size: 24px;
  font-weight: 700;
  color: #2d3748;
  margin-top: 28px;
  margin-bottom: 16px;
}

.blog-content h4 {
  font-size: 18px;
  font-weight: 600;
  color: #4a5568;
  margin-top: 20px;
  margin-bottom: 12px;
}

.blog-content p {
  color: #4a5568;
  font-size: 16px;
  margin-bottom: 16px;
  line-height: 1.9;
}

.blog-content ul,
.blog-content ol {
  color: #4a5568;
  margin-left: 24px;
  margin-bottom: 18px;
}

.blog-content li {
  margin-bottom: 8px;
  line-height: 1.8;
}

.blog-content strong {
  color: #667eea;
  font-weight: 700;
}

.highlight-box {
  background: linear-gradient(135deg, #e0e7ff 0%, #ddd6fe 100%);
  padding: 20px;
  border-radius: 12px;
  border-left: 4px solid #667eea;
  margin: 24px 0;
  font-size: 15px;
}

.example-box {
  background: #e0e7ff;
  padding: 20px;
  border-radius: 12px;
  border-left: 4px solid #667eea;
  margin: 24px 0;
  font-size: 15px;
}

.internal-link {
  color: #2563eb;
  text-decoration: underline;
  text-decoration-color: rgba(37, 99, 235, 0.4);
}

.internal-link:hover {
  text-decoration-color: rgba(37, 99, 235, 0.9);
}

/* FAQ on-page */

.faq-list {
  margin-top: 12px;
}

.faq-item {
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.faq-item h4 {
  margin-bottom: 6px;
}

/* FOOTER */

.footer {
  background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
  color: #ffffff;
  padding: 60px 0 20px;
  margin-top: 80px;
}

.footer-column h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  color: #a0aec0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

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

.footer-column ul li a {
  color: #cbd5e0;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-block;
}

.footer-column ul li a:hover {
  color: #667eea;
  transform: translateX(5px);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 40px;
  padding-top: 20px;
  text-align: center;
  color: #a0aec0;
}

/* UTILITIES */

.hidden {
  display: none !important;
}

/* RESPONSIVE */

@media (max-width: 1024px) {
  .page-header h1 {
    font-size: 36px;
  }

  .page-header p {
    font-size: 18px;
  }
}

/* Hide desktop nav items on mobile */
@media (max-width: 768px) {
  .nav-links,
  .desktop-nav {
    display: none !important;
  }

  .mobile-menu-btn {
    display: block;
  }

  .calculator-card {
    padding: 24px;
  }

  .method-selector {
    grid-template-columns: 1fr;
  }

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

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

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

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

  .blog-content h2 {
    font-size: 26px;
  }

  .blog-content h3 {
    font-size: 20px;
  }
}
