/* =========================================================================
   POST-IT.CSS — Bloco de notas flutuante (até 5 notas, salvas no navegador)
   Cores das notas: --rb-note-* (tokens.css), texto em --rb-note-text.
   Classes aplicadas pelo JS em base.html: note-window, note-color-{blue|green|
   yellow|pink|purple}, note-minimized, note-intro, note-anim-in, note-anim-close.
   ========================================================================= */

.note-window {
  --note-bg: var(--rb-note-yellow);

  position: fixed;
  width: 280px;
  max-width: 80vw;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--note-bg);
  color: var(--rb-note-text);
  border: 1px solid var(--rb-border);
  border-radius: var(--rb-radius-lg);
  box-shadow: var(--rb-shadow-lg);
  font-size: var(--rb-fs-sm);
}

/* Cor de cada nota (a chave "purple" é a nota violeta) */
.note-window.note-color-yellow { --note-bg: var(--rb-note-yellow); }
.note-window.note-color-blue   { --note-bg: var(--rb-note-blue); }
.note-window.note-color-green  { --note-bg: var(--rb-note-green); }
.note-window.note-color-pink   { --note-bg: var(--rb-note-pink); }
.note-window.note-color-purple { --note-bg: var(--rb-note-violet); }

/* Cabeçalho (área de arrastar) */
.note-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--rb-space-2);
  padding: 4px var(--rb-space-2) 4px var(--rb-space-3);
  border-bottom: 1px solid rgba(var(--rb-text-rgb), .10);
  color: var(--rb-note-text);
  cursor: move;
  user-select: none;
}

.note-title {
  display: flex;
  align-items: center;
  min-width: 0;
}

.note-title-input {
  max-width: 120px;
  padding: 2px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font-size: var(--rb-fs-sm);
  font-weight: var(--rb-fw-semibold);
}
.note-title-input::placeholder { color: var(--rb-text-muted); }
.note-title-input:focus { box-shadow: 0 1px 0 0 var(--rb-primary); }

.note-header-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Seletores de cor */
.note-color-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  padding: 0;
  border: 1px solid var(--rb-border-strong);
  border-radius: 50%;
  cursor: pointer;
}
.note-color-dot[data-color="yellow"] { background: var(--rb-note-yellow); }
.note-color-dot[data-color="blue"]   { background: var(--rb-note-blue); }
.note-color-dot[data-color="green"]  { background: var(--rb-note-green); }
.note-color-dot[data-color="pink"]   { background: var(--rb-note-pink); }
.note-color-dot[data-color="purple"] { background: var(--rb-note-violet); }
.note-color-dot:hover { border-color: var(--rb-text-muted); }
.note-color-dot:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--rb-focus-ring); }

/* Minimizar / fechar */
.note-minimize-btn,
.note-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--rb-radius-sm);
  background: transparent;
  color: var(--rb-note-text);
  font-size: var(--rb-fs-sm);
  cursor: pointer;
  transition: background-color var(--rb-dur) var(--rb-ease);
}
.note-minimize-btn:hover,
.note-close-btn:hover { background: rgba(var(--rb-text-rgb), .08); }
.note-close-btn:hover { color: var(--rb-danger); }
.note-minimize-btn:focus-visible,
.note-close-btn:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--rb-focus-ring); }

/* Texto */
.note-body { padding: var(--rb-space-2); }

.note-textarea {
  display: block;
  width: 100%;
  min-height: 110px;
  max-height: 260px;
  padding: 6px var(--rb-space-2);
  resize: vertical;
  border: 1px solid rgba(var(--rb-text-rgb), .14);
  border-radius: var(--rb-radius);
  background: rgba(var(--rb-surface-rgb), .55);
  color: var(--rb-note-text);
  font-family: var(--rb-font-sans);
  font-size: var(--rb-fs-sm);
  line-height: var(--rb-lh);
  outline: 0;
}
.note-textarea::placeholder { color: var(--rb-text-muted); }
.note-textarea:focus {
  border-color: var(--rb-primary);
  box-shadow: 0 0 0 3px var(--rb-focus-ring);
}

.note-footer {
  display: flex;
  justify-content: flex-end;
  padding: 0 var(--rb-space-2) 6px;
}
.note-status {
  font-size: 11px;
  color: var(--rb-text-muted);
}

/* -------------------------------------------------------------------------
   Minimizada: dock no rodapé, só a borda superior aparece; sobe no hover
   ------------------------------------------------------------------------- */
.note-window.note-minimized {
  width: 220px;
  max-width: 40vw;
  transform: translateY(calc(100% + 4px));
  transition: transform .2s var(--rb-ease);
}
.note-window.note-minimized:hover,
.note-window.note-minimized:focus-within {
  transform: translateY(calc(60% - 4px));
}
.note-window.note-minimized .note-header {
  cursor: default;
  border-bottom: 0;
}
.note-window.note-minimized .note-body,
.note-window.note-minimized .note-footer,
.note-window.note-minimized .note-color-dot { display: none; }
.note-window.note-minimized .note-title-input { max-width: 110px; }

/* -------------------------------------------------------------------------
   Animações curtas e finitas
   ------------------------------------------------------------------------- */
.note-window.note-minimized.note-intro { animation: note-dock-in .3s var(--rb-ease) both; }
.note-window.note-anim-in              { animation: note-in .2s var(--rb-ease) both; }
.note-window.note-anim-close           { animation: note-out .16s var(--rb-ease) both; } /* JS remove em 180ms */

@keyframes note-dock-in {
  from { opacity: 0; transform: translateY(140%); }
  to   { opacity: 1; transform: translateY(calc(100% + 4px)); }
}
@keyframes note-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes note-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(8px); }
}
