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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: linear-gradient(135deg, #f5e6d3 0%, #e8d4b8 100%);
  min-height: 100vh;
  color: #3d3225;
  line-height: 1.5;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem;
}

header {
  text-align: center;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.2rem;
  color: #8b5a2b;
  text-shadow: 2px 2px 0 #f5e6d3;
  margin-bottom: 0.15rem;
}

.subtitle {
  font-size: 0.95rem;
  color: #6b4423;
  font-style: italic;
}

h2 {
  color: #6b4423;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  border-bottom: 2px solid #d4a574;
  padding-bottom: 0.3rem;
}

h3 {
  color: #8b5a2b;
  font-size: 0.75rem;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.method {
  background: white;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  box-shadow: 0 2px 4px rgba(139, 90, 43, 0.1);
}

.method h2 {
  display: inline;
  border: none;
  font-size: 0.9rem;
  padding: 0;
  margin-right: 0.5rem;
}

.method p {
  display: inline;
  color: #5a4a3a;
  font-size: 0.85rem;
}

.ingredients {
  background: white;
  padding: 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  box-shadow: 0 2px 4px rgba(139, 90, 43, 0.1);
}

.hint {
  font-size: 0.8rem;
  color: #8b7355;
  margin-bottom: 0.75rem;
  font-style: italic;
}

.ingredient-groups {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
}

.ingredient-group {
  background: #faf7f2;
  padding: 0.6rem;
  border-radius: 8px;
}

.ingredient {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.5rem;
  padding-left: 1.6rem;
  cursor: pointer;
  border-radius: 15px;
  transition: background-color 0.2s;
  position: relative;
  font-size: 0.8rem;
  background: #fff;
  margin: 0.15rem;
  border: 1px solid #e8ddd0;
}

.ingredient:hover {
  background-color: #f0e8dc;
  border-color: #c4a77d;
}

.ingredient input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.checkmark {
  position: absolute;
  left: 0.4rem;
  height: 14px;
  width: 14px;
  background-color: #e8ddd0;
  border: 2px solid #c4a77d;
  border-radius: 3px;
  transition: all 0.2s;
}

.ingredient:hover .checkmark {
  border-color: #8b5a2b;
}

.ingredient input:checked ~ .checkmark {
  background-color: #8b5a2b;
  border-color: #8b5a2b;
}

.ingredient input:checked ~ .checkmark::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 0px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.ingredient.required {
  font-weight: 600;
}

.generate-btn {
  display: block;
  width: 100%;
  padding: 0.75rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #8b5a2b 0%, #6b4423 100%);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 3px 10px rgba(139, 90, 43, 0.3);
  margin-bottom: 1rem;
}

.generate-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 5px 14px rgba(139, 90, 43, 0.4);
}

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

.generate-btn:disabled {
  background: linear-gradient(135deg, #b8a08a 0%, #9a8a7a 100%);
  cursor: not-allowed;
  box-shadow: none;
}

.generate-btn.loading {
  position: relative;
  color: transparent;
}

.generate-btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.recipe-output {
  background: white;
  padding: 1rem;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(139, 90, 43, 0.1);
  animation: fadeIn 0.5s ease-out;
}

.recipe-output.hidden {
  display: none;
}

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

#recipe-content {
  color: #4a3f35;
  font-size: 0.9rem;
}

#recipe-content h3 {
  margin-top: 1rem;
  margin-bottom: 0.4rem;
  color: #6b4423;
}

#recipe-content h3:first-child {
  margin-top: 0;
}

#recipe-content ul, #recipe-content ol {
  margin-left: 1.25rem;
  margin-bottom: 0.75rem;
}

#recipe-content li {
  margin-bottom: 0.3rem;
}

#recipe-content p {
  margin-bottom: 0.75rem;
}

footer {
  text-align: center;
  margin-top: 1rem;
  color: #8b7355;
  font-size: 0.8rem;
}

/* Tablet */
@media (max-width: 800px) {
  .ingredient-groups {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Mobile */
@media (max-width: 550px) {
  .container {
    padding: 0.75rem;
  }

  h1 {
    font-size: 1.8rem;
  }

  .ingredient-groups {
    grid-template-columns: repeat(2, 1fr);
  }

  .ingredient-group {
    padding: 0.5rem;
  }

  .ingredient {
    font-size: 0.75rem;
    padding: 0.25rem 0.4rem;
    padding-left: 1.4rem;
  }

  .checkmark {
    height: 12px;
    width: 12px;
    left: 0.3rem;
  }

  .ingredient input:checked ~ .checkmark::after {
    left: 2px;
    top: 0px;
    width: 3px;
    height: 6px;
  }
}

/* Small mobile */
@media (max-width: 380px) {
  .ingredient-groups {
    grid-template-columns: 1fr;
  }
}
