/* todo-notes — vanilla port of master-pm/project-hub TodoNotesWidget.
   Scoped under .tn- prefix to avoid clashes with reveal.js / Tokyo Midnight. */

.tn-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #141828;
  color: #f2f2f5;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  font: 600 14px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  transition: transform 120ms ease, background 120ms ease;
}
.tn-fab:hover { background: #1b2238; transform: translateY(-1px); }
.tn-fab .tn-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: #ff4d7e;
  color: #0b0e1a;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.tn-panel {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  width: 360px;
  max-height: 70vh;
  background: #0b0e1a;
  border: 1px solid #2a3147;
  border-radius: 10px;
  color: #f2f2f5;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
}

.tn-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid #2a3147;
  background: #141828;
  border-radius: 10px 10px 0 0;
}
.tn-title { font-weight: 600; letter-spacing: 0.02em; }
.tn-page-key {
  color: #7a8699;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  margin-left: 6px;
}
.tn-header-btn {
  background: transparent;
  border: 0;
  color: #7a8699;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1;
}
.tn-header-btn:hover { color: #f2f2f5; background: #1b2238; }

.tn-list {
  overflow-y: auto;
  padding: 8px 4px 8px 8px;
  flex: 1;
}

.tn-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 4px 0;
}
.tn-row[data-done='1'] {
  align-items: center;
  padding: 1px 0;
}

.tn-status-btn {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  border: 1px solid #2a3147;
  border-radius: 4px;
  background: transparent;
  color: #f2f2f5;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1;
  margin-top: 2px;
}
.tn-status-btn:hover { border-color: #7a8699; }
.tn-status-btn[data-status='new']        { color: transparent; }
.tn-status-btn[data-status='vibecoded']  { background: #1b2238; border-color: #ff4d7e; color: #ff4d7e; }
.tn-status-btn[data-status='checked']    { background: #ff4d7e; border-color: #ff4d7e; color: #0b0e1a; }

.tn-text {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  color: #f2f2f5;
  font: inherit;
  padding: 3px 0;
  resize: none;
  overflow: hidden;
}

.tn-done-text {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
  color: #7a8699;
  font: inherit;
  font-size: 12px;
  padding: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.tn-done-text-label {
  text-decoration: line-through;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 auto;
  min-width: 0;
}
.tn-done-date {
  flex: 0 0 auto;
  color: #4f5566;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 10px;
}

.tn-remove-btn {
  flex: 0 0 auto;
  background: transparent;
  border: 0;
  color: #7a8699;
  cursor: pointer;
  padding: 0 4px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 120ms ease;
}
.tn-row:hover .tn-remove-btn { opacity: 1; }
.tn-remove-btn:hover { color: #ff4d7e; }

.tn-footer {
  padding: 6px 12px;
  border-top: 1px solid #2a3147;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #7a8699;
  background: #141828;
  border-radius: 0 0 10px 10px;
}
.tn-legend {
  display: flex;
  gap: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
.tn-legend span { display: inline-flex; align-items: center; gap: 4px; }

.tn-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 2px;
  border: 1px solid #2a3147;
}
.tn-dot[data-status='vibecoded'] { background: #1b2238; border-color: #ff4d7e; }
.tn-dot[data-status='checked']   { background: #ff4d7e; border-color: #ff4d7e; }

.tn-saving-pulse {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #7a8699;
}
.tn-saving-pulse[data-state='saving'] {
  background: #ff4d7e;
  animation: tn-pulse 800ms ease-in-out infinite alternate;
}
.tn-saving-pulse[data-state='error'] { background: #b94a4a; }
@keyframes tn-pulse { from { opacity: 0.3; } to { opacity: 1; } }

.tn-empty {
  padding: 12px 8px;
  color: #7a8699;
  font-size: 12px;
}
.tn-empty-add {
  margin-top: 8px;
  background: transparent;
  border: 1px dashed #2a3147;
  color: #7a8699;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  width: 100%;
  font: inherit;
}
.tn-empty-add:hover { border-color: #7a8699; color: #f2f2f5; }
