/* Family Meal Wizard - Custom Styles */
.grecaptcha-badge { 
  visibility: hidden !important;
}

@media (min-width: 1200px) {
  .swal-modal-popup {
    width: 80% !important;
  }
}
/* Base styles and CSS custom properties */
:root {
  --primary-blue: #3A4B5C;
  --primary-blue-dark: #2D3748;
  --primary-blue-light: #5A73A0;
  --secondary-blue: #8BB4E8;
  --accent-orange: #f59e0b;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --border-radius-sm: 0.25rem;
  --border-radius-md: 0.5rem;
  --border-radius-lg: 0.75rem;
}

/* Reset and base styles */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Recipe tags styling */
.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.recipe-tag {
  display: inline-block;
  background-color: var(--gray-100);
  color: var(--gray-700);
  padding: 0.25rem 0.5rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: lowercase;
}

/* Focus styles for accessibility */
:focus {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Skip to main content link for screen readers */
.skip-to-main {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary-blue);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: var(--border-radius-sm);
  z-index: 1000;
}

.skip-to-main:focus {
  top: 6px;
}

/* Screen reader only content */
.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;
}

/* Loading states */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: var(--primary-blue);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Button styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--border-radius-md);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  position: relative;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background-color: var(--primary-blue);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--primary-blue-dark);
}

.btn-secondary {
  background-color: var(--gray-200);
  color: var(--gray-700);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--gray-300);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1.125rem;
}

/* Form styles */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--gray-700);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius-md);
  font-size: 1rem;
  transition: border-color 0.2s ease-in-out;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary-blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(58, 75, 92, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

/* Checkbox and radio styles */
.form-checkbox,
.form-radio {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.form-checkbox input,
.form-radio input {
  margin-right: 0.5rem;
  width: auto;
}

/* Card styles */
.card {
  background: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  transition: box-shadow 0.2s ease-in-out;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
}

/* Alert styles */
.alert {
  padding: 1rem;
  border-radius: var(--border-radius-md);
  margin-bottom: 1rem;
}

.alert-success {
  background-color: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-error {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.alert-warning {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.alert-info {
  background-color: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

/* Recipe card specific styles */
.recipe-card {
  position: relative;
}

.recipe-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--gray-100);
}

.recipe-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.5rem;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  border-radius: var(--border-radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
}

.recipe-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-top: 0.5rem;
}

.recipe-meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Meal plan grid */
.meal-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.meal-day {
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
}

.meal-day-header {
  background: var(--primary-blue);
  color: white;
  padding: 1rem;
  font-weight: 600;
}

.meal-day-content {
  padding: 1rem;
}

/* Shopping list styles */
.shopping-category {
  margin-bottom: 2rem;
}

.shopping-category-title {
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--gray-200);
}

.shopping-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.shopping-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--gray-100);
}

.shopping-item:last-child {
  border-bottom: none;
}

.shopping-checkbox {
  margin-right: 0.75rem;
}

.shopping-item-text {
  flex: 1;
}

.shopping-item-price {
  color: var(--gray-600);
  font-weight: 500;
}

/* Print styles */
@media print {
  body {
    font-size: 12pt;
    line-height: 1.4;
    color: black;
  }
  
  .no-print {
    display: none !important;
  }
  
  .print-break {
    page-break-before: always;
  }
  
  .card {
    border: 1px solid #ccc;
    box-shadow: none;
    margin-bottom: 1rem;
  }
  
  .recipe-card {
    break-inside: avoid;
  }
  
  .meal-plan-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .shopping-category {
    break-inside: avoid;
  }
  
  a {
    color: black;
    text-decoration: none;
  }
  
  .btn {
    background: none;
    border: 1px solid #ccc;
    color: black;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --gray-50: #ffffff;
    --gray-100: #f0f0f0;
    --gray-200: #d0d0d0;
    --gray-600: #404040;
    --gray-700: #202020;
    --gray-800: #101010;
    --gray-900: #000000;
  }
  
  .card {
    border: 2px solid var(--gray-900);
  }
  
  .btn {
    border: 2px solid currentColor;
  }
}

/* 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;
  }
}

/* Mobile responsiveness */
@media (max-width: 640px) {
  .meal-plan-grid {
    grid-template-columns: 1fr;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  .btn-lg {
    width: 100%;
  }
  
  /* Make SweetAlert2 toasts smaller on mobile */
  .swal2-popup.swal2-toast {
    max-width: 280px !important;
    font-size: 0.875rem !important;
    padding: 0.75rem !important;
  }
  
  .swal2-toast .swal2-title {
    font-size: 1rem !important;
    margin-bottom: 0.25rem !important;
  }
  
  .swal2-toast .swal2-content {
    font-size: 0.8rem !important;
    margin: 0 !important;
  }
  
  .swal2-toast .swal2-icon {
    width: 1.5rem !important;
    height: 1.5rem !important;
    margin: 0 0.5rem 0 0 !important;
  }
}

/* Utility classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }

.p-4 { padding: 1rem; }
.p-8 { padding: 2rem; }

.hidden { display: none; }
.block { display: block; }
.flex { display: flex; }
.grid { display: grid; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }

.rounded { border-radius: var(--border-radius-md); }
.rounded-lg { border-radius: var(--border-radius-lg); }

.shadow { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.border { border: 1px solid var(--gray-200); }
.border-t { border-top: 1px solid var(--gray-200); }
.border-b { border-bottom: 1px solid var(--gray-200); }

.bg-white { background-color: var(--white); }
.bg-gray-50 { background-color: var(--gray-50); }
.bg-gray-100 { background-color: var(--gray-100); }

.text-gray-600 { color: var(--gray-600); }
.text-gray-700 { color: var(--gray-700); }
.text-gray-800 { color: var(--gray-800); }
.text-gray-900 { color: var(--gray-900); }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }