/* Notes V2 Styling - Console Ready */

.notes-v2 {
  height: 100%;
  display: flex;
  flex-direction: column;
  color: var(--text);
  overflow: hidden;
}

.notes-v2-header {
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: var(--line);
  z-index: 10;
}

.notes-v2-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.notes-v2-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.notes-v2-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 48px 0 24px;
  opacity: 0.9;
  letter-spacing: -0.01em;
}
.nh-left, .nbh-left{display:flex;gap: 10px;align-items: center;}

.premium-header {
  background: var(--bg);
  border-bottom: var(--line);
  padding: 8px 16px;
  display: grid !important;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.premium-header .nh-left { justify-self: start; }
.premium-header .nh-center { justify-self: center; display: flex; gap: 8px; }
.premium-header .nh-right { justify-self: end; }

.notes-v2 .search-wrap {
  display: flex;
  align-items: center;
  background: var(--strans);
  border: var(--line);
  border-radius: 8px;
  padding: 4px 12px;
  gap: 8px;
  width: 240px;
}

.search-wrap input {
  background: transparent;
  border: none;
  font-size: 13px;
  color: var(--text);
  width: 100%;
  padding: 0;
}

.v-line {
  width: 1px;
  height: 24px;
  background: var(--line);
  margin: 0 4px;
}

.note-title-input {
  font-size: 2.25rem !important;
  margin-bottom: 8px;
}

.created-at-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 32px;
  display: block;
}

/* Notebook Cards (Skeuomorphic & Premium) */
.notebook-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px 10px;
}

.notebook-card {
  position: relative;
  width: 170px;
  height: 240px;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.2, 1, 0.3, 1), box-shadow 0.4s ease;
  perspective: 1200px;
}

.notebook-card:hover {
  transform: translateY(-4px) rotateY(-15deg) scale(1.02);
}

.notebook-cover {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--primary)15%, var(--bg));
  border-radius: 3px 18px 18px 3px;
  box-shadow: -5px 5px 3px -1px var(--card-bg),
    5px 10px 10px rgba(0,0,0,0.5),
    inset 2px 2px 0 rgba(255,255,255,0.15);
  display: flex;
  flex-direction: column;
  padding: 28px;
}

.notebook-cover::before {
  height: 107%;
  content: '';
  position: absolute;
  left: 16px;
  top: 0;
  width: 8px;
  background: var(--selectionColor);
  box-shadow: 1px 0 0 rgba(255,255,255,0.08);
  z-index: -1;
}

.notebook-label {
  background: #fff;
  box-shadow: 1px 1px 4px 1px var(--card-bg);
  padding: 8px 4px;
  border-radius: 4px;
  color: #111;
  font-weight: 600;
  font-size: 12px;
  text-align: center;
  margin-top: 48px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.notebook-shared-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 30px;
  height: 30px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  backdrop-filter: blur(4px);
  color: #fff;
}

.notebook-owner-info {
  position: absolute;
  bottom: -15px;
  right: 15px;
  width: 36px;
  height: 36px;
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 900;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
  z-index: 5;
}

.notebook-meta {
  margin-top: auto;
  font-size: 12px;
  font-weight: 600;
}

.notebook-menu-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.3);
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.3s;
  color: #fff;
  border: none;
  cursor: pointer;
}

.notebook-card:hover .notebook-menu-btn {
  opacity: 1;
}

/* Note Grids & Autofill */
.notes-grid {
  display: grid;
  gap: 20px;
}

.notes-grid.mode-grid {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.notes-grid.mode-list {
  grid-template-columns: 1fr;
}

.notes-grid.mode-autofill {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  grid-auto-rows: min-content;
}

.note-v2-card {
  background: var(--surface);
  border: var(--line);
  border-radius: 20px;
  padding: 24px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.note-v2-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: var(--primary);
  opacity: 0;
  transition: opacity 0.3s;
}

.note-v2-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.2);
}

.note-v2-card:hover::before {
  opacity: 1;
}

.note-v2-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.note-v2-title {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  flex: 1;
}

.note-v2-menu-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--strans);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
}

.note-v2-card:hover .note-v2-menu-btn {
  opacity: 1;
}

.note-v2-menu-btn:hover {
  background: var(--line);
  color: var(--text);
}

.note-v2-preview {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Sidebar & Console UI */
.notes-sidebar-mini {
  width: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 32px 0;
  border-left: 1px solid var(--line);
  background: var(--side);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

.notes-sidebar-item {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

.notes-sidebar-item:hover {
  background: var(--strans);
  color: var(--text);
  transform: scale(1.05);
}

.notes-sidebar-item.active {
  background: var(--primary-faded);
  color: var(--primary);
  border-color: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.2);
}

.notes-sidebar-item i {
  font-size: 22px;
}

.notes-sidebar-expanded {
  padding: 15px 10px;
  display: flex;
  flex-direction: column;
  gap: 25px;
  height: 100%;
  overflow-y: auto;
}

.sidebar-section-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--bg-light);
  opacity: 0.5;
}

.notes-sidebar-expanded section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--muted);
  border-radius: 15px;
  padding: 10px;
}

.sb-link-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--strans);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s;
  margin-bottom: 6px;
}

.sb-link-item:hover {
  background: var(--line);
  border-color: var(--primary);
}

.sb-ai-card {
  background: linear-gradient(135deg, var(--strans), rgba(var(--primary-rgb), 0.05));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}

.sb-ai-prompt {
  font-weight: 600;
  font-size: 11px;
  color: var(--primary);
  margin-bottom: 4px;
}

.sb-ai-result {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
}

.sb-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.sb-nav-item:hover {
  background: var(--strans);
}

.notes-sidebar-mini {
  padding-top: 20px;
}

.notes-sidebar-item {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.notes-sidebar-item:hover, .notes-sidebar-item.active {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
}

.notes-sidebar-item.active::after {
  content: '';
  position: absolute;
  right: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  background: var(--primary);
  border-radius: 3px 0 0 3px;
}

.acc-details{display:flex;flex-direction: column;}
.access-item{display:flex;align-items: center;gap: 10px;}
.avatar-sm{display: flex;align-items: center;justify-content: center;width: 24px;height: 24px;border-radius: 10px;}
/* Shared Empty State Animation */
.shared-empty {
  padding: 80px 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  background: var(--strans);
  border-radius: 32px;
  border: 1px dashed var(--line);
}

.shared-empty-visual {
  width: 160px;
  height: 160px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Editor Adjustments */
.note-editor-v2 {
  max-width: 900px;
  margin: 0 auto;
  min-height: 70vh;
}

.note-title-input {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  width: 100%;
  outline: none;
}

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

.note-attachments-stage {
  margin-top: 60px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--strans);
  position: relative;
  min-height: 500px;
  overflow: hidden;
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 30px 30px;
  cursor: grab;
}

.note-attachments-stage:active {
  cursor: grabbing;
}

.note-attachments-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
  pointer-events: none;
}

.note-attachments-canvas > * {
  pointer-events: auto;
}

.note-attach {
  position: absolute;
  background: var(--bg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  border-radius: 12px;
  padding: 12px;
  min-width: 200px;
  max-width: 400px;
  cursor: default;
  transition: box-shadow 0.2s, border-color 0.2s;
  z-index: 10;
}

.note-attach:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.note-attach-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  cursor: grab;
}

.note-attach-head:active {
  cursor: grabbing;
}

.note-attach-title {
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.canvas-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--text-muted);
  pointer-events: none;
  opacity: 0.7;
}

.ce-block:hover .ce-drag-handle {
  opacity: 1;
}

.ce-drag-handle:hover {
  color: var(--primary);
}

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

/* Animations */
.notes-view {
  animation: notes-in 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes notes-in {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
