:root {
  --active: #333;
  --bg-color: #404040;
  --delete: #900;
  --inactive: #444;
  --primary: #30a562;
  --list-border: #555555;
  --text: #fff;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg-color: #fff;
    --text: #000;
    --inactive: #f2f2f2;
    --primary: #39c676;
    --list-border: #bfbfbf;
    --active: #d9d9d9;
    --delete: #ff0000;
  }
}

* {
  color: var(--text);
  font-family: monospace;
}

/*
 *
 * Tags
 *
 */
body {
  background-color: var(--bg-color);
  margin: 0 auto;
  max-width: 800px;
}

form {
  position: relative;

  label {
    font-size: 1.5em;
    padding: 10px;
  }

  textarea {
    border-radius: 0 0 10px 10px;
  }
}

h1 {
  font-size: 3em;
  margin: 0;
}

header {
  background-color: var(--primary);
  border-left: 2px solid var(--text);
  border-right: 2px solid var(--text);
  padding: 0 20px;
  text-align: center;

  div {
    padding: 5px;
  }
}

input,
textarea {
  background-color: transparent;
  outline: none !important;
  overflow-y: hidden;
  resize: none;
}

input:focus-within,
textarea:focus-within {
  background-color: var(--active) !important;
}

li {
  border: 1px solid var(--list-border);
  border-bottom: 0;
  min-height: 100px;
  position: relative;

  h3,
  p {
    margin: 0;
    padding: 1rem 1rem;
    width: calc(100% - 1rem - 50px);
    word-break: break-word;
  }

  p {
    padding-bottom: 60px;
    white-space: pre-wrap;
  }

  textarea {
    height: 100px;
  }
}

li:first-child {
  border-radius: 10px 10px 0 0;

  .delete-btn {
    border-radius: 0 9px 0 0;
  }
}

ul {
  list-style-type: none;
}

/*
 *
 * Classes
 *
 */
.body-input {
  background-color: transparent;
  border: 0;
  box-sizing: border-box;
  display: block;
  margin: 10px 0 0;
  padding: 1rem 5rem 1rem 2rem;
  width: 100%;
}

.delete-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 25px;
  height: 50px;
  padding: 0;
  position: absolute;
  right: 0;
  top: 0;
  width: 50px;
}

.delete-btn:hover {
  background-color: var(--delete);
  color: var(--text);
}

.edit-btn {
  background: transparent;
  border: none;
}

.edit-btn:hover {
  background-color: var(--primary);
  color: var(--text);
}

.edit-btn,
.save-btn,
.save-edit-btn {
  height: 40px;
  width: 60px;
  right: 0;
  bottom: 0;
  cursor: pointer;
  position: absolute;
}

.new-note {
  background: var(--inactive);
  border-radius: 0 0 10px 10px;
  border: 2px solid var(--text);
  border-top: var(--primary);
  margin-bottom: 42px;
  padding-top: 10px;
}

.no-notes {
  height: calc(100vh - 445px);
  padding-top: 20px;
  text-align:center;
}

.notes-list {
  margin: 0;
  padding: 0;
}

.save-btn {
  border-radius: 0 0 9px 0;
}

.save-btn,
.save-edit-btn {
  background-color: var(--primary);
  border: 0;
  color: var(--text);
}

.title-input {
  border: 1rem;
  box-sizing: border-box;
  display: block;
  margin: 10px 0 10px 0;
  padding: 1rem 1rem 1rem 2rem;
  width: 100%;
}

/*
 *
 * Modal
 *
 */
:modal {
  background-color: var(--bg-color);
  color: var(--primary);
}

:modal>form {
  text-align: center;
}

:modal>form>p {
  font-size: 1.2em;
  margin: 30px;
  text-align: center;
}

:modal>form>button {
  background: transparent;
  border: none;
  padding: 0.5rem 1rem;
}

:modal>form>button:hover {
  background-color: var(--active);
  color: var(--text);
  cursor: pointer;
}

#modal-delete:hover {
  background-color: var(--delete);
}

::backdrop {
  background-color: black;
  opacity: 0.45;
}
