* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Roboto', sans-serif;
}

body {
  background-color: #9b51e0; /* Фіолетовий фон з макету */
  color: #333;
  padding: 20px;
}

header {
  margin-bottom: 30px;
  color: white;
  text-align: center;
}

/* Форма створення нотатки */
.modal{
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  background-color: #0000009a;
}

.modal-content{
  background-color: rgba(255, 255, 255, 0.769);
  padding: 25px;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  position: relative;
  box-shadow: 0 10px 50px rgba(255, 255, 255, 0);
  display: flex;
  flex-direction: column;
  transition: all 0.35s ease;
}


/* для fullscreen logic */
.modal-content.fullscreen{
  width: 100%;
  max-width: 100%;
  height: 100vh;
  border-radius: 0;
}

/* Для minimize logic */

.modal-content.minimized{
  width: 200px;
  height: 100px;
  overflow: hidden;
  border-radius: 25px;
  cursor: pointer;
}

/* Ховаємо ВСІ елементи всередині, КРІМ кнопки restore */
.modal-content.minimized > *:not(.restore-btn) {
  display: none;
}

/* Явно ховаємо textarea та input (щоб перебити інші правила) */
.modal-content.minimized textarea,
.modal-content.minimized input {
  display: none !important;
}

/* Кнопка restore — прихована в нормальному стані */
.restore-btn {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.85);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 18px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 10;
}

/* При hover на мінімізоване вікно — показуємо кнопку */
.modal-content.minimized:hover .restore-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
}


/* --- Плаваюча кнопка ПЛЮСИК --- */
.fab-btn {
  position: fixed;
  bottom: 40px;
  right: 40px;
  background-color: #f1c40f;
  color: #333;
  border: none;
  border-radius: 50%;
  width: 65px;
  height: 65px;
  font-size: 24px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  cursor: pointer;
  z-index: 100;
  transition: transform 0.4s, background-color 0.2s;
}

.fab-btn:hover {
  background-color: #f39c12;
  transform: scale(1.2); /* Легке збільшення при наведенні */
}

.mac-controls{
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
}

.mac-btn{
  width: 25px;
  height: 25px;
  border-radius: 50%;
  cursor: pointer;
  transition: filter 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
}
.mac-btn i{
  font-size: 13px;
  color: rgba(0, 0, 0, 0.5);
}
span.mac-minimize{
  position: relative;
}

.mac-minimize i{
  position: absolute;
  top: 2.5px;
  left: 51%;
  transform: translateX(-50%);
}

.mac-close    { background-color: #ff5f57; }                       
.mac-minimize { background-color: #febc2e; }                       
.mac-maximize { background-color: #28c840; }     

.mac-btn:hover { filter: brightness(0.85); }  
                                                 

.modal-content input, .modal-content textarea {
  border: none;
  outline: none;
  width: 100%;
  font-size: 16px;
  padding: 10px 0;
  background-color: rgb(255, 255, 255);
  border-radius: 12px;
  padding: 10px 25px 10px 15px;
}



.modal-content textarea {
  border: none; outline: none; width: 100%; font-size: 16px; resize: none; min-height: 120px;
}

/* Кнопка Зберегти */
.modal-actions { display: flex; justify-content: flex-end; margin-top: 15px; }
/* #save-note-btn { background: #f1c40f; border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; font-weight: bold; } */

/* Стилі для перемикача та чекбоксів */
#toggle-type-btn {
  background: none; border: none; color: #555; text-align: left; cursor: pointer; font-size: 14px;
  margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px dashed #ccc;
}

.modal-list-item { display: flex; align-items: baseline; margin-bottom: 10px; }
.modal-list-item input[type="text"] { border: none; outline: none; width: 100%; font-size: 16px; padding: 5px 25px 5px 10px; }
.modal-list-item .remove-item-btn { background: none; border: none; color: #e74c3c; font-size: 16px; margin-left: 10px; cursor: pointer; }
#add-list-item-btn { background: none; border: none; color: #bdda00; cursor: pointer; font-weight: 500; margin-top: 5px; text-align: left; }

/* Відображення тексту з переносами та чекбоксів на екрані */
.note-content-text { white-space: pre-wrap; font-size: 15px; line-height: 1.5; margin-bottom: 20px; flex-grow: 1; }
.note-list { list-style: none; padding: 0; margin-bottom: 20px; flex-grow: 1; }
.note-list li { display: flex; align-items: center; margin-bottom: 6px; font-size: 15px; }
.note-list input[type="checkbox"] { margin-right: 10px; width: 16px; height: 16px; cursor: pointer; }
.note-list span.done { text-decoration: line-through; color: #888; }

.modal-content input {
  font-weight: 500;
  font-size: 20px;
  margin-bottom: 20px;
}

.modal-content textarea {
  resize: none;
  min-height: 120px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 25px;
}

#save-note-btn {
  background: #84d97b;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
}

#save-note-btn:hover {
  background: #4ac959;
}

.creator-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

#add-btn {
  background: #f1c40f;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s;
}

#add-btn:hover {
  background: #f39c12;
}

/* Сітка нотаток */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Картка нотатки */
.note {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.3s ease;
  word-wrap: break-word;
}

.note h3 {
  margin-bottom: 10px;
  font-size: 18px;
}

.note p {
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 20px;
  flex-grow: 1;
}

/* Статус архіву (Level 2) */
.note.archived {
  opacity: 0.6;
}

.note.archived p, .note.archived h3 {
  text-decoration: line-through;
  color: #888;
}

/* Нижня частина нотатки (дата і кнопки) */
.note-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #eee;
  padding-top: 15px;
  font-size: 12px;
  color: #999;
}

.note-actions button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: #777;
  margin-left: 10px;
  transition: color 0.2s;
}

.note-actions button:hover {
  color: #333;
}

.note-actions .delete-btn:hover {
  color: #e74c3c;
}

/* --- Навігація (Нотатки / Архів) --- */
.main-nav {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.4);
  color: white;
  padding: 8px 22px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}

.nav-btn.nav-active {
  background: white;
  color: #9b51e0;
  border-color: white;
  font-weight: bold;
}

/* --- Повідомлення про порожній список --- */
.empty-msg {
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
  font-size: 18px;
  margin-top: 60px;
  grid-column: 1 / -1;
}