/* Grundstil */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 20px;
  background: #f4f7f8;
  color: #333;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

h1 {
  margin-bottom: 20px;
  font-weight: 700;
  color: #2c3e50;
  text-align: center;
}

/* Container för sidebar och main */
.container {
  display: flex;
  flex-direction: row;
  gap: 20px;
  width: 100%;
  max-width: 1100px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.1);
  padding: 20px;
  min-height: 500px;
}

/* Sidebar - lista och knapp */
.sidebar {
  width: 280px;
  display: flex;
  flex-direction: column;
}

#btnAdd {
  background-color: #2980b9;
  color: white;
  border: none;
  padding: 12px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 15px;
  transition: background-color 0.3s ease;
}

#btnAdd:hover {
  background-color: #1f5f8b;
}

#recipeList {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid #ddd;
  border-radius: 6px;
  max-height: 480px;
  overflow-y: auto;
  background: #fafafa;
  box-shadow: inset 0 1px 3px rgb(0 0 0 / 0.05);
}

#recipeList li {
  padding: 12px 16px;
  border-bottom: 1px solid #e1e1e1;
  cursor: pointer;
  transition: background-color 0.2s ease;
  user-select: none;
}

#recipeList li:last-child {
  border-bottom: none;
}

#recipeList li:hover {
  background-color: #d6e9f9;
}

#recipeList li.selected {
  background-color: #2980b9;
  color: white;
  font-weight: 600;
}

/* Main innehåll */
.main {
  flex-grow: 1;
  padding: 20px;
  background: #ECECEC;
  border-radius: 8px;
  box-shadow: inset 0 0 10px rgb(0 0 0 / 0.03);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 480px;
  overflow-y: auto;
}

.main h2 {
  margin-top: 0;
  margin-bottom: 12px;
  color: #34495e;
}

.main p strong {
  color: #555;
}

.main ul, .main ol {
  margin-top: 5px;
  margin-bottom: 15px;
  padding-left: 20px;
  color: #444;
  line-height: 1.5;
}

.main ol li {
  margin-bottom: 6px; /* <-- Lägg till detta för mer mellanrum */
  padding-bottom: 6px;
  border-bottom: 2px solid #e1e1e1;
}
.main ol li:last-child {
    border-bottom: none;
}

/* Knappar i main */
button {
  background-color: #3498db;
  border: none;
  padding: 10px 16px;
  margin: 5px 8px 5px 0;
  color: white;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.25s ease;
  user-select: none;
}

button:disabled {
  background-color: #95a5a6;
  cursor: not-allowed;
  opacity: 0.6;
}

button:hover:not(:disabled) {
  background-color: #1f78c1;
}

/* Modal bakgrund och innehåll */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  padding: 10px;
}

.modal-content {
  background: white;
  border-radius: 8px;
  padding: 25px 30px;
  width: 100%;
  max-width: 600px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  max-height: 90vh;
  overflow-y: auto;
}

.hidden {
  display: none !important;
}

/* Form-element i modal */
textarea, input[type=text] {
  width: 100%;
  font-size: 15px;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #ccc;
  margin-top: 6px;
  margin-bottom: 16px;
  resize: vertical;
  transition: border-color 0.3s ease;
}

textarea:focus, input[type=text]:focus {
  outline: none;
  border-color: #2980b9;
  box-shadow: 0 0 6px #a3cef1;
}

/* Label */
label {
  font-weight: 600;
  color: #34495e;
  user-select: none;
}

/* Responsivitet för mobil */
@media (max-width: 720px) {
  .container {
    flex-direction: column;
    padding: 15px;
    min-height: auto;
  }

  .sidebar {
    width: 100%;
    margin-bottom: 20px;
  }

  #recipeList {
    max-height: 300px;
  }

  .main {
    min-height: auto;
    max-height: none;
  }

  button {
    width: 100%;
    margin: 8px 0;
    font-size: 16px;
  }
}
