body {
  font-family: system-ui, sans-serif;
  background: #f4f6f8;
  margin: 0;
  padding: 2rem;
}

main {
  max-width: 1200px;
  margin: auto;
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

h1, h2 {
  color: #2c3e50;
  margin-top: 1rem;
}

label {
  display: block;
  margin: 0.5rem 0;
  font-weight: 500;
}

input[type="text"],
input[type="number"],
select {
  margin: 0.3rem 0 1rem;
  padding: 0.5rem;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
}

input[type="checkbox"] {
  margin-right: 0.5rem;
}

button {
  padding: 0.6rem 1rem;
  background: #2c3e50;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin: 0.5rem 0;
  font-size: 1rem;
}

button:hover {
  background: #1a252f;
}

.flex-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.left-panel {
  flex: 1;
  min-width: 300px;
  max-width: 45%;
}

.right-panel {
  flex: 1;
  min-width: 300px;
  max-width: 55%;
}

pre {
  background: #f9f9f9;
  padding: 1rem;
  border-radius: 8px;
  white-space: pre-wrap;
  font-family: monospace;
  font-size: 0.95rem;
  line-height: 1.4;
}

ul {
  list-style-type: none;
  padding-left: 1rem;
}

ul li {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

ul ul {
  margin-top: 0.5rem;
  padding-left: 1rem;
  border-left: 2px dashed #ccc;
}

#recipe-results {
  list-style: none;
  padding-left: 0;
  margin-top: 0.5rem;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  max-height: 300px;
  overflow-y: auto;
}

#recipe-results li {
  background: #f0f0f0;
  margin-bottom: 0.3rem;
  padding: 0.5rem;
  border-radius: 6px;
  transition: background 0.2s;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#recipe-results li:hover {
  background: #e0e0e0;
}

#recipe-results li.active {
  background: #d0d0d0;
  font-weight: bold;
}

#recent-recipes {
  list-style: none;
  padding-left: 0;
  margin-top: 0.5rem;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  max-height: 300px;
  overflow-y: auto;
}

#recent-recipes li {
  background: #f0f0f0;
  margin-bottom: 0.3rem;
  padding: 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

#recent-recipes li:hover {
  background: #e0e0e0;
}



.left-panel, .middle-panel, .right-panel {
  flex: 1;
  min-width: 300px;
}

.left-panel {
  max-width: 30%;
}

.middle-panel {
  max-width: 40%;
}

.right-panel {
  max-width: 30%;
}

body.dark-mode {
  background-color: #121212;
  color: #e0e0e0;
}

body.dark-mode {
  background-color: #121212;
  color: #e0e0e0;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.dark-mode input,
.dark-mode textarea,
.dark-mode select {
  background-color: #1e1e1e;
  color: #e0e0e0;
  border: 1px solid #444;
}

.dark-mode button {
  background-color: #333;
  color: #e0e0e0;
  border: 1px solid #555;
}

.dark-mode ul,
.dark-mode li {
  background-color: transparent;
  color: #e0e0e0;
}

.dark-mode label,
.dark-mode h1,
.dark-mode h2,
.dark-mode h3 {
  color: #e0e0e0;
}

.dark-mode .section,
.dark-mode .container,
.dark-mode .box {
  background-color: #1a1a1a;
  color: #e0e0e0;
  border-color: #333;
}

body.dark-mode .panel {
  background-color: #1e1e1e;
  color: #e0e0e0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

body.dark-mode main {
  background-color: #1a1a1a;
  color: #e0e0e0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

body.dark-mode pre {
  background-color: #1e1e1e;
  color: #e0e0e0;
  border: 1px solid #444;
}

body.dark-mode #recipe-results,
body.dark-mode #recent-recipes {
  background-color: #1e1e1e;
  border: 1px solid #444;
}

body.dark-mode #recipe-results li,
body.dark-mode #recent-recipes li {
  background-color: #2a2a2a;
  color: #e0e0e0;
}

body.dark-mode #recipe-results li:hover,
body.dark-mode #recent-recipes li:hover {
  background-color: #3a3a3a;
}

body.dark-mode #recipe-results li.active {
  background-color: #444;
  font-weight: bold;
}

.horizontal-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

.side-panel {
  flex: 0 0 300px;
  background: #f9f9f9;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

body.dark-mode .side-panel {
  background-color: #1e1e1e;
  color: #e0e0e0;
  border: 1px solid #444;
}

.three-panel-layout {
  flex: 1;
  display: flex;
  gap: 2rem;
}


body.dark-mode .side-panel {
  background-color: #1e1e1e;
  color: #e0e0e0;
  border: 1px solid #444;
}

body.dark-mode .side-panel {
  background-color: #1e1e1e;
  color: #e0e0e0;
  border: 1px solid #444;
}

#crafting-list-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

#crafting-list {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

#crafting-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: #f0f0f0;
  border-radius: 6px;
}

body.dark-mode #crafting-list li {
  background: #2a2a2a;
}

.craft-qty {
  width: 60px;
  padding: 0.25rem;
  border-radius: 4px;
  border: 1px solid #ccc;
}

.remove-craft {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
}
