/* ===== STICKY NOTES — JDStuff ===== */

.sticky-page-title {
  font-size: 2rem;
}

/* ---------- TOOLBAR ---------- */
.notes-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: 16px;
  margin-bottom: 1.5rem;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-add-note {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border: 1px solid var(--button-primary-border);
  border-radius: var(--button-radius);
  background: var(--button-primary-bg);
  color: var(--button-primary-text);
  font-weight: 750;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-add-note:hover {
  transform: translateY(-2px);
  background: var(--button-primary-hover-bg);
}

.btn-add-note:active {
  transform: translateY(0) scale(0.97);
}

.search-box {
  position: relative;
}

.search-box i {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 0.85rem;
  pointer-events: none;
}

.search-input {
  padding: 0.55rem 0.85rem 0.55rem 2.25rem;
  border: 1px solid var(--control-border);
  border-radius: var(--control-radius);
  background: var(--control-bg);
  color: var(--text-primary);
  font-size: 0.85rem;
  width: 220px;
  min-height: var(--control-height);
  transition: all 0.3s ease;
}

.search-input::placeholder { color: var(--control-placeholder); }

.search-input:focus {
  outline: none;
  border-color: var(--control-border-focus);
  background: var(--control-bg-hover);
  box-shadow: var(--control-focus-ring);
  width: 260px;
}

.notes-counter {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.notes-counter span { color: var(--gradient-text-from); font-weight: 700; }

.btn-clear-all {
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--button-danger-border);
  border-radius: var(--button-radius);
  background: var(--button-danger-bg);
  color: var(--button-danger-text);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-clear-all:hover {
  background: var(--button-danger-hover-bg);
  border-color: var(--button-danger-border);
}

.btn-export-notes {
  color: var(--button-secondary-text);
  border-color: var(--button-secondary-border);
  background: var(--button-secondary-bg);
}

/* ---------- GRID ---------- */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  min-height: 200px;
  align-items: start;
}

/* ---------- SINGLE NOTE CARD ---------- */
.note-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
  animation: noteAppear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes noteAppear {
  from { opacity: 0; transform: scale(0.85) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.note-card:hover {
  transform: translateY(-4px) rotate(-0.5deg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.note-card.dragging { opacity: 0.5; transform: scale(0.95); }
.note-card.drag-over { border: 2px dashed var(--bs-primary); }

.note-accent { height: 5px; width: 100%; }

.note-drag-handle {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem 0 0.25rem;
  color: var(--text-secondary);
  opacity: 0.3;
  cursor: grab;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.note-drag-handle:hover {
  opacity: 0.8;
  color: var(--text-primary);
}

.note-drag-handle:active {
  cursor: grabbing;
}

.note-body { padding: 1rem 1.15rem 0.75rem; }

.note-body-compact {
  padding-top: 0.25rem;
}

.note-title-input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1rem;
  padding: 0;
  margin-bottom: 0.5rem;
  outline: none;
  font-family: 'Inter', sans-serif;
}

.note-title-input::placeholder { color: var(--text-secondary); opacity: 0.6; }

.note-content-input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.875rem;
  line-height: 1.6;
  padding: 0;
  resize: none;
  outline: none;
  min-height: 80px;
  font-family: 'Inter', sans-serif;
}

.note-content-input::placeholder { color: var(--text-secondary); opacity: 0.5; }

.note-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1.15rem 0.85rem;
}

.note-timestamp { font-size: 0.7rem; color: var(--text-secondary); opacity: 0.7; }

.note-actions {
  display: flex;
  gap: 0.35rem;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.note-card:hover .note-actions { opacity: 1; }

.note-action-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--button-secondary-border); border-radius: var(--button-radius);
  background: var(--button-secondary-bg);
  color: var(--button-secondary-text);
  cursor: pointer; font-size: 0.75rem;
  transition: all 0.2s ease;
}

.note-action-btn:hover { background: var(--button-secondary-hover-bg); color: var(--button-secondary-text); }
.note-action-btn.delete:hover {
  border-color: var(--button-danger-border);
  background: var(--button-danger-hover-bg);
  color: var(--button-danger-text);
}
.note-action-btn.pin-active { color: #fbbf24; }

/* Color palette */
.color-palette {
  display: flex; gap: 0.35rem;
  padding: 0 1.15rem;
  max-height: 0; overflow: hidden; opacity: 0;
  transition: all 0.3s ease;
}

.note-card.show-colors .color-palette {
  opacity: 1; max-height: 40px; padding-bottom: 0.5rem;
}

.color-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.color-dot:hover { transform: scale(1.25); }
.color-dot.active { border-color: var(--text-primary); box-shadow: 0 0 0 2px var(--glass-bg); }

.color-dot[data-color="default"] { background: #3b82f6; }
.color-dot[data-color="rose"] { background: #f43f5e; }
.color-dot[data-color="amber"] { background: #f59e0b; }
.color-dot[data-color="emerald"] { background: #10b981; }
.color-dot[data-color="violet"] { background: #8b5cf6; }
.color-dot[data-color="sky"] { background: #0ea5e9; }

/* Note color themes */
.note-color-default .note-accent { background: linear-gradient(90deg, #3b82f6, #8b5cf6); }
.note-color-rose .note-accent { background: linear-gradient(90deg, #f43f5e, #ec4899); }
.note-color-amber .note-accent { background: linear-gradient(90deg, #f59e0b, #f97316); }
.note-color-emerald .note-accent { background: linear-gradient(90deg, #10b981, #06b6d4); }
.note-color-violet .note-accent { background: linear-gradient(90deg, #8b5cf6, #a855f7); }
.note-color-sky .note-accent { background: linear-gradient(90deg, #0ea5e9, #38bdf8); }

.note-color-default { background: var(--glass-bg); border: 1px solid var(--glass-border); }
.note-color-rose { background: rgba(244, 63, 94, 0.08); border: 1px solid rgba(244, 63, 94, 0.15); }
.note-color-amber { background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.15); }
.note-color-emerald { background: rgba(16, 185, 129, 0.08); border: 1px solid rgba(16, 185, 129, 0.15); }
.note-color-violet { background: rgba(139, 92, 246, 0.08); border: 1px solid rgba(139, 92, 246, 0.15); }
.note-color-sky { background: rgba(14, 165, 233, 0.08); border: 1px solid rgba(14, 165, 233, 0.15); }

[data-theme="light"] .note-color-default { background: rgba(255, 255, 255, 0.75); }
[data-theme="light"] .note-color-rose { background: rgba(244, 63, 94, 0.06); border-color: rgba(244, 63, 94, 0.12); }
[data-theme="light"] .note-color-amber { background: rgba(245, 158, 11, 0.06); border-color: rgba(245, 158, 11, 0.12); }
[data-theme="light"] .note-color-emerald { background: rgba(16, 185, 129, 0.06); border-color: rgba(16, 185, 129, 0.12); }
[data-theme="light"] .note-color-violet { background: rgba(139, 92, 246, 0.06); border-color: rgba(139, 92, 246, 0.12); }
[data-theme="light"] .note-color-sky { background: rgba(14, 165, 233, 0.06); border-color: rgba(14, 165, 233, 0.12); }

/* Pinned */
.note-card.pinned { order: -1; }
.note-card.pinned::after {
  content: '📌'; position: absolute; top: 12px; right: 12px;
  font-size: 0.85rem; opacity: 0.8;
}

/* Tags */
.note-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0 1.15rem 0.25rem; }

.note-tag {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.15rem 0.5rem; border-radius: 6px;
  background: var(--glass-subtle-bg);
  color: var(--text-secondary); font-size: 0.7rem; font-weight: 500;
}

.note-tag .remove-tag { cursor: pointer; opacity: 0.5; transition: opacity 0.2s; font-size: 0.6rem; }
.note-tag .remove-tag:hover { opacity: 1; }

.tag-input-wrapper { padding: 0 1.15rem 0.5rem; }

.tag-input {
  width: 100%; border: none; background: transparent;
  color: var(--text-secondary); font-size: 0.7rem; outline: none;
  padding: 0.2rem 0; font-family: 'Inter', sans-serif;
}

.tag-input::placeholder { color: var(--text-secondary); opacity: 0.4; }

/* ---------- EMPTY STATE ---------- */
.empty-state {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 4rem 2rem; text-align: center;
}

.empty-icon {
  font-size: 4rem; margin-bottom: 1.25rem; opacity: 0.6;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.empty-state h3 { font-weight: 700; margin-bottom: 0.5rem; font-size: 1.25rem; }
.empty-state p { color: var(--text-secondary); font-size: 0.9rem; max-width: 360px; }

/* ---------- TOAST ---------- */
.toast-notification {
  position: fixed; bottom: 2rem; left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 0.75rem 1.5rem; border-radius: 12px;
  background: var(--glass-bg); backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border); color: var(--text-primary);
  font-size: 0.85rem; font-weight: 500;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 9999; opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.toast-notification.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Delete animation */
.note-card.removing {
  animation: noteRemove 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes noteRemove {
  to { opacity: 0; transform: scale(0.8) translateY(-10px); }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
  .notes-toolbar { flex-direction: column; align-items: stretch; gap: 0.75rem; }
  .toolbar-left, .toolbar-right { width: 100%; justify-content: space-between; }
  .search-input, .search-input:focus { width: 100%; flex: 1; }
  .notes-grid { grid-template-columns: 1fr; }
  .note-actions { opacity: 1; }
  .btn-add-note { flex: 1; justify-content: center; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .notes-grid { grid-template-columns: repeat(2, 1fr); }
}
