body {
  font-family: Arial, sans-serif;
  background: #f9f9f9;
  padding: 20px;
  margin: 0;
  text-align: center;
}

h1 {
  margin-bottom: 20px;
}

#addTaskBtn {
  background: #ffdb4d;
  border: none;
  padding: 10px 20px;
  font-size: 18px;
  cursor: pointer;
  border-radius: 8px;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.2);
}

.notes-container {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
}

.note {
  background: #fff475;
  width: 240px;
  min-height: 140px;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 5px 5px 12px rgba(0,0,0,0.15);
  position: relative;
  transform: rotate(calc(-3deg + 6deg * var(--random)));
  animation: popIn 0.4s ease forwards;
  cursor: pointer;
  overflow-wrap: break-word;
}

.note h3 {
  margin: 0 0 10px;
  word-break: break-word;
}

.note p {
  margin: 0 0 8px;
  white-space: pre-wrap;
  text-align: left;
  word-break: break-word;
  font-size: 14px;
  color: #333;
}

.note small {
  color: #555;
  font-size: 12px;
  display: block;
  margin-top: 8px;
  text-align: left;
}

/* Delete button */
.note button.delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #ff5252;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  color: white;
  font-weight: bold;
  cursor: pointer;
  font-size: 18px;
  line-height: 22px;
}

/* Image preview circle */
.note img.task-image {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #333;
  position: absolute;
  bottom: 10px;
  left: 10px;
  cursor: pointer;
}

/* Voice play button */
.note button.voice-play-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: #4caf50;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  color: white;
  font-size: 18px;
  line-height: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Animations */
@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.5) rotate(0deg);
  }
  100% {
    opacity: 1;
  }
}

/* Modal styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.modal-content {
  background: white;
  padding: 20px;
  width: 320px;
  max-width: 90vw;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
  text-align: left;
  position: relative;
}

.modal-content input,
.modal-content textarea {
  width: 100%;
  margin-top: 5px;
  margin-bottom: 15px;
  padding: 8px;
  box-sizing: border-box;
  border-radius: 5px;
  border: 1px solid #ccc;
  font-size: 14px;
  font-family: inherit;
}

.modal-content button {
  margin-right: 10px;
  padding: 8px 15px;
  cursor: pointer;
  border-radius: 5px;
  border: none;
  font-size: 14px;
  font-family: inherit;
}

#saveAddBtn, #saveEditBtn {
  background-color: #4caf50;
  color: white;
}

#cancelAddBtn, #cancelEditBtn, #cancelVoiceBtn, #closeImagePreviewBtn {
  background-color: #ccc;
}

#recordVoiceBtn, #recordEditVoiceBtn, #startRecordingBtn, #stopRecordingBtn, #saveVoiceBtn {
  background-color: #2196f3;
  color: white;
}

.image-preview-content img {
  max-width: 100%;
  max-height: 80vh;
  display: block;
  margin-bottom: 10px;
}

/* Hide modal by default */
.hidden {
  display: none;
}

.voice-record-content button {
  margin-top: 10px;
}

/* Audio playback */
audio {
  width: 100%;
  margin-top: 10px;
}
