/* Custom CSS for Compute BMI Calculator */
/* This file contains styles that complement Tailwind CSS */

/* CSS Custom Properties for Design System */
:root {
  --brand-blue: #4A90E2;
  --brand-blue-hover: #357ABD;
  --brand-blue-dark: #2C5282;
  --health-green: #48BB78;
  --health-yellow: #ED8936;
  --health-red: #F56565;
  --health-light-blue: #4299E1;
  --text-primary: #2D3748;
  --text-secondary: #718096;
  --border-light: #E2E8F0;
  --bg-light: #F7FAFC;
}

/* Smooth scrolling for browsers that don't support the CSS property */
html {
  scroll-behavior: smooth;
}

/* Focus styles for accessibility */
*:focus {
  outline: none;
}

/* Navigation link styles */
.nav-link {
  @apply text-text-secondary hover:text-text-primary font-medium transition-colors duration-200 relative;
}

.nav-link.active {
  @apply text-brand-blue font-semibold;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--brand-blue);
  transition: width 0.2s ease;
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

/* Mobile navigation link styles */
.mobile-nav-link {
  @apply block px-3 py-2 text-base font-medium text-text-secondary hover:text-text-primary hover:bg-gray-50 rounded-md transition-colors duration-200;
}

/* Form input styles */
.form-input {
  @apply w-full px-4 py-3 border border-border-light rounded-xl focus:ring-2 focus:ring-brand-blue focus:border-brand-blue transition-all duration-300 bg-white shadow-sm hover:shadow-md;
  min-width: 200px;
}

/* Consistent input widths */
#height-ft, #height-in {
  min-width: 120px;
}

#waist {
  max-width: 300px;
}

.form-input:invalid {
  @apply border-red-300 focus:ring-red-500 focus:border-red-500;
}

.form-select {
  @apply w-full px-4 py-3 border border-border-light rounded-xl focus:ring-2 focus:ring-brand-blue focus:border-brand-blue transition-all duration-300 bg-white shadow-sm hover:shadow-md;
}

.form-radio {
  @apply text-brand-blue focus:ring-brand-blue focus:ring-2;
}

/* Unit toggle button styles */
.unit-toggle {
  @apply text-text-secondary bg-transparent transition-all duration-300 relative z-10;
}

.unit-toggle.active {
  @apply text-brand-blue font-bold;
}

.unit-toggle:not(.active) {
  @apply text-text-secondary;
}

.unit-toggle:hover:not(.active) {
  @apply text-text-primary;
}

/* BMI pointer animation */
#bmi-pointer {
  transition: left 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* FAQ accordion styles */
.faq-item {
  @apply bg-white border border-border-light rounded-lg overflow-hidden transition-all duration-200;
}

.faq-item:hover {
  @apply shadow-md;
}

.faq-question {
  @apply w-full text-left px-6 py-4 flex items-center font-medium text-text-primary hover:bg-gray-50 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-brand-blue focus:ring-inset;
}

.faq-answer {
  @apply px-6 pb-4 text-text-secondary;
}

.faq-icon {
  @apply w-5 h-5 text-text-secondary transform transition-transform duration-200 flex-shrink-0;
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
}

/* Blog card styles */
.blog-card {
  @apply bg-white rounded-lg shadow-md overflow-hidden transition-all duration-300 hover:shadow-lg hover:scale-105;
}

.blog-card:hover {
  transform: translateY(-4px);
}

/* Line clamp utilities */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Loading states */
.loading {
  @apply opacity-50 pointer-events-none;
}

.pulse-animation {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Number input animations */
.number-counter {
  animation: countUp 1s ease-out;
}

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

/* Tooltip styles */
.tooltip {
  @apply absolute z-10 px-3 py-2 text-sm font-medium text-white bg-gray-900 rounded-lg shadow-sm opacity-0 transition-opacity duration-300;
}

.tooltip.show {
  @apply opacity-100;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sr-only:focus {
  position: static;
  width: auto;
  height: auto;
  padding: inherit;
  margin: inherit;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  #bmi-pointer {
    transition: none !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border-light: #000000;
    --text-secondary: #000000;
  }
  
  .form-input,
  .form-select {
    border-width: 2px;
  }
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  body {
    -webkit-print-color-adjust: exact;
    color-adjust: exact;
  }
}

/* Mobile optimizations */
@media (max-width: 767px) {
  /* Ensure touch targets are at least 44px */
  button,
  input,
  select,
  textarea,
  a {
    min-height: 44px;
  }
  
  /* Prevent zoom on input focus on iOS */
  input[type="number"],
  input[type="text"],
  select {
    font-size: 16px;
  }
} 

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: #4A90E2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

.error-message {
    color: #ED8936; /* Orange color for warnings */
    font-size: 0.875rem; /* 14px */
    margin-top: 0.5rem; /* 8px */
    display: none; /* Hidden by default */
}

.nav-link {
    @apply text-text-secondary hover:text-text-primary transition-colors duration-200 font-medium pb-1 border-b-2 border-transparent hover:border-brand-blue;
} 