/* --- CSS RESET & BASIC STYLES --- */
* {
  box-sizing: border-box;
}
body {
  margin: 0; padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background:
    linear-gradient(135deg, #4b6cb7 0%, #182848 100%);
  color: #f0f0f3;
  height: 100vh;
  display: grid;
  grid-template-columns: 320px 1fr;
  overflow: hidden;
  user-select: none;
}

/* subtle noise texture overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: url('https://www.transparenttextures.com/patterns/diagmonds-light.png');
  opacity: 0.07;
  z-index: 0;
}

/* Scrollbar Styling */
#sidebar::-webkit-scrollbar,
#main::-webkit-scrollbar {
  width: 8px;
}
#sidebar::-webkit-scrollbar-thumb,
#main::-webkit-scrollbar-thumb {
  background-color: rgba(255 255 255 / 0.12);
  border-radius: 10px;
}

/* Buttons General */
button {
  cursor: pointer;
  border: none;
  font-weight: 700;
  padding: 0.5em 1.2em;
  border-radius: 12px;
  background: rgba(255 255 255 / 0.15);
  color: #e1e1e6;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 0 10px rgba(255 255 255 / 0.05);
  user-select: none;
}
button:hover {
  background: rgba(255 255 255 / 0.30);
  box-shadow: 0 4px 20px rgba(255 255 255 / 0.2);
  color: #fff;
}

/* Inputs, Selects, Textareas */
input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
  border-radius: 14px;
  border: none;
  padding: 0.75em 1em;
  outline: none;
  resize: vertical;
  background: rgba(255 255 255 / 0.15);
  color: #222;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
input[type="text"], textarea {
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  background: rgba(255 255 255 / 0.25);
  box-shadow: 0 0 12px 3px rgba(255 255 255 / 0.5);
}

/* --- SIDEBAR --- */
#sidebar {
  background: rgba(255 255 255 / 0.10);
  padding: 35px 30px 30px 30px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid rgba(255 255 255 / 0.18);
  box-shadow: inset -8px 0 40px -10px rgba(0,0,0,0.7);
  backdrop-filter: saturate(200%) blur(10px);
  position: relative;
  z-index: 1;
}

#sidebar h2 {
  margin: 0 0 25px 0;
  font-weight: 900;
  font-size: 2.3rem;
  letter-spacing: 0.1em;
  color: #f8f8f8;
  text-shadow: 0 2px 5px rgba(0,0,0,0.4);
}

#filters, #categories {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 25px;
}

.btn-filter {
  padding: 12px 16px;
  font-weight: 700;
  background: transparent;
  border-left: 6px solid transparent;
  text-align: left;
  color: #eaeaea;
  letter-spacing: 0.02em;
  border-radius: 15px;
  user-select: none;
  box-shadow: inset 0 0 8px rgba(0,0,0,0.07);
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
.btn-filter.active {
  background: rgba(255 255 255 / 0.28);
  border-left-color: #81c784;  /* soft green */
  color: #d0f0d8;
  box-shadow: 0 0 15px 4px rgba(129, 199, 132, 0.7);
}
.btn-filter:hover:not(.active) {
  background-color: rgba(255 255 255 / 0.15);
  border-left-color: #fff;
  color: #fff;
}

/* Add Note Button */
#add-note-btn {
  margin-top: auto;
  background: linear-gradient(145deg, #81c784, #66bb6a);
  color: #f0f8f0;
  font-weight: 900;
  font-size: 1.4rem;
  padding: 18px 12px;
  border-radius: 30px;
  user-select: none;
  box-shadow: 0 6px 18px rgba(102, 187, 106, 0.8);
  border: none;
  transition: background 0.5s ease, box-shadow 0.5s ease;
}
#add-note-btn:hover {
  background: linear-gradient(145deg, #66bb6a, #81c784);
  box-shadow: 0 10px 30px rgba(102, 187, 106, 1);
}

/* Search input */
#search-input {
  margin-bottom: 30px;
  padding: 14px 20px;
  border-radius: 40px;
  border: none;
  font-weight: 700;
  color: #222;
  box-shadow: inset 0 4px 15px rgba(255 255 255 / 0.3);
  transition: box-shadow 0.3s ease;
  user-select: text;
}
#search-input:focus {
  box-shadow: 0 0 25px 5px rgba(255 255 255 / 0.6);
}

/* Sort dropdown */
#sort-select {
  padding: 10px 18px;
  border-radius: 30px;
  margin-bottom: 30px;
  font-weight: 700;
  box-shadow: inset 0 4px 18px rgba(255 255 255 / 0.25);
  background: rgba(255 255 255 / 0.12);
  color: #eee;
  cursor: pointer;
  transition: background-color 0.3s ease;
  user-select: none;
}
#sort-select:hover, #sort-select:focus {
  background: rgba(255 255 255 / 0.28);
}

/* Category colors with subtle shadows */
.cat-Travel { border-left-color: #FF7043; box-shadow: 2px 0 8px rgba(255,112,67,0.35); }
.cat-Personal { border-left-color: #42A5F5; box-shadow: 2px 0 8px rgba(66,165,245,0.35); }
.cat-Life { border-left-color: #66BB6A; box-shadow: 2px 0 8px rgba(102,187,106,0.35); }
.cat-Work { border-left-color: #FFCA28; box-shadow: 2px 0 8px rgba(255,202,40,0.35); }
.cat-Other { border-left-color: #AB47BC; box-shadow: 2px 0 8px rgba(171,71,188,0.35); }

/* --- MAIN AREA --- */
#main {
  background: rgba(255 255 255 / 0.1);
  padding: 40px 55px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-radius: 30px 0 0 30px;
  box-shadow:
    inset 0 0 40px 3px rgba(255 255 255 / 0.18),
    0 25px 50px rgba(0, 0, 0, 0.85);
  backdrop-filter: saturate(210%) blur(18px);
  color: #f5f5f7;
  user-select: text;
}

#main h2 {
  font-size: 2.8rem;
  margin: 0 0 35px 0;
  font-weight: 900;
  color: #f8f8f8;
  letter-spacing: 0.02em;
  text-shadow: 0 3px 10px rgba(0,0,0,0.4);
  user-select: none;
}

#no-selection {
  margin: auto;
  font-size: 1.5rem;
  opacity: 0.75;
  text-align: center;
  font-style: italic;
  color: #cdd1d8;
}

/* NOTE EDITOR */
#note-editor {
  display: flex;
  flex-direction: column;
  gap: 25px;
  max-width: 720px;
  margin: 0 auto;
}
#note-title {
  font-size: 3rem;
  font-weight: 900;
  padding: 20px 30px;
  border-radius: 30px;
  border: none;
  outline: none;
  color: #222;
  background: rgba(255 255 255 / 0.97);
  box-shadow:
    inset 0 6px 20px rgba(0,0,0,0.05),
    0 6px 20px rgba(255 255 255, 0.85);
  transition: background-color 0.3s ease;
}
#note-title::placeholder {
  color: #aaa;
  font-weight: 600;
}
#note-title:focus {
  background: #fff;
  box-shadow: 0 0 16px 5px #66bb6aaa;
  color: #111;
}
#note-content {
  font-size: 1.7rem;
  padding: 30px 35px;
  border-radius: 35px;
  height: 200px;
  resize: vertical;
  border: none;
  outline: none;
  color: #222;
  background: rgba(255 255 255 / 0.97);
  box-shadow:
    inset 0 7px 25px rgba(0,0,0,0.07),
    0 8px 30px rgba(255 255 255, 0.9);
  transition: background-color 0.3s ease;
}
#note-content::placeholder {
  color: #bbb;
  font-weight: 600;
}
#note-content:focus {
  background: #fff;
  box-shadow: 0 0 20px 6px #66bb6a99;
  color: #222;
}

#category-select {
  width: 180px;
  font-weight: 900;
  padding: 14px 20px;
  border-radius: 35px;
  border: 3px solid transparent;
  outline: none;
  cursor: pointer;
  transition: border-color 0.5s ease;
  color: #222;
  background: #fff;
  box-shadow:
    inset 0 2px 8px rgba(0,0,0,0.13),
    0 2px 5px rgba(0,0,0,0.15);
}
#category-select:hover {
  border-color: #66bb6a;
}
#category-select:focus {
  border-color: #4caf50;
}

/* Favorite and delete buttons */
#note-actions {
  display: flex;
  gap: 30px;
  align-items: center;
}
#fav-btn {
  font-size: 2.4rem;
  user-select: none;
  cursor: pointer;
  color: #bbb;
  transition: color 0.3s ease, text-shadow 0.3s ease;
  text-shadow: 0 0 6px rgba(255 215 0, 0.35);
}
#fav-btn.fav {
  color: #FFD700;
  text-shadow:
    0 0 12px 4px #ffd700bb,
    0 0 20px 8px #ffd70099;
}
#fav-btn:hover {
  color: #ffe564;
  text-shadow:
    0 0 15px 6px #ffe564bb,
    0 0 24px 10px #ffe56499;
}
#delete-btn {
  font-size: 2.4rem;
  user-select: none;
  cursor: pointer;
  color: #e55353;
  transition: color 0.3s ease, text-shadow 0.3s ease;
  text-shadow: 0 0 5px rgba(229, 83, 83, 0.6);
}
#delete-btn:hover {
  color: #ff0000;
  text-shadow:
    0 0 15px 5px #ff0000aa,
    0 0 25px 12px #ff000099;
}

/* TASK LIST */
#tasks {
  margin-top: 20px;
}
#tasks h3 {
  margin-bottom: 14px;
  color: #d8d8d8;
  letter-spacing: 0.03em;
  font-weight: 700;
  font-size: 1.6rem;
}
.task-item {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  background: rgba(255 255 255 / 0.12);
  border-radius: 20px;
  padding: 10px 18px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.06);
  transition: all 0.3s ease;
}
.task-item:hover {
  background-color: rgba(255 255 255 / 0.22);
  box-shadow: 0 4px 15px rgba(255 255 255 / 0.25);
  transform: scale(1.04);
}
.task-item input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: #66bb6a;
  cursor: pointer;
}
.task-item input[type="text"] {
  flex-grow: 1;
  padding: 8px 12px;
  border-radius: 14px;
  border: none;
  outline: none;
  color: #222;
  font-size: 1.2rem;
  box-shadow: inset 0 3px 12px rgba(0,0,0,0.07);
  transition: box-shadow 0.3s ease;
}
.task-item input[type="text"]:focus {
  box-shadow: 0 0 10px 3px #66bb6aaa;
}
.task-item button.delete-task-btn {
  background: #e55353;
  color: white;
  font-weight: 700;
  font-size: 1.2rem;
  border-radius: 14px;
  padding: 6px 14px;
  box-shadow: 0 3px 12px rgba(229, 83, 83, 0.8);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}
.task-item button.delete-task-btn:hover {
  background: #ff0000;
  box-shadow: 0 6px 20px rgba(255, 0, 0, 0.95);
}
#add-task-btn {
  margin-top: 18px;
  padding: 12px 18px;
  background: #66bb6a;
  color: white;
  border-radius: 30px;
  font-weight: 700;
  font-size: 1.3rem;
  box-shadow: 0 5px 20px rgba(102, 187, 106, 0.85);
  transition: background 0.4s ease, box-shadow 0.4s ease;
  cursor: pointer;
}
#add-task-btn:hover {
  background: #4caf50;
  box-shadow: 0 8px 28px rgba(76, 175, 80, 1);
}

/* SETTINGS */
#settings {
  margin-top: 30px;
  user-select: none;
}
#settings label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: #d8d8d8;
  font-size: 1.1rem;
}
#settings input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: #66bb6a;
  cursor: pointer;
}
#settings button {
  margin-top: 18px;
  background: #ffb74d;
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 800;
  color: #222;
  box-shadow: 0 5px 18px rgba(255, 183, 77, 0.85);
  transition: background 0.4s ease, box-shadow 0.4s ease;
  cursor: pointer;
}
#settings button:hover {
  background: #ffa726;
  box-shadow: 0 9px 30px rgba(255, 167, 38, 1);
}

/* Animate notes and tasks */
#note-list button,
.task-item {
  transition: all 0.3s ease-in-out;
}

#note-list button:hover,
.task-item:hover {
  transform: scale(1.04);
  background-color: rgba(255 255 255 / 0.22);
  box-shadow: 0 5px 18px rgba(255 255 255 / 0.3);
}
