/* ========================================
   NOTES SIDEBAR (Notion-style)
   ======================================== */

.sidebar-toggle {
  color: #696969;
  font-size: 22px;
  margin-right: 10px;
  cursor: pointer;
  transition: color 0.2s ease;
  user-select: none;
  vertical-align: middle;
  display: inline-block;
  line-height: 1;
}

.sidebar-toggle:hover {
  color: #50ca59;
}

/* Hide sidebar toggle on mobile */
@media screen and (max-width: 770px) {
  .sidebar-toggle {
    display: none !important;
  }
}

.notes-sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.notes-sidebar-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.notes-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100%;
  background: #fff;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  z-index: 99999;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.notes-sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #ddd;
  background: #f8f9fa;
}

.sidebar-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #696969;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-header h3 i {
  font-size: 18px;
}

.sidebar-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #696969;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s ease;
}

.sidebar-close:hover {
  color: #333;
}

.sidebar-search {
  position: relative;
  padding: 12px 16px;
  border-bottom: 1px solid #ddd;
}

.sidebar-search input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}

.sidebar-search input:focus {
  border-color: #50ca59;
}

.sidebar-search i {
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  color: #a4a4a4;
  font-size: 16px;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.notes-list-sidebar {
  flex: 1;
  overflow-y: auto;
}

.sidebar-note-item {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  color: #696969;
  transition: background-color 0.2s ease;
  cursor: pointer;
}

.sidebar-note-item:hover {
  background-color: #f8f9fa;
}

.sidebar-note-title {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  word-break: break-word;
}

.sidebar-note-title i.ion-locked {
  color: #f39c12;
  font-size: 14px;
  flex-shrink: 0;
  margin-left: 6px;
}

.sidebar-note-meta {
  font-size: 12px;
  color: #a4a4a4;
  display: flex;
  align-items: center;
  gap: 4px;
}

.sidebar-note-meta i {
  font-size: 12px;
}

.sidebar-loading,
.sidebar-empty,
.sidebar-error {
  padding: 40px 20px;
  text-align: center;
  color: #a4a4a4;
}

.sidebar-loading i,
.sidebar-empty i,
.sidebar-error i {
  font-size: 32px;
  display: block;
  margin-bottom: 12px;
}

.sidebar-loading i {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.sidebar-empty p,
.sidebar-error p {
  margin: 8px 0;
  font-size: 14px;
}

.sidebar-empty a {
  color: #50ca59;
  text-decoration: none;
  font-size: 13px;
}

.sidebar-empty a:hover {
  text-decoration: underline;
}

.sidebar-actions {
  border-top: 1px solid #ddd;
  padding: 12px 8px;
  background: #f8f9fa;
}

.sidebar-actions a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: #696969;
  text-decoration: none;
  font-size: 14px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.sidebar-actions a:hover {
  background-color: rgba(80, 202, 89, 0.1);
  color: #50ca59;
}

.sidebar-actions a i {
  font-size: 16px;
}

/* Mobile responsive */
@media only screen and (max-width: 768px) {
  .notes-sidebar {
    width: 85%;
    max-width: 320px;
  }
}

