/* ════════════════════════════════════════════════════════════════
   notes-widget.css — Floating notes widget for DSA viz pages.
   Mounted by notes-widget.js. Self-contained; uses viz-core.css
   custom properties when available (with fallbacks for safety).
   ════════════════════════════════════════════════════════════════ */

.dsa-notes-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--blue, #388bfd);
  color: #fff;
  border: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  line-height: 1;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s;
}
.dsa-notes-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45);
}
.dsa-notes-fab.on {
  background: var(--cyan, #79c0ff);
  color: #0d1117;
}
.dsa-notes-fab-icon {
  pointer-events: none;
}
.dsa-notes-fab-badge {
  display: none;
  position: absolute;
  top: 6px;
  right: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green, #3fb950);
  border: 2px solid var(--bg, #0d1117);
}
.dsa-notes-fab-badge[data-shown='true'] {
  display: block;
}

.dsa-notes-panel {
  position: fixed;
  right: 22px;
  bottom: 86px;
  width: 360px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 130px);
  background: var(--bg2, #161b22);
  color: var(--text, #e6edf3);
  border: 1px solid var(--border, #30363d);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  overflow: hidden;
  animation: dsaNotesPanelIn 0.18s ease-out;
}
@keyframes dsaNotesPanelIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dsa-notes-panel[hidden] { display: none; }

.dsa-notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border, #30363d);
  background: var(--bg3, #21262d);
}
.dsa-notes-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--cyan, #79c0ff);
}
.dsa-notes-close {
  background: transparent;
  border: none;
  color: var(--muted, #8b949e);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
  transition: color 0.15s;
}
.dsa-notes-close:hover { color: var(--text, #e6edf3); }

.dsa-notes-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  gap: 8px;
  overflow: hidden;
}
.dsa-notes-text {
  width: 100%;
  flex: 1;
  min-height: 220px;
  resize: vertical;
  background: var(--bg, #0d1117);
  color: var(--text, #e6edf3);
  border: 1px solid var(--border, #30363d);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--font-mono, 'Consolas', 'Courier New', monospace);
  font-size: 0.85rem;
  line-height: 1.55;
  outline: none;
  transition: border-color 0.15s;
}
.dsa-notes-text:focus {
  border-color: var(--blue, #388bfd);
}
.dsa-notes-text:disabled {
  opacity: 0.55;
  cursor: progress;
}

.dsa-notes-login-cta {
  font-size: 0.72rem;
  color: var(--muted, #8b949e);
  background: var(--bg3, #21262d);
  border: 1px dashed var(--border, #30363d);
  border-radius: 6px;
  padding: 7px 10px;
  line-height: 1.45;
}
.dsa-notes-login-cta a {
  color: var(--cyan, #79c0ff);
  text-decoration: none;
  font-weight: 600;
}
.dsa-notes-login-cta a:hover { text-decoration: underline; }

.dsa-notes-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 12px;
  border-top: 1px solid var(--border, #30363d);
  font-size: 0.7rem;
  color: var(--muted, #8b949e);
  gap: 10px;
}
.dsa-notes-status {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dsa-notes-status[data-kind='ok']   { color: var(--green,  #3fb950); }
.dsa-notes-status[data-kind='busy'] { color: var(--yellow, #d29922); }
.dsa-notes-status[data-kind='warn'] { color: var(--orange, #f0883e); }
.dsa-notes-status[data-kind='err']  { color: var(--red,    #f78166); }

.dsa-notes-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dsa-notes-count {
  font-family: var(--font-mono, 'Consolas', monospace);
}
.dsa-notes-count.over {
  color: var(--red, #f78166);
  font-weight: 700;
}
.dsa-notes-delete {
  background: transparent;
  border: 1px solid var(--border, #30363d);
  color: var(--muted, #8b949e);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.68rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.dsa-notes-delete:hover {
  color: var(--red, #f78166);
  border-color: var(--red, #f78166);
}

@media (max-width: 480px) {
  .dsa-notes-panel {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 78px;
  }
  .dsa-notes-fab {
    right: 14px;
    bottom: 14px;
  }
}
