@view-transition {
  navigation: auto;
}

/* Global */

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

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  scroll-behavior: smooth;
}

body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Links */

a {
  text-decoration: none;
}

/* Header & Navigation */

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

.brand-link {
  color: #ffffff;
}

.header-logo {
  height: 40px;
  width: auto;
  border-radius: 8px;
}

.brand-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
}

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

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

/* Dropdown */

.dropdown {
  position: relative;
}

.dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: #ffffff;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

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

.dropdown-content {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 220px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
  padding: 8px 0;
  display: none;
  z-index: 1100;
}

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

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

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

/* Mobile Menu */

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

.mobile-menu {
  background: #047857;
  color: #ffffff;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}

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

.mobile-menu a {
  display: block;
  padding: 12px 22px;
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

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

/* Overlay when mobile menu open */

.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 900;
}

.mobile-menu-overlay.active {
  display: block;
}

body.mobile-menu-open {
  overflow: hidden;
}

/* Page Header / 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.05)'/></svg>") repeat-x bottom;
  background-size: 1200px 120px;
  opacity: 0.3;
}

.page-header h1 {
  position: relative;
  z-index: 1;
  font-size: 3rem;
  font-weight: 900;
  margin-bottom: 0.6rem;
  text-shadow: 2px 2px 4px rgba(15, 23, 42, 0.25);
  animation: slideInDown 0.6s ease;
}

.page-header p {
  position: relative;
  z-index: 1;
  font-size: 1.25rem;
  opacity: 0.95;
  animation: slideInUp 0.6s ease;
}

.emoji-hero {
  position: relative;
  z-index: 1;
  font-size: 3.5rem;
  margin-bottom: 0.6rem;
}

/* 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(0) rotate(0);
  }
  50% {
    transform: translateY(-16px) rotate(3deg);
  }
}

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

/* 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(15, 23, 42, 0.25);
  margin-bottom: 24px;
  animation: slideUp 0.5s ease;
}

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

.card-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: #4f46e5;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Inputs */

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

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

.input-group.full-width {
  grid-column: 1 / -1;
}

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

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

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

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

.calculate-btn {
  width: 100%;
  margin-top: 10px;
  padding: 16px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #6366f1 0%, #7c3aed 50%, #ec4899 100%);
  background-size: 200% 200%;
  transition: all 0.25s ease;
}

.calculate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(129, 140, 248, 0.6);
  background-position: 100% 0;
}

/* Results Display */

.result-display {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #ec4899 100%);
  padding: 34px;
  border-radius: 20px;
  color: #ffffff;
  margin-bottom: 30px;
}

.calorie-value {
  font-size: 3.5rem;
  font-weight: 900;
  text-align: center;
  margin-bottom: 4px;
}

.calorie-label {
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
  opacity: 0.95;
  margin-bottom: 26px;
}

.goal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.goal-card {
  background: rgba(15, 23, 42, 0.12);
  border-radius: 16px;
  border: 1px solid rgba(248, 250, 252, 0.2);
  padding: 18px 16px;
  text-align: center;
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
}

.goal-card:hover {
  transform: translateY(-3px);
  background: rgba(15, 23, 42, 0.25);
}

.goal-title {
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0.9;
  margin-bottom: 8px;
}

.goal-value {
  font-size: 1.6rem;
  font-weight: 900;
}

.goal-subtitle {
  font-size: 0.78rem;
  opacity: 0.85;
  margin-top: 6px;
}

/* Macros */

.macro-section {
  background: #f8fafc;
  padding: 26px;
  border-radius: 18px;
  margin-top: 16px;
}

.macro-heading {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.macro-subtitle {
  font-size: 0.9rem;
  color: #64748b;
}

.macro-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 18px;
}

.macro-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  border-left: 4px solid #6366f1;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
  transition: all 0.2s ease;
}

.macro-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

.macro-name {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  margin-bottom: 6px;
}

.macro-value {
  font-size: 1.6rem;
  font-weight: 900;
  color: #111827;
  margin-bottom: 2px;
}

.macro-calories {
  font-size: 0.85rem;
  color: #6b7280;
}

/* AdSense Placeholder */

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

.adsense-placeholder {
  text-align: center;
  color: #312e81;
}

.adsense-emoji {
  font-size: 2.4rem;
  margin-bottom: 8px;
}

.adsense-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.adsense-text {
  font-size: 0.9rem;
}

/* Tips & Downloads */

.tips-section {
  background: #f8fafc;
  padding: 22px;
  border-radius: 14px;
  margin-top: 20px;
}

.tips-heading {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 16px;
}

.tip-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  padding: 14px;
  background: #ffffff;
  border-radius: 10px;
  border-left: 4px solid #6366f1;
  font-size: 0.95rem;
  color: #1f2937;
}

.tip-icon {
  font-size: 1.5rem;
  line-height: 1;
  margin-top: 2px;
}

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

.download-btn {
  flex: 1;
  min-width: 160px;
  padding: 12px 18px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #6366f1 0%, #7c3aed 50%, #ec4899 100%);
  background-size: 180% 180%;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(129, 140, 248, 0.6);
  background-position: 100% 0;
}

/* Understanding Box (understanding your results) */

.understanding-box {
  background: #f8fafc;
  border-radius: 16px;
  padding: 24px;
}

.understanding-box h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
}

.understanding-box p {
  font-size: 0.95rem;
  color: #4b5563;
  margin-bottom: 16px;
}

/* Blog Section */

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

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

.blog-content h2 {
  font-size: 2.1rem;
  font-weight: 900;
  margin-bottom: 24px;
  background: linear-gradient(135deg, #6366f1 0%, #7c3aed 50%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.blog-content h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin-top: 32px;
  margin-bottom: 14px;
}

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

.blog-content ul {
  margin-left: 24px;
  margin-bottom: 16px;
  color: #4b5563;
}

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

.blog-content strong {
  color: #4f46e5;
  font-weight: 700;
}

.highlight-box {
  background: linear-gradient(135deg, #e0e7ff 0%, #ddd6fe 100%);
  padding: 20px;
  border-radius: 14px;
  border-left: 4px solid #6366f1;
  margin: 26px 0;
  font-size: 0.96rem;
  color: #1f2937;
}

.example-box {
  background: #e0f2fe;
  padding: 20px;
  border-radius: 14px;
  border-left: 4px solid #0ea5e9;
  margin: 26px 0;
  font-size: 0.96rem;
  color: #0f172a;
}

/* FAQ Section */

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

.faq-container {
  background: #0f172a;
  border-radius: 24px;
  padding: 36px 26px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.75);
}

.faq-container h2 {
  color: #e5e7eb;
  font-size: 1.7rem;
  font-weight: 800;
  margin-bottom: 24px;
}

.faq-item {
  border-top: 1px solid rgba(148, 163, 184, 0.4);
  padding: 16px 0;
}

.faq-item:first-of-type {
  border-top: none;
}

.faq-item h3 {
  color: #e5e7eb;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.faq-item p {
  color: #cbd5f5;
  font-size: 0.94rem;
}

.faq-item a {
  color: #a5b4fc;
  text-decoration: underline;
}

/* Footer */

.footer {
  background: linear-gradient(135deg, #111827 0%, #020617 100%);
  color: #e5e7eb;
  padding: 60px 0 20px;
  margin-top: 40px;
}

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

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

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

.footer-column ul li a {
  color: #cbd5e1;
  font-size: 0.94rem;
  transition: all 0.2s ease;
}

.footer-column ul li a:hover {
  color: #6366f1;
  transform: translateX(4px);
}

.footer-bottom {
  border-top: 1px solid rgba(55, 65, 81, 0.8);
  margin-top: 30px;
  padding-top: 24px;
  text-align: center;
  font-size: 0.85rem;
  color: #9ca3af;
}

/* Responsive */

@media (max-width: 1024px) {
  .calculator-card {
    padding: 28px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none !important;
  }

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

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

  .calculator-container {
    margin-top: -40px;
  }

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

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

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

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

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

  .blog-content {
    padding: 30px 22px;
  }

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

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

  .faq-container {
    padding: 26px 18px;
  }
}

@media (max-width: 480px) {
  .page-header {
    padding-top: 70px;
    padding-bottom: 70px;
  }

  .calorie-value {
    font-size: 2.6rem;
  }

  .goal-card {
    padding: 16px 14px;
  }
}
