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

body {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f5f5;
}

header {
  height: 4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e0e0e0;
  padding-right: 2rem;
  padding-left: 2rem;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

header h1 {
  font-size: 1.5rem;
  color: #333;
  font-weight: 600;
}

#back-btn {
  padding: 0.5rem 0.75rem;
  background-color: #5b8dd9;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background-color 0.2s;
  font-weight: 500;
  display: none;
}

#back-btn:hover {
  background-color: #4a73ba;
}

#back-btn:active {
  background-color: #3d5fa0;
}

#btn {
  padding: 0.75rem 1.5rem;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
  font-weight: 500;
}

#btn:hover {
  background-color: #0056b3;
}

#btn:active {
  background-color: #003d82;
}

#delete-btn {
  padding: 0.75rem 1.5rem;
  background-color: #dc3545;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
  font-weight: 500;
}

#delete-btn:hover {
  background-color: #c82333;
}

#delete-btn:active {
  background-color: #bd2130;
}

.container {
  display: flex;
  width: 100%;
  flex: 1;
}

.notes-sidebar {
  height: 100%;
  width: 15%;
  border-right: 1px solid #e0e0e0;
  background-color: #fff;
}

.no-notes {
  display: flex;
  justify-content: center;
  align-items: center;
  color: #999;
  font-size: 0.7rem;
}

.input-element {
  border: none;
  outline: none;
  background-color: #f0f0f0;
  font-family: inherit;
  font-size: inherit;
  padding: 0.25rem 0.5rem;
  width: 100%;
  border-radius: 2px;
  text-align: center;
}

.note-input-container {
  height: 100%;
  width: 85%;
}

textarea {
  display: none;
  height: 100%;
  width: 100%;
  border: none;
  outline: none;
  padding: 2rem;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  resize: none;
  background-color: #fff;
  color: #333;
}

textarea:focus {
  background-color: #fafafa;
  border-bottom: 2px solid #007bff;
}

textarea::placeholder {
  color: #999;
  font-style: italic;
}

.note-div {
  padding: 1.5rem 1rem;
  display: flex;
  justify-content: center;
  border-bottom: 1px solid #e0e0e0;
  transition: background-color 0.2s;
}

.note-div:hover {
  background-color: #f9f9f9;
  cursor: pointer;
}

.note-div.active {
  background-color: #f0f0f0;
  border-left: 4px solid #007bff;
}

@media (max-width: 768px) {
  header h1 {
    font-size: 1.3rem;
  }

  #btn {
    padding: 0.5rem 1rem;
  }

  #delete-btn {
    padding: 0.5rem 1rem;
  }

  .no-notes {
    font-size: 0.5rem;
  }
}

@media (max-width: 480px) {
  header {
    padding-right: 1.5rem;
    padding-left: 1.5rem;
  }

  .notes-sidebar {
    width: 100%;
  }

  .note-div {
    padding: 1.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s;
  }

  .note-div p {
    font-size: 0.85rem;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .note-input-container {
    width: 100%;
  }
}
