/* ============================================================
   TALAN.PRO — Notes Tool Styles
   ============================================================ */

/* ── Background ── */
.orb { opacity: 0.12; }

.orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #b388ff, transparent 70%);
  top: -150px; right: -100px;
  animation: orb-float-2 20s ease-in-out infinite;
}

.orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #4fc3f7, transparent 70%);
  bottom: -80px; left: -80px;
  animation: orb-float-1 18s ease-in-out infinite;
}

/* ── Notes Layout ── */
.notes-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-6);
  height: calc(100vh - 180px);
  min-height: 500px;
}

/* ── Sidebar ── */
.notes-sidebar {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  border-radius: var(--radius-2xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-top {
  padding: var(--space-4);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.sidebar-search {
  position: relative;
}

.sidebar-search input {
  width: 100%;
  padding: var(--space-2) var(--space-4) var(--space-2) var(--space-8);
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: var(--text-sm);
  outline: none;
  transition: border-color var(--duration-fast);
}

.sidebar-search input:focus {
  border-color: rgba(79,195,247,0.4);
}

.sidebar-search input::placeholder { color: var(--text-muted); }

.search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.new-note-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-violet));
  border: none;
  border-radius: var(--radius-full);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-spring), box-shadow var(--duration-fast);
  box-shadow: 0 0 16px rgba(79,195,247,0.25);
}

.new-note-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 0 28px rgba(79,195,247,0.4);
}

/* Note list */
.notes-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.note-item {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--duration-fast);
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
}

.note-item:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border);
}

.note-item.active {
  background: var(--accent-blue-dim);
  border-color: rgba(79,195,247,0.25);
}

.note-item-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-item-preview {
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-item-date {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.note-delete {
  position: absolute;
  top: 50%;
  right: var(--space-2);
  transform: translateY(-50%);
  width: 20px; height: 20px;
  border-radius: 50%;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background var(--duration-fast), color var(--duration-fast);
}

.note-item:hover .note-delete { display: flex; }
.note-delete:hover { background: rgba(255,100,100,0.15); color: #ff6464; }

.notes-empty-state {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* ── Editor ── */
.notes-editor {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  border-radius: var(--radius-2xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-toolbar {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.note-title-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  outline: none;
  min-width: 0;
  font-family: var(--font-sans);
}

.note-title-input::placeholder { color: var(--text-muted); }

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: all var(--duration-fast);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.toolbar-btn:hover {
  background: var(--glass-bg-hover);
  color: var(--text-primary);
}

.toolbar-btn.active {
  background: var(--accent-blue-dim);
  border-color: rgba(79,195,247,0.25);
  color: var(--accent-blue);
}

.save-indicator {
  font-size: var(--text-xs);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.save-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #50fa7b;
  box-shadow: 0 0 6px #50fa7b;
}

/* Editor / Preview area */
.editor-body {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.note-textarea {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: var(--text-base);
  font-family: var(--font-mono);
  line-height: 1.8;
  padding: var(--space-6);
  resize: none;
  outline: none;
  caret-color: var(--accent-blue);
}

.note-textarea::placeholder { color: var(--text-muted); }

.note-preview {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: var(--space-6);
  color: var(--text-primary);
  font-size: var(--text-base);
  line-height: 1.8;
  display: none;
}

.note-preview.visible { display: block; }

/* Markdown rendered styles */
.note-preview h1 { font-size: var(--text-2xl); font-weight: var(--weight-bold); margin-bottom: var(--space-4); background: linear-gradient(135deg, var(--accent-blue), var(--accent-violet)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.note-preview h2 { font-size: var(--text-xl); font-weight: var(--weight-bold); margin-bottom: var(--space-3); color: var(--text-primary); }
.note-preview h3 { font-size: var(--text-lg); font-weight: var(--weight-semibold); margin-bottom: var(--space-2); }
.note-preview p  { margin-bottom: var(--space-4); color: var(--text-secondary); }
.note-preview code { font-family: var(--font-mono); font-size: 0.9em; background: rgba(79,195,247,0.1); border: 1px solid rgba(79,195,247,0.15); border-radius: 4px; padding: 1px 6px; color: var(--accent-blue); }
.note-preview pre { background: rgba(0,0,0,0.3); border: 1px solid var(--glass-border); border-radius: var(--radius-md); padding: var(--space-4); overflow-x: auto; margin-bottom: var(--space-4); }
.note-preview pre code { background: none; border: none; padding: 0; color: var(--text-primary); }
.note-preview blockquote { border-left: 3px solid var(--accent-violet); margin: 0 0 var(--space-4) 0; padding-left: var(--space-4); color: var(--text-muted); }
.note-preview ul, .note-preview ol { margin-bottom: var(--space-4); padding-left: var(--space-6); }
.note-preview li { margin-bottom: var(--space-1); color: var(--text-secondary); list-style: disc; }
.note-preview a { color: var(--accent-blue); text-decoration: underline; }
.note-preview strong { font-weight: var(--weight-bold); color: var(--text-primary); }
.note-preview em { font-style: italic; color: var(--text-secondary); }
.note-preview hr { border: none; border-top: 1px solid var(--glass-border); margin: var(--space-6) 0; }

.editor-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: var(--text-base);
  text-align: center;
  padding: var(--space-16);
}

.editor-placeholder-icon { font-size: 48px; margin-bottom: var(--space-4); opacity: 0.4; }

@media (max-width: 768px) {
  .notes-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .notes-sidebar { max-height: 280px; }
}
