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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: #faf6f1;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='%23d4a574' fill-opacity='0.15'%3E%3Cpath d='M20 20c0-2.2 1.8-4 4-4s4 1.8 4 4-1.8 4-4 4-4-1.8-4-4zm32 0c0-2.2 1.8-4 4-4s4 1.8 4 4-1.8 4-4 4-4-1.8-4-4zM36 36c0-2.2 1.8-4 4-4s4 1.8 4 4-1.8 4-4 4-4-1.8-4-4zm-16 16c0-2.2 1.8-4 4-4s4 1.8 4 4-1.8 4-4 4-4-1.8-4-4zm32 0c0-2.2 1.8-4 4-4s4 1.8 4 4-1.8 4-4 4-4-1.8-4-4z'/%3E%3Cpath d='M10 10l4 4m-4 0l4-4m52 0l4 4m-4 0l4-4M10 58l4 4m-4 0l4-4m52 0l4 4m-4 0l4-4' stroke='%23c17f59' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3Cellipse cx='40' cy='12' rx='6' ry='3'/%3E%3Cellipse cx='40' cy='68' rx='6' ry='3'/%3E%3Cpath d='M8 40h8M64 40h8' stroke='%23c17f59' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='40' cy='40' r='2'/%3E%3C/g%3E%3C/svg%3E");
  min-height: 100vh;
  padding: 2rem;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(193, 127, 89, 0.1) 0%, rgba(139, 90, 43, 0.15) 100%);
  pointer-events: none;
  z-index: -1;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
}

header {
  text-align: center;
  margin-bottom: 2rem;
  color: #5d4037;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: #4e342e;
  text-shadow: 1px 1px 2px rgba(255,255,255,0.5);
}

.subtitle {
  opacity: 0.85;
  font-size: 1.1rem;
  color: #6d4c41;
}

/* Options Section */
.options-section {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.cuisines h2 {
  margin-bottom: 1.5rem;
  color: #333;
}

/* Region Groups */
.region-group {
  margin-bottom: 1.25rem;
}

.region-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
}

.cuisine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.5rem;
}

.cuisine-btn {
  padding: 0.75rem 0.5rem;
  border: 2px solid;
  background: white;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Regional Color Schemes - Different Brown Tones */

/* Europe - Warm Tan/Beige */
.region-group[data-region="europe"] .region-label { color: #a08060; }
.cuisine-btn.region-europe {
  background: #c9a87c;
  border-color: #c9a87c;
  color: white;
}
.cuisine-btn.region-europe:hover {
  background: #b8976b;
  border-color: #b8976b;
}
.cuisine-btn.region-europe.selected {
  background: #8b7355;
  border-color: #8b7355;
  box-shadow: 0 0 0 3px rgba(201, 168, 124, 0.4);
}

/* Asia - Rich Terracotta */
.region-group[data-region="asia"] .region-label { color: #b86b4a; }
.cuisine-btn.region-asia {
  background: #c17f59;
  border-color: #c17f59;
  color: white;
}
.cuisine-btn.region-asia:hover {
  background: #a86d4a;
  border-color: #a86d4a;
}
.cuisine-btn.region-asia.selected {
  background: #8b5a3c;
  border-color: #8b5a3c;
  box-shadow: 0 0 0 3px rgba(193, 127, 89, 0.4);
}

/* Africa - Deep Chocolate Brown */
.region-group[data-region="africa"] .region-label { color: #6b4423; }
.cuisine-btn.region-africa {
  background: #8b5a2b;
  border-color: #8b5a2b;
  color: white;
}
.cuisine-btn.region-africa:hover {
  background: #7a4e25;
  border-color: #7a4e25;
}
.cuisine-btn.region-africa.selected {
  background: #5d3a1a;
  border-color: #5d3a1a;
  box-shadow: 0 0 0 3px rgba(139, 90, 43, 0.4);
}

/* Americas - Golden Amber */
.region-group[data-region="americas"] .region-label { color: #b8860b; }
.cuisine-btn.region-americas {
  background: #d4a04a;
  border-color: #d4a04a;
  color: white;
}
.cuisine-btn.region-americas:hover {
  background: #c08f3a;
  border-color: #c08f3a;
}
.cuisine-btn.region-americas.selected {
  background: #996515;
  border-color: #996515;
  box-shadow: 0 0 0 3px rgba(212, 160, 74, 0.4);
}

/* Middle East - Sandy Olive */
.region-group[data-region="middle-east"] .region-label { color: #8b7d5c; }
.cuisine-btn.region-middle-east {
  background: #a89076;
  border-color: #a89076;
  color: white;
}
.cuisine-btn.region-middle-east:hover {
  background: #968066;
  border-color: #968066;
}
.cuisine-btn.region-middle-east.selected {
  background: #6b5d45;
  border-color: #6b5d45;
  box-shadow: 0 0 0 3px rgba(168, 144, 118, 0.4);
}

.filters {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  padding-top: 1.5rem;
  border-top: 1px solid #eee;
}

.dietary-filters h3,
.servings-select h3 {
  margin-bottom: 0.75rem;
  color: #333;
  font-size: 0.95rem;
}

.dietary-filters label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-right: 1rem;
  cursor: pointer;
  color: #555;
}

.dietary-filters input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.servings-select select,
.time-select select,
.skill-select select,
.protein-select select {
  padding: 0.5rem 1rem;
  border: 2px solid #ddd;
  border-radius: 0.5rem;
  font-size: 1rem;
  cursor: pointer;
}

.filter-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.filter-row > div {
  flex: 1;
  min-width: 120px;
}

.time-select h3,
.skill-select h3,
.protein-select h3 {
  margin-bottom: 0.75rem;
  color: #333;
  font-size: 0.95rem;
}

.ingredients-input {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #eee;
}

.ingredients-input h3 {
  margin-bottom: 0.75rem;
  color: #333;
  font-size: 0.95rem;
}

.ingredients-input .optional {
  font-weight: normal;
  color: #999;
  font-size: 0.85rem;
}

.ingredients-input textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #ddd;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
}

.ingredients-input textarea:focus {
  outline: none;
  border-color: #c17f59;
}

.ingredients-input .input-hint {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #888;
  font-style: italic;
}

/* Generate Button */
.generate-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #eee;
  text-align: center;
}

.btn-generate {
  padding: 1rem 3rem;
  background: linear-gradient(135deg, #c17f59 0%, #a86d4a 100%);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(193, 127, 89, 0.3);
}

.btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(193, 127, 89, 0.4);
}

.btn-generate:active {
  transform: translateY(0);
}

/* Recipe Section */
.recipe-section {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  display: none;
}

.recipe-section.visible {
  display: block;
}

.loading {
  text-align: center;
  padding: 3rem;
  display: none;
}

.loading.visible {
  display: block;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #c17f59;
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 1s linear infinite;
}

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

.recipe-card {
  display: none;
}

.recipe-card.visible {
  display: block;
}

.recipe-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.recipe-header h2 {
  color: #333;
  font-size: 1.75rem;
}

.cuisine-tag {
  background: #c17f59;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.85rem;
  white-space: nowrap;
}

.recipe-meta {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
  color: #666;
  font-size: 0.95rem;
}

.recipe-meta span::before {
  margin-right: 0.25rem;
}

.dietary-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.dietary-tag {
  background: #e8f5e9;
  color: #2e7d32;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.85rem;
}

.recipe-content {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 600px) {
  .recipe-content {
    grid-template-columns: 1fr;
  }
}

.ingredients h3,
.instructions h3 {
  color: #333;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #c17f59;
}

.ingredients ul {
  list-style: none;
}

.ingredients li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #eee;
  color: #555;
}

.ingredients li:last-child {
  border-bottom: none;
}

.instructions ol {
  padding-left: 1.25rem;
}

.instructions li {
  padding: 0.75rem 0;
  color: #555;
  line-height: 1.6;
}

.recipe-origin {
  background: linear-gradient(135deg, #faf6f1 0%, #f5ebe0 100%);
  border-left: 4px solid #c17f59;
  padding: 1rem 1.25rem;
  border-radius: 0 0.5rem 0.5rem 0;
  margin-bottom: 1.5rem;
  color: #5d4037;
  font-size: 0.95rem;
  line-height: 1.6;
  font-style: italic;
  display: none;
}

.recipe-origin.visible {
  display: block;
}

.recipe-origin::before {
  content: 'About this dish: ';
  font-weight: 600;
  font-style: normal;
  color: #4e342e;
}

.recipe-tips {
  background: #fff3e0;
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
  color: #e65100;
  font-size: 0.95rem;
  display: none;
}

.recipe-tips.visible {
  display: block;
}

.recipe-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.btn-save,
.btn-new {
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.btn-save {
  background: #c17f59;
  color: white;
}

.btn-save:hover {
  background: #a86d4a;
}

.btn-save:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.btn-new {
  background: white;
  color: #8b5a2b;
  border: 2px solid #c17f59;
}

.btn-new:hover {
  background: #faf6f1;
}

/* Saved Recipes Section */
.saved-section {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.saved-section h2 {
  color: #333;
  margin-bottom: 1rem;
}

.saved-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  background: white;
  border-radius: 2rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  color: #666;
}

.filter-btn:hover {
  border-color: #c17f59;
  color: #8b5a2b;
}

.filter-btn.active {
  background: #c17f59;
  color: white;
  border-color: #c17f59;
}

.saved-recipes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.no-recipes {
  grid-column: 1 / -1;
  text-align: center;
  color: #999;
  padding: 2rem;
}

.saved-recipe-card {
  border: 1px solid #eee;
  border-radius: 0.75rem;
  padding: 1.25rem;
  transition: all 0.2s;
}

.saved-recipe-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.saved-recipe-card h4 {
  color: #333;
  margin-bottom: 0.5rem;
}

.saved-recipe-card .meta {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.75rem;
}

.saved-recipe-card .tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.saved-recipe-card .tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 1rem;
  background: #f0f0f0;
  color: #666;
}

.saved-recipe-card .actions {
  display: flex;
  gap: 0.5rem;
}

.saved-recipe-card .btn-view,
.saved-recipe-card .btn-delete {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.25rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.saved-recipe-card .btn-view {
  background: #c17f59;
  color: white;
}

.saved-recipe-card .btn-view:hover {
  background: #a86d4a;
}

.saved-recipe-card .btn-delete {
  background: #ffebee;
  color: #c62828;
}

.saved-recipe-card .btn-delete:hover {
  background: #ffcdd2;
}
