/* General Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, sans-serif;
}

body {
  background-color: #f9fafb;
  color: #1F2937;
  line-height: 1.5;
}

.bmi-calculator {
  width: 100%;
  min-height: 100vh;
}

/* Navigation Bar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: white;
  padding: 1rem;
  z-index: 1001;
  transition: box-shadow 0.3s ease;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-link {
  color: #4B5563;
  text-decoration: none;
  font-weight: 500;
  padding: 5px 0;
  position: relative;
  transition: color 0.3s;
}

.nav-link:hover {
  color: #20B2AA;
}

.nav-link.active {
  color: #20B2AA;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: #20B2AA;
}

/* Line below navbar */
.nav-divider {
  height: 1px;
  background-color: #e5e7eb;
  width: 100%;
}

/* Logo Styles */
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}

.logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #20B2AA;
}

.logo-text {
  font-weight: 600;
  font-size: 20px;
}

/* Auth Buttons */
.auth-buttons {
  display: flex;
  gap: 10px;
}

.auth-button {
  padding: 8px 16px;
  background-color: #20B2AA;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.2s;
  text-decoration: none;
}

.auth-button:hover {
  background-color: #1a8f89;
}

/* Header Section */
.header {
  max-width: 1200px;
  margin: 100px auto 40px; /* Increased top margin to account for navbar height */
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
}

@media (min-width: 768px) {
  .header {
    grid-template-columns: 1fr 1fr;
  }
}

.header-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.header-content h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #20B2AA;
  line-height: 1.2;
}

.header-content p {
  color: #6B7280;
  font-size: 1.1rem;
}

.header-buttons {
  display: flex;
  gap: 15px;
  margin-top: 10px;
}

.header-image {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px; /* Added margin to ensure spacing */
}

.header-image img {
  max-width: 100%;
  border-radius: 12px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Add scrolled class for navbar */
.navbar.scrolled {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Main Content */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Section Styles */
.section {
  margin-bottom: 60px;
  scroll-margin-top: 80px;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 30px;
  color: #20B2AA;
  text-align: center;
}

/* Grid Layout */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 768px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Card Styles */
.card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.card-header {
  padding: 24px 24px 0;
}

.card-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #20B2AA;
}

.card-description {
  color: #6B7280;
  margin-bottom: 16px;
}

.card-content {
  padding: 16px 24px;
}

.card-footer {
  padding: 16px 24px 24px;
  display: flex;
  justify-content: space-between;
}

/* Tabs Styles */
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 24px;
}

.unit-tab {
  background: #F3F4F6;
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.unit-tab:hover {
  background: #E5E7EB;
}

.unit-tab.active {
  background: #20B2AA;
  color: white;
}

/* Gender Selector */
.gender-selector {
  display: flex;
  gap: 10px;
  width: 100%;
}

.gender-option {
  flex: 1;
  cursor: pointer;
}

.gender-option input[type="radio"] {
  display: none;
}

.gender-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px;
  background: #F3F4F6;
  border-radius: 8px;
  transition: all 0.2s;
}

.gender-option input[type="radio"]:checked + .gender-label {
  background: #20B2AA;
  color: white;
}

/* Input Group Styles */
.input-group {
  margin-bottom: 16px;
}

.input-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.input {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input:focus {
  outline: none;
  border-color: #20B2AA;
  box-shadow: 0 0 0 3px rgba(32, 178, 170, 0.1);
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Button Styles */
.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
}

/* Update existing button styles */
.button {
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  min-width: 120px;  /* Add minimum width for consistent button sizes */
}

.button-primary {
  background: #20B2AA;
  color: white;
}

.button-primary:hover {
  background: #1a8f89;
}

.button-primary:disabled {
  background: #9CA3AF;
  cursor: not-allowed;
}

.button-outline {
  background: transparent;
  color: #6B7280;
  border: 1px solid #E5E7EB;
}

.button-outline:hover {
  background: #F9FAFB;
  color: #4B5563;
}

/* Results Styles */
.result-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 0;
}

.bmi-circle {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 24px;
  transition: background 0.5s ease;
}

.bmi-circle::before {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: white;
}

.bmi-circle-inner {
  position: relative;
  z-index: 2;
  text-align: center;
}

.bmi-value {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
}

.bmi-label {
  font-size: 1.25rem;
  color: #6B7280;
}

.bmi-scale {
  width: 100%;
  margin-bottom: 24px;
}

.bmi-category-row {
  display: flex;
  justify-content: space-between;
  font-weight: 500;
  margin-bottom: 8px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #E5E7EB;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-value {
  height: 100%;
  border-radius: 4px;
  width: 0;
  transition: width 0.5s ease, background-color 0.5s ease;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #6B7280;
}

/* Additional Metrics */
.additional-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  width: 100%;
  margin-bottom: 20px;
}

.metric-item {
  background: #F9FAFB;
  padding: 15px;
  border-radius: 8px;
  text-align: center;
}

.metric-label {
  font-size: 0.875rem;
  color: #6B7280;
  margin-bottom: 5px;
}

.metric-value {
  font-weight: 600;
  color: #20B2AA;
}

.health-tip {
  margin-top: 1.5rem;
  padding: 1rem;
  background-color: #F0FDF4;
  border-radius: 0.5rem;
  border: 1px solid #D1FAE5;
}

.health-tip .title {
  color: #065F46;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.health-tip .content {
  color: #047857;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* History Styles */
.table-container {
  width: 100%;
  overflow-x: auto;
  margin-top: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  background-color: white;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}

th {
  background-color: #F8F9FA;
  padding: 16px;
  font-weight: 600;
  text-align: left;
  color: #4B5563;
  border-bottom: 2px solid #E5E7EB;
  white-space: nowrap;
}

td {
  padding: 16px;
  border-bottom: 1px solid #F3F4F6;
  vertical-align: middle;
}

/* Align specific columns */
td:nth-child(1) { /* Date column */
  white-space: nowrap;
}

td:nth-child(2) { /* BMI column */
  /* text-align: center; */
  font-weight: 600;
}

td:nth-child(3)/* Weight column */
td:nth-child(4) { /* Height column */
  /* text-align: center; */
}

/* Category badge styling */
.category-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
}

/* Action buttons column */
td:last-child {
  text-align: center;
  width: 80px;
}

.action-button {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: #6B7280;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.action-button:hover {
  background-color: #F3F4F6;
  color: #EF4444;
}

/* History chart container */
#history-chart-container {
  margin-top: 20px;
  padding: 20px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* History prompt styling */
.history-prompt {
  text-align: center;
  padding: 40px 20px;
  background-color: #F9FAFB;
  border-radius: 8px;
  margin: 20px 0;
}

.history-prompt h3 {
  color: #374151;
  margin-bottom: 8px;
}

.history-prompt p {
  color: #6B7280;
  margin-bottom: 16px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .table-container {
    margin: 10px -20px;
    border-radius: 0;
  }
  
  th, td {
    padding: 12px;
  }
  
  td:nth-child(4) { /* Height column */
    display: none;
  }
}

/* About BMI Section */
.about-bmi {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

@media (min-width: 768px) {
  .about-bmi {
    grid-template-columns: 2fr 1fr;
  }
}

.about-text h3 {
  margin-top: 20px;
  margin-bottom: 10px;
  color: #20B2AA;
}

.about-text p {
  margin-bottom: 15px;
  color: #4B5563;
}

.about-text ul {
  margin-left: 20px;
  margin-bottom: 15px;
}

.formula {
  background: #F3F4F6;
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  font-weight: 500;
  margin: 15px 0;
}

/* Categories Section */
.categories-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 640px) {
  .categories-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.category-card {
  background: #F9FAFB;
  padding: 16px;
  border-radius: 8px;
  text-align: center;
  transition: transform 0.3s;
}

.category-card:hover {
  transform: translateY(-5px);
}

.category-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  margin: 0 auto 8px;
}

.category-name {
  font-weight: 500;
  margin-bottom: 4px;
}

.category-range {
  font-size: 0.75rem;
  color: #6B7280;
}

/* Health Tips Section */
.tips-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 640px) {
  .tips-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 768px) {
  .tips-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.tip-card {
  background: white;
  padding: 24px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

.tip-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.tip-icon {
  width: 60px;
  height: 60px;
  background: rgba(32, 178, 170, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 15px;
  color: #20B2AA;
  font-size: 24px;
}

.tip-card h3 {
  margin-bottom: 10px;
  color: #20B2AA;
}

.tip-card p {
  color: #6B7280;
  font-size: 0.9rem;
}

/* Footer Styles */
.footer {
  background: #1F2937;
  color: white;
  padding: 40px 0 20px;
  margin-top: 60px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

@media (min-width: 768px) {
  .footer-content {
    grid-template-columns: repeat(3, 1fr);
  }
}

.footer-section h3 {
  font-size: 1.25rem;
  margin-bottom: 15px;
  color: #20B2AA;
}

.footer-section p {
  color: #D1D5DB;
  margin-bottom: 10px;
}

.social-icons {
  display: flex;
  gap: 15px;
  margin-top: 15px;
}

.social-icon {
  width: 36px;
  height: 36px;
  background: #374151;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: background 0.3s;
}

.social-icon:hover {
  background: #20B2AA;
}

.footer-links {
  list-style: none;
}

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

.footer-links a {
  color: #D1D5DB;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: #20B2AA;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  text-align: center;
  border-top: 1px solid #374151;
  margin-top: 30px;
}

.footer-bottom p {
  color: #9CA3AF;
  font-size: 0.875rem;
  margin-bottom: 5px;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  position: relative;
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
  color: #6B7280;
}

.modal h2 {
  text-align: center;
  margin-bottom: 10px;
  color: #20B2AA;
}

.modal p {
  text-align: center;
  color: #6B7280;
  margin-bottom: 20px;
}

.share-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.share-button {
  padding: 10px;
  border: none;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}

.share-button.facebook {
  background: #1877F2;
  color: white;
}

.share-button.twitter {
  background: #1DA1F2;
  color: white;
}

.share-button.whatsapp {
  background: #25D366;
  color: white;
}

.share-button.email {
  background: #EA4335;
  color: white;
}

.share-link {
  display: flex;
  gap: 10px;
}

.share-link input {
  flex: 1;
  padding: 10px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
}

.share-link button {
  background: #20B2AA;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0 15px;
  cursor: pointer;
  transition: background 0.2s;
}

.share-link button:hover {
  background: #1a8f89;
}

/* Animation */
.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

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

/* Hide Imperial inputs by default */
#imperial-inputs {
  display: none;
}

/* Hide results section by default */
#results-section {
  display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  
  .header-content h1 {
    font-size: 2rem;
  }
  
  .section-title {
    font-size: 1.75rem;
  }
}

.notification {
  position: fixed;
  top: 80px;
  right: 20px;
  padding: 16px 24px;
  color: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1002;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 300px;
  max-width: 400px;
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.3s ease-out, opacity 0.3s ease-out, background-color 0.3s ease;
  font-size: 16px;
  font-weight: 500;
  animation: notification-bounce 0.5s ease-out;
}

.notification.hide {
  transform: translateY(-100%);
  opacity: 0;
}

#notification-message {
  flex-grow: 1;
  margin-right: 12px;
  font-size: 15px;
  line-height: 1.4;
}

.notification-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.notification-close:hover {
  opacity: 1;
}

@keyframes notification-bounce {
  0% { transform: translateY(-20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* Back button styles */
.back-nav {
  position: absolute;
  top: 20px;
  left: 20px;
}

.back-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background-color: white;
  border-radius: 8px;
  color: #20B2AA;
  text-decoration: none;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.back-button:hover {
  background-color: #f8f8f8;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.back-button i {
  font-size: 14px;
}

/* Adjust auth-page padding to accommodate back button */
.auth-page {
  padding-top: 60px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .back-nav {
    top: 16px;
    left: 16px;
  }
  
  .back-button {
    padding: 8px 12px;
    font-size: 14px;
  }
}
