/* ---------------- THEME ---------------- */

:root {
  --bg: #fafafa;
  --panel: #f2f2f2;
  --editor: #ffffff;
  --text: #1a1a1a;
  --muted: #7a7a7a;
  --accent: #111111;
  --danger: #d11a2a;
  --shadow: rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
  --bg: #0f0f10;
  --panel: #171718;
  --editor: #1c1c1e;
  --text: #eaeaea;
  --muted: #9a9a9a;
  --accent: #ffffff;
  --danger: #ff4d4f;
  --shadow: rgba(0, 0, 0, 0.4);
}

/* ---------------- RESET ---------------- */

* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

/* ---------------- TOP BAR ---------------- */

#topbar {
  height: 52px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#topbar h1 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.4px;
  opacity: 0.8;
}

#theme-toggle {
  border: none;
  background: var(--panel);
  color: var(--text);
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
  box-shadow: 0 6px 16px var(--shadow);
}

/* ---------------- LAYOUT ---------------- */

#app {
  display: flex;
  height: calc(100vh - 52px);
  padding: 14px;
  gap: 14px;
}

/* ---------------- SIDEBAR ---------------- */

#notes-list {
  width: 260px;
  background: var(--panel);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px var(--shadow);
}

/* New Note Button */

#new-note {
  border: none;
  background: var(--accent);
  color: var(--bg);
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 12px;
}

/* ---------------- TABS ---------------- */

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.tab {
  flex: 1;
  padding: 8px 10px;
  border-radius: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-weight: 500;
}

.tab:hover {
  background: rgba(0,0,0,0.05);
  color: var(--text);
}

[data-theme="dark"] .tab:hover {
  background: rgba(255,255,255,0.08);
}

.tab.active {
  background: var(--editor);
  color: var(--text);
  box-shadow: 0 4px 12px var(--shadow);
}

/* ---------------- NOTES LIST ---------------- */

#notes {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
}

#notes li {
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.15s ease;
}

#notes li:hover {
  background: rgba(0,0,0,0.05);
  color: var(--text);
}

[data-theme="dark"] #notes li:hover {
  background: rgba(255,255,255,0.08);
}

#notes li.active {
  background: var(--editor);
  color: var(--text);
  box-shadow: 0 4px 14px var(--shadow);
}

/* ---------------- EDITOR ---------------- */

#editor {
  flex: 1;
  background: var(--editor);
  border-radius: 20px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 14px 40px var(--shadow);
}

#note-title {
  font-size: 26px;
  font-weight: 600;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  margin-bottom: 16px;
}

#note-content {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  font-size: 16px;
  line-height: 1.7;
  background: transparent;
  color: var(--text);
}

/* ---------------- DELETE ACTION ---------------- */

.editor-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

#delete-note {
  border: none;
  background: rgba(209, 26, 42, 0.08);
  color: var(--danger);
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 500;
  cursor: pointer;
}

#delete-note:hover {
  background: rgba(209, 26, 42, 0.18);
}

/* ---------------- DISABLED ---------------- */

button:disabled,
input:disabled,
textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------------- TRASH MODE ---------------- */

.trash-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.trash-actions button {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}

/* Restore */

.restore-btn {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}

.restore-btn:hover {
  background: rgba(0, 0, 0, 0.12);
}

/* Delete Forever */

.delete-forever-btn {
  background: rgba(209, 26, 42, 0.15);
  color: var(--danger);
}

.delete-forever-btn:hover {
  background: rgba(209, 26, 42, 0.28);
}

/* Trash list items look different */

[data-theme="dark"] .trash-actions .restore-btn {
  background: rgba(255,255,255,0.08);
}

#notes li.trash {
  opacity: 0.85;
}
