body {
  font-family: Arial, sans-serif;
  width: 400px;
  padding: 20px;
  margin: 0 auto;
  background-color: #f4f4f4;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: relative; /* Needed for absolute positioning of overlay */
}

@media (max-width: 600px) {
  body {
    width: auto;
    margin: 10px;
    padding: 15px;
  }

  button {
    width: 100%;
  }

  .input-group input[type="text"],
  .input-group textarea {
    width: calc(100% - 20px);
  }
}

h2 {
  text-align: center;
  color: #333;
}

button {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1em;
}

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

.input-group {
  margin-bottom: 15px;
}

.input-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #555;
}

.input-group input[type="text"],
.input-group textarea {
  width: calc(100% - 20px);
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 1em;
}

.input-group textarea {
  resize: vertical;
  min-height: 100px;
}

#noteList {
  margin-top: 20px;
  border-top: 1px solid #eee;
  padding-top: 15px;
}

.note-item {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 10px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.note-item h3 {
  margin-top: 0;
  margin-bottom: 5px;
  color: #007bff;
}

.note-item p {
  font-size: 0.9em;
  color: #666;
  margin-bottom: 10px;
  white-space: pre-wrap; /* Preserve whitespace and line breaks */
}

.note-item .note-actions {
  text-align: right;
}

.note-item .note-actions button {
  width: auto;
  padding: 5px 10px;
  margin-left: 10px;
  font-size: 0.8em;
  background-color: #dc3545;
}

.note-item .note-actions button:hover {
  background-color: #c82333;
}

/* Loading Overlay Styles */
#loadingOverlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  border-radius: 8px;
}

#loadingOverlay.hidden {
  display: none;
}

.spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-left-color: #007bff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#loadingOverlay p {
  margin-top: 10px;
  color: #555;
  font-weight: bold;
}
