/* Main CSS - Non-critical styles loaded asynchronously */

/* Extended color palette */
:root {
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 0 0% 98%;
  --accent: 0 0% 96.1%;
  --accent-foreground: 0 0% 9%;
  --popover: 0 0% 100%;
  --popover-foreground: 0 0% 3.9%;
  --chart-1: 12 76% 61%;
  --chart-2: 173 58% 39%;
  --chart-3: 197 37% 24%;
  --chart-4: 43 74% 66%;
  --chart-5: 27 87% 67%;
}

.dark {
  --background: 0 0% 3.9%;
  --foreground: 0 0% 98%;
  --card: 0 0% 3.9%;
  --card-foreground: 0 0% 98%;
  --popover: 0 0% 3.9%;
  --popover-foreground: 0 0% 98%;
  --primary: 0 0% 98%;
  --primary-foreground: 0 0% 9%;
  --secondary: 0 0% 14.9%;
  --secondary-foreground: 0 0% 98%;
  --muted: 0 0% 14.9%;
  --muted-foreground: 0 0% 63.9%;
  --accent: 0 0% 14.9%;
  --accent-foreground: 0 0% 98%;
  --destructive: 0 62.8% 30.6%;
  --destructive-foreground: 0 0% 98%;
  --border: 0 0% 14.9%;
  --input: 0 0% 14.9%;
  --ring: 0 0% 83.1%;
  --chart-1: 220 70% 50%;
  --chart-2: 160 60% 45%;
  --chart-3: 30 80% 55%;
  --chart-4: 280 65% 60%;
  --chart-5: 340 75% 55%;
}

/* Results section styles */
.results-container {
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

.results-header {
  padding: 1.5rem 1.5rem 0;
  text-align: center;
}

.results-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: rgb(21 128 61);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1.5rem;
  padding: 1.5rem;
}

@media (min-width: 768px) {
  .results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .results-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Result card styles */
.result-card {
  text-align: center;
  padding: 1rem;
  border-radius: 0.5rem;
}

.result-card-blue {
  background-color: rgb(239 246 255);
}

.result-card-green {
  background-color: rgb(240 253 244);
}

.result-card-purple {
  background-color: rgb(250 245 255);
}

.result-card-orange {
  background-color: rgb(255 247 237);
}

.result-card-red {
  background-color: rgb(254 242 242);
}

.result-card-yellow {
  background-color: rgb(254 252 232);
}

.result-card-indigo {
  background-color: rgb(238 242 255);
}

.result-label {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.result-label-blue {
  color: rgb(29 78 216);
}

.result-label-green {
  color: rgb(21 128 61);
}

.result-label-purple {
  color: rgb(126 34 206);
}

.result-label-orange {
  color: rgb(194 65 12);
}

.result-label-red {
  color: rgb(185 28 28);
}

.result-label-yellow {
  color: rgb(161 98 7);
}

.result-label-indigo {
  color: rgb(67 56 202);
}

.result-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.result-value-blue {
  color: rgb(30 58 138);
}

.result-value-green {
  color: rgb(20 83 45);
}

.result-value-purple {
  color: rgb(88 28 135);
}

.result-value-orange {
  color: rgb(154 52 18);
}

.result-value-red {
  color: rgb(153 27 27);
}

.result-value-yellow {
  color: rgb(133 77 14);
}

.result-value-indigo {
  color: rgb(55 48 163);
}

.result-unit {
  font-size: 0.875rem;
  color: rgb(75 85 99);
}

/* Macronutrients section */
.macros-section {
  margin-top: 2rem;
}

.macros-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-align: center;
}

.macros-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1rem;
}

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

/* Educational content styles */
.educational-section {
  padding: 4rem 1rem;
  background-color: white;
}

.educational-container {
  max-width: 64rem;
  margin: 0 auto;
}

.educational-title {
  font-size: 1.875rem;
  text-align: center;
  color: rgb(17 24 39);
  margin-bottom: 2rem;
}

.educational-content {
  padding: 2rem;
}

.educational-text {
  font-size: 1.125rem;
  color: rgb(55 65 81);
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.educational-subtitle {
  font-size: 1.5rem;
  font-weight: 700;
  color: rgb(17 24 39);
  margin: 2rem 0 1.5rem;
}

.educational-subheading {
  font-size: 1.25rem;
  font-weight: 600;
  color: rgb(31 41 55);
  margin: 1.5rem 0 0.75rem;
}

.educational-list {
  list-style-type: disc;
  list-style-position: inside;
  color: rgb(55 65 81);
  margin-left: 1rem;
}

.educational-list li {
  margin-bottom: 0.25rem;
}

/* Pie chart representation */
.pie-chart-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .pie-chart-container {
    flex-direction: row;
  }
}

.pie-chart {
  position: relative;
  width: 16rem;
  height: 16rem;
  margin: 0 auto;
}

.pie-chart-circle {
  width: 16rem;
  height: 16rem;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
}

.pie-chart-center {
  position: absolute;
  inset: 1rem;
  background-color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pie-chart-label {
  font-size: 1.5rem;
  font-weight: 700;
  color: rgb(31 41 55);
}

.pie-legend {
  flex: 1;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.legend-color {
  width: 1rem;
  height: 1rem;
  border-radius: 0.25rem;
}

.legend-color-blue {
  background-color: rgb(96 165 250);
}

.legend-color-red {
  background-color: rgb(248 113 113);
}

.legend-color-green {
  background-color: rgb(74 222 128);
}

.legend-text {
  color: rgb(55 65 81);
}

/* Footer styles */
.footer {
  background-color: rgb(31 41 55);
  color: white;
  padding: 3rem 1rem 2rem;
}

.footer-container {
  max-width: 80rem;
  margin: 0 auto;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

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

.footer-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

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

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: rgb(209 213 219);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid rgb(75 85 99);
  padding-top: 2rem;
  text-align: center;
  color: rgb(156 163 175);
}

/* Form elements */
.radio-group {
  display: flex;
  gap: 1.5rem;
}

.radio-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.radio-input {
  width: 1rem;
  height: 1rem;
  border: 2px solid hsl(var(--border));
  border-radius: 50%;
  background-color: white;
}

.radio-input:checked {
  border-color: rgb(59 130 246);
  background-color: rgb(59 130 246);
}

.select-trigger {
  display: flex;
  align-items: center;
  justify-content: between;
  width: 100%;
  max-width: 28rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid hsl(var(--border));
  border-radius: 0.375rem;
  background-color: white;
  font-size: 0.875rem;
  cursor: pointer;
}

.select-trigger:focus {
  outline: 2px solid rgb(59 130 246);
  outline-offset: 2px;
  border-color: rgb(59 130 246);
}

/* Utility classes */
.space-y-6 > * + * {
  margin-top: 1.5rem;
}

.space-y-4 > * + * {
  margin-top: 1rem;
}

.space-y-2 > * + * {
  margin-top: 0.5rem;
}

.space-y-8 > * + * {
  margin-top: 2rem;
}

.max-w-md {
  max-width: 28rem;
}

.max-w-3xl {
  max-width: 48rem;
}

.max-w-4xl {
  max-width: 56rem;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.text-center {
  text-align: center;
}

.leading-relaxed {
  line-height: 1.625;
}

/* Performance optimizations */
.lazy-load {
  content-visibility: auto;
  contain-intrinsic-size: 200px;
}

/* Reduce paint complexity */
.rounded-lg {
  will-change: transform;
}

/* Optimize animations */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .calculator-card,
  .results-container {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
}
