/* =============================================
   KITCHEN MAGIC - 1970s RETRO COOKBOOK
   Harvest gold, burnt orange, and good vibes
   ============================================= */

:root {
  /* Retro Color Palette */
  --harvest-gold: #F4Af3a;
  --burnt-orange: #D2691E;
  --avocado: #8B9456;
  --mushroom: #A68B7B;
  --cream: #FFF8E7;
  --cocoa: #4A3728;
  --rust: #B7410E;
  
  /* Typography */
  --font-display: 'Covered By Your Grace', cursive;
  --font-body: 'Merriweather', serif;
  
  /* Spacing (irregular for charm) */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 36px;
  --space-5: 48px;
  --space-6: 72px;
}

/* =============================================
   RESET & BASE
   ============================================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--cocoa);
  background: linear-gradient(135deg, #FFF8E7 0%, #F5E6D3 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Paper texture */
  background-image: 
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.02) 2px, rgba(0,0,0,0.02) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0,0,0,0.02) 2px, rgba(0,0,0,0.02) 4px);
}

main {
  flex: 1;
  padding: var(--space-4) 0;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-3);
}

/* =============================================
   TYPOGRAPHY
   ============================================= */

h1 {
  font-family: var(--font-display);
  font-size: clamp(48px, 8vw, 72px);
  color: var(--burnt-orange);
  line-height: 1.1;
  font-weight: 400;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.1);
}

h2 {
  font-family: var(--font-body);
  font-size: clamp(22px, 4vw, 28px);
  color: var(--cocoa);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.handwritten {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--burnt-orange);
}

a {
  color: var(--burnt-orange);
  text-decoration: underline;
  text-decoration-style: wavy;
}

a:hover {
  color: var(--rust);
}

/* =============================================
   HEADER
   ============================================= */

header {
  background: var(--harvest-gold);
  padding: var(--space-5) 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 0 var(--burnt-orange);
}

header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(255,255,255,0.1) 10px,
    rgba(255,255,255,0.1) 20px
  );
  pointer-events: none;
}

.title-card {
  background: var(--cream);
  padding: var(--space-4);
  border: 4px solid var(--cocoa);
  box-shadow: 
    8px 8px 0 var(--burnt-orange),
    8px 8px 0 0 var(--cocoa);
  position: relative;
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
  transform: rotate(-1deg);
}

.title-decoration {
  font-size: 48px;
  color: var(--burnt-orange);
  line-height: 1;
}

.title-decoration.bottom {
  transform: rotate(180deg);
  display: inline-block;
}

.tagline {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--mushroom);
  margin-top: var(--space-2);
}

.settings-tab {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: var(--burnt-orange);
  color: var(--cream);
  border: 3px solid var(--cocoa);
  padding: var(--space-1) var(--space-3);
  font-family: var(--font-display);
  font-size: 18px;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--cocoa);
  transition: all 0.2s;
}

.settings-tab:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--cocoa);
}

.settings-tab:active {
  transform: translate(4px, 4px);
  box-shadow: none;
}

/* =============================================
   RECIPE CARDS (Main Layout Element)
   ============================================= */

.recipe-card {
  background: var(--cream);
  border: 3px solid var(--cocoa);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  box-shadow: 
    6px 6px 0 rgba(74, 55, 40, 0.2),
    10px 10px 0 rgba(183, 65, 14, 0.15);
  position: relative;
}

/* Intentional asymmetry - alternating rotations */
.recipe-card:nth-child(odd) {
  transform: rotate(0.5deg);
}

.recipe-card:nth-child(even) {
  transform: rotate(-0.8deg);
}

/* =============================================
   SETUP NOTICE
   ============================================= */

.setup-notice {
  margin-bottom: var(--space-5);
}

.setup-card {
  background: linear-gradient(135deg, #FFF5E1 0%, #FFE4B5 100%);
  border: 3px solid var(--burnt-orange);
  box-shadow: 
    8px 8px 0 rgba(210, 105, 30, 0.2),
    inset 0 2px 8px rgba(255, 255, 255, 0.5);
}

.setup-card .card-header h2 {
  font-size: clamp(24px, 5vw, 32px);
  color: var(--burnt-orange);
}

.setup-intro {
  font-size: 18px;
  margin-bottom: var(--space-4);
  color: var(--cocoa);
  line-height: 1.6;
}

.setup-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.setup-step {
  display: flex;
  gap: var(--space-3);
  align-items: start;
}

.step-number {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: var(--burnt-orange);
  color: var(--cream);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 28px;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.15);
}

.step-content {
  flex: 1;
}

.step-content strong {
  display: block;
  font-size: 18px;
  color: var(--burnt-orange);
  margin-bottom: var(--space-1);
  font-weight: 700;
}

.step-content p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--cocoa);
}

.step-content a {
  color: var(--rust);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-color: var(--harvest-gold);
}

.step-content a:hover {
  color: var(--burnt-orange);
  background: var(--harvest-gold);
  padding: 2px 4px;
  text-decoration: none;
}

.recipe-note {
  background: #FFF8DC;
  border: 2px dashed var(--mushroom);
  padding: var(--space-3);
  margin-bottom: var(--space-4);
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--cocoa);
  box-shadow: 4px 4px 0 rgba(0,0,0,0.1);
}

.note-header {
  font-size: 22px;
  color: var(--burnt-orange);
  margin-bottom: var(--space-1);
}

.card-header {
  border-bottom: 2px solid var(--harvest-gold);
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-number {
  background: var(--burnt-orange);
  color: var(--cream);
  padding: 4px 12px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  border: 2px solid var(--cocoa);
  box-shadow: 2px 2px 0 var(--cocoa);
}

.card-body {
  position: relative;
}

.step {
  padding: var(--space-2);
  margin: var(--space-2) 0;
  background: rgba(255, 248, 231, 0.5);
  border-left: 4px solid var(--avocado);
  font-size: 17px;
}

.handwritten-note {
  font-family: var(--font-display);
  font-size: 19px;
  color: var(--burnt-orange);
  margin-top: var(--space-3);
  padding: var(--space-2);
  background: rgba(244, 175, 58, 0.1);
  border: 2px dashed var(--harvest-gold);
}

/* =============================================
   POLAROID-STYLE UPLOAD
   ============================================= */

.polaroid-frame {
  background: white;
  padding: 20px 20px 60px 20px;
  box-shadow: 
    0 4px 8px rgba(0,0,0,0.15),
    0 8px 16px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: all 0.3s;
  max-width: 400px;
  margin: 0 auto var(--space-4) auto;
  position: relative;
}

.polaroid-frame:hover {
  transform: rotate(2deg) scale(1.02);
}

.polaroid-content {
  aspect-ratio: 4/3;
  background: #F5F5F0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid #DDD;
}

.camera-icon {
  font-size: 56px;
  margin-bottom: var(--space-2);
  filter: grayscale(100%);
}

.polaroid-content p {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--mushroom);
}

.polaroid-preview {
  background: white;
  padding: 20px 20px 60px 20px;
  box-shadow: 
    0 4px 8px rgba(0,0,0,0.15),
    0 8px 16px rgba(0,0,0,0.1);
  max-width: 500px;
  margin: 0 auto var(--space-4) auto;
  position: relative;
  transform: rotate(-1.5deg);
}

.polaroid-preview img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid #DDD;
}

.polaroid-label {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--cocoa);
  text-align: center;
  margin-top: 12px;
}

.remove-photo {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--rust);
  color: white;
  border: 2px solid var(--cocoa);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  transition: all 0.2s;
}

.remove-photo:hover {
  background: var(--burnt-orange);
  transform: rotate(90deg);
}

/* =============================================
   RETRO BUTTONS
   ============================================= */

.retro-button {
  background: var(--harvest-gold);
  color: var(--cocoa);
  border: 3px solid var(--cocoa);
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-display);
  font-size: 22px;
  cursor: pointer;
  box-shadow: 5px 5px 0 var(--burnt-orange);
  transition: all 0.2s;
  display: block;
  width: 100%;
  margin: var(--space-3) auto;
  max-width: 400px;
}

.retro-button:hover:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 3px 3px 0 var(--burnt-orange);
}

.retro-button:active {
  transform: translate(5px, 5px);
  box-shadow: none;
}

.retro-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.retro-button.save {
  background: var(--avocado);
  color: white;
}

.retro-button.clear {
  background: var(--mushroom);
  color: white;
  box-shadow: 5px 5px 0 var(--cocoa);
}

/* =============================================
   FORM INPUTS
   ============================================= */
.form-group {
  margin-bottom: var(--spacing-md);
}

label {
  display: block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 16px;
  margin-bottom: var(--space-2);
  color: var(--cocoa);
}

input, select, textarea {
  width: 100%;
  padding: var(--space-2);
  font-family: var(--font-body);
  font-size: 16px;
  border: 3px solid var(--mushroom);
  background: var(--cream);
  color: var(--cocoa);
  transition: all 0.2s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--burnt-orange);
  box-shadow: 0 0 0 4px rgba(210, 105, 30, 0.15);
}

.help-note {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--mushroom);
  margin-top: var(--space-2);
}

/* =============================================
   INGREDIENTS SECTION
   ============================================= */

.ingredients-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.ingredient-item {
  background: rgba(244, 175, 58, 0.1);
  border: 2px solid var(--avocado);
  padding: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 16px;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.1);
}

.ingredient-item::before {
  content: '✓';
  color: var(--avocado);
  font-weight: 700;
  font-size: 20px;
}

.add-ingredient-section {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 2px dashed var(--mushroom);
}

.ingredient-input-group {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.ingredient-input-group input {
  flex: 1;
}

.add-btn {
  background: var(--avocado);
  color: white;
  border: 3px solid var(--cocoa);
  width: 50px;
  height: 50px;
  font-size: 28px;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--cocoa);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.add-btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--cocoa);
}

/* =============================================
   MEALS COLLECTION
   ============================================= */

.meals-collection {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.meal-recipe {
  background: white;
  border: 3px solid var(--cocoa);
  padding: var(--space-4);
  box-shadow: 6px 6px 0 var(--harvest-gold);
  position: relative;
}

.meal-recipe:nth-child(even) {
  margin-left: var(--space-4);
}

.meal-recipe:nth-child(odd) {
  margin-right: var(--space-4);
}

.meal-title {
  font-family: var(--font-display);
  font-size: 32px;
  color: var(--burnt-orange);
  margin-bottom: var(--space-2);
  border-bottom: 3px solid var(--harvest-gold);
  padding-bottom: var(--space-2);
}

.meal-description {
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: var(--space-3);
  color: var(--cocoa);
}

.recipe-section {
  margin: var(--space-3) 0;
}

.recipe-section h4 {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 700;
  color: var(--cocoa);
  margin-bottom: var(--space-2);
  text-decoration: underline;
  text-decoration-color: var(--harvest-gold);
  text-decoration-thickness: 3px;
}

.recipe-section ul {
  list-style: none;
  padding-left: 0;
}

.recipe-section li {
  padding: var(--space-1) 0 var(--space-1) var(--space-3);
  position: relative;
  font-size: 15px;
  line-height: 1.6;
}

.recipe-section li::before {
  content: '~';
  position: absolute;
  left: 0;
  color: var(--burnt-orange);
  font-size: 20px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover:not(:disabled) {
  background-color: var(--primary-color);
  color: white;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Spinner */
.spinner-sm {
  display: inline-block;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Alert Messages */
.alert {
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-md);
}

.alert-warning {
  background-color: #fff3cd;
  color: #856404;
  border-left: 4px solid var(--warning-color);
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border-left: 4px solid var(--success-color);
}

.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
  border-left: 4px solid var(--danger-color);
}

/* =============================================
   MODAL
   ============================================= */

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  inset: 0;
  background: rgba(74, 55, 40, 0.8);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-card {
  background: var(--cream);
  border: 4px solid var(--cocoa);
  padding: 0;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 
    10px 10px 0 var(--burnt-orange),
    10px 10px 0 0 var(--cocoa);
  position: relative;
  transform: rotate(-0.5deg);
}

.modal-card .card-header {
  background: var(--harvest-gold);
  padding: var(--space-3);
  margin: 0;
  border-bottom: 3px solid var(--cocoa);
}

.modal-card .card-header h2 {
  margin: 0;
}

.modal-body {
  padding: var(--space-4);
}

.modal-close {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  background: var(--rust);
  color: white;
  border: 2px solid var(--cocoa);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--burnt-orange);
  transform: rotate(90deg);
}

.button-row {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.button-row .retro-button {
  width: auto;
  flex: 1;
  margin: 0;
}

#settingsMessage {
  margin-top: var(--space-3);
  padding: var(--space-2);
  border: 2px solid;
  font-family: var(--font-display);
  font-size: 16px;
}

#settingsMessage.alert-success {
  border-color: var(--avocado);
  background: rgba(139, 148, 86, 0.1);
  color: var(--avocado);
}

#settingsMessage.alert-danger {
  border-color: var(--rust);
  background: rgba(183, 65, 14, 0.1);
  color: var(--rust);
}

/* =============================================
   FOOTER
   ============================================= */

.footer {
  background: var(--burnt-orange);
  padding: var(--space-4) 0;
  margin-top: var(--space-6);
  border-top: 5px solid var(--cocoa);
  text-align: center;
}

.footer-text {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--cream);
  margin-bottom: var(--space-1);
}

.footer-note {
  font-family: var(--font-display);
  font-size: 18px;
  color: rgba(255, 248, 231, 0.8);
}

/* =============================================
   SPINNER
   ============================================= */

.spinner-sm {
  display: inline-block;
  border: 3px solid var(--cream);
  border-top-color: var(--burnt-orange);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =============================================
   UTILITIES
   ============================================= */

.hidden {
  display: none !important;
}

/* Footer */
.footer {
  background-color: var(--bg-white);
  border-top: 1px solid var(--border-color);
  padding: var(--spacing-md);
  margin-top: var(--spacing-xl);
}

/* Utility Classes */
.hidden {
  display: none !important;
}

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

.text-muted {
  color: var(--text-light);
}

/* ============================================
   MEALPREP-SPECIFIC STYLES
   ============================================ */

/* Instructions List */
.instructions-list {
  padding-left: 1.5rem;
  line-height: 1.8;
}

.instructions-list li {
  margin-bottom: 0.5rem;
}

.tip {
  background-color: #fff3cd;
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-top: 1rem;
  border-left: 4px solid var(--warning-color);
}

/* Upload Area */
.upload-area {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: var(--bg-white);
}

.upload-area:hover {
  border-color: var(--primary-color);
  background-color: #f0f7ff;
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.upload-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.upload-subtext {
  font-size: 0.9rem;
  color: var(--text-light);
}

/* Image Preview */
.image-preview {
  position: relative;
  margin: 1rem 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.image-preview img {
  width: 100%;
  height: auto;
  display: block;
}

.btn-remove {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background-color: var(--danger-color);
  color: white;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  font-size: 1.2rem;
  line-height: 1;
}

.btn-remove:hover {
  background-color: #c0392b;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  width: 100%;
}

/* Ingredients List */
.ingredients-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.ingredient-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background-color: var(--bg-light);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.ingredient-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.ingredient-name {
  font-weight: 600;
  color: var(--text-dark);
  font-size: 1rem;
}

.ingredient-quantity {
  font-size: 0.85rem;
  color: var(--text-light);
}

.confidence-badge {
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.confidence-high {
  background-color: #d4edda;
  color: #155724;
}

.confidence-medium {
  background-color: #fff3cd;
  color: #856404;
}

.confidence-low {
  background-color: #f8d7da;
  color: #721c24;
}

.confidence-manual {
  background-color: #d1ecf1;
  color: #0c5460;
}

/* Add Ingredient */
.add-ingredient-group {
  display: flex;
  gap: 0.5rem;
}

.add-ingredient-group input {
  flex: 1;
}

/* Meals Grid */
.meals-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.meal-card {
  background-color: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  transition: transform 0.2s, box-shadow 0.2s;
}

.meal-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.meal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.meal-header h3 {
  font-size: 1.3rem;
  color: var(--primary-color);
  margin: 0;
}

.meal-time {
  background-color: var(--bg-light);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--text-light);
}

.meal-description {
  color: var(--text-dark);
  margin-bottom: 1rem;
  line-height: 1.6;
}

/* Macros Display */
.meal-macros {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background-color: var(--bg-light);
  border-radius: var(--radius-md);
}

.macro-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.macro-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.macro-label {
  font-size: 0.8rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.meal-servings {
  color: var(--text-light);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.health-notes {
  background-color: #d4edda;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: #155724;
}

/* Recipe Details */
.meal-details {
  margin-top: 1rem;
}

.meal-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--primary-color);
  padding: 0.75rem;
  background-color: var(--bg-light);
  border-radius: var(--radius-md);
  user-select: none;
  transition: background-color 0.2s;
}

.meal-details summary:hover {
  background-color: #e8f4f8;
}

.recipe-content {
  padding: 1.5rem 1rem;
  border-left: 3px solid var(--primary-color);
  margin-left: 0.75rem;
  margin-top: 1rem;
}

.recipe-content h4 {
  margin-bottom: 0.75rem;
  color: var(--text-dark);
  font-size: 1.1rem;
}

.ingredients-used,
.instructions {
  padding-left: 1.5rem;
  line-height: 1.8;
}

.ingredients-used li,
.instructions li {
  margin-bottom: 0.5rem;
}

.instructions li {
  margin-bottom: 1rem;
}

/* =============================================
   RESPONSIVE DESIGN
   ============================================= */

@media (max-width: 900px) {
  .recipe-card {
    padding: var(--space-3);
  }

  .meal-recipe:nth-child(even),
  .meal-recipe:nth-child(odd) {
    margin-left: 0;
    margin-right: 0;
  }

  .polaroid-frame,
  .polaroid-preview {
    max-width: 100%;
  }

  .ingredients-checklist {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  h1 {
    font-size: 48px;
  }

  .container {
    padding: 0 var(--space-2);
  }

  .title-card {
    padding: var(--space-3);
    box-shadow: 
      4px 4px 0 var(--burnt-orange),
      4px 4px 0 0 var(--cocoa);
  }

  .settings-tab {
    position: static;
    width: 100%;
    margin-top: var(--space-3);
  }

  .modal-card {
    width: 95%;
    box-shadow: 
      6px 6px 0 var(--burnt-orange),
      6px 6px 0 0 var(--cocoa);
  }

  .modal-body {
    padding: var(--space-3);
  }

  .button-row {
    flex-direction: column;
  }

  .ingredient-input-group {
    flex-direction: column;
  }

  .add-btn {
    width: 100%;
  }

  .meal-title {
    font-size: 24px;
  }
}

/* =============================================
   PRINT STYLES
   ============================================= */

@media print {
  body {
    background: white;
  }

  header,
  footer,
  .settings-tab,
  button {
    display: none;
  }

  .recipe-card {
    box-shadow: none;
    border: 2px solid var(--cocoa);
    page-break-inside: avoid;
    transform: none;
  }
}

/* =============================================
   ERROR NOTIFICATIONS
   ============================================= */

.error-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  max-width: 400px;
  opacity: 0;
  transform: translateX(450px);
  transition: all 0.3s ease-out;
}

.error-notification.show {
  opacity: 1;
  transform: translateX(0);
}

.error-content {
  background: white;
  border-radius: 8px;
  padding: var(--space-3);
  box-shadow: 
    0 4px 6px rgba(0, 0, 0, 0.1),
    0 10px 20px rgba(0, 0, 0, 0.15);
  border-left: 5px solid var(--rust);
  font-family: var(--font-body);
}

.error-content.warning {
  border-left-color: var(--harvest-gold);
}

.error-content.error {
  border-left-color: var(--rust);
}

.error-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  font-weight: bold;
  color: var(--cocoa);
}

.error-icon {
  font-size: 1.5em;
  flex-shrink: 0;
}

.error-close {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 1.5em;
  cursor: pointer;
  color: var(--cocoa);
  opacity: 0.6;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

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

.error-message {
  color: var(--cocoa);
  line-height: 1.5;
  font-size: 0.95em;
}

/* Mobile responsive error notifications */
@media (max-width: 768px) {
  .error-notification {
    right: 10px;
    left: 10px;
    max-width: none;
    top: 10px;
    transform: translateY(-100px);
  }
  
  .error-notification.show {
    transform: translateY(0);
  }
  
  .error-content {
    padding: var(--space-2);
  }
}
