/* ============================================================
   Bloc-notes flottant — thomasmr.fr
   Utilise les variables CSS du site (thème jour/nuit auto)
   ============================================================ */

/* ---- Bouton déclencheur (coin bas-droit) ---- */
#tmr-notepad-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 900;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--btn-bg, #003e6a);
  color: var(--btn-text, #ffffff);
  border: none;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0,0,0,.30);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: background .18s, transform .15s;
  /* on monte un peu pour ne pas couvrir le footer */
  margin-bottom: env(safe-area-inset-bottom, 0px);
}
#tmr-notepad-toggle:hover {
  background: var(--btn-hover, #00325a);
  transform: scale(1.08);
}
/* Petite pastille rouge si des notes existent */
#tmr-notepad-toggle.has-content::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e53935;
  border: 2px solid var(--btn-bg, #003e6a);
}

/* ---- Panneau bloc-notes ---- */
#tmr-notepad-panel {
  position: fixed;
  bottom: 78px;   /* au-dessus du bouton */
  right: 20px;
  z-index: 901;
  width: 320px;
  max-width: calc(100vw - 32px);
  background: var(--modal-bg, #ffffff);
  color: var(--modal-text, #333333);
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Taille verticale résizable via resize-handle */
  height: 280px;
  min-height: 140px;
  max-height: 70vh;

  /* Animation d'apparition */
  opacity: 0;
  transform: translateY(12px) scale(.97);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
#tmr-notepad-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ---- Barre de titre ---- */
#tmr-notepad-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--btn-bg, #003e6a);
  color: var(--btn-text, #ffffff);
  font-family: var(--font, 'Montserrat', sans-serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .3px;
  user-select: none;
  cursor: default;
}
#tmr-notepad-header span {
  display: flex;
  align-items: center;
  gap: 7px;
  text-transform: uppercase;
  font-weight: 400;
}
.tmr-np-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.80);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 4px;
  transition: background .13s, color .13s;
}
.tmr-np-btn:hover {
  background: rgba(255,255,255,.15);
  color: #ffffff;
}

/* ---- Zone texte ---- */
#tmr-notepad-textarea {
  flex: 1;
  width: 100%;
  resize: none;
  border: none;
  outline: none;
  padding: 10px 12px;
  font-family: var(--font, 'Montserrat', sans-serif);
  font-size: 12px;
  line-height: 1.55;
  background: var(--modal-bg, #ffffff);
  color: var(--modal-text, #333333);
  box-sizing: border-box;
  overflow-y: auto;
}
#tmr-notepad-textarea::placeholder {
  color: var(--muted, #666666);
  font-style: italic;
}

/* ---- Barre bas : compteur + effacer ---- */
#tmr-notepad-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  border-top: 1px solid var(--border, #e0e0e0);
  background: var(--bg-card, #f5f8fb);
  font-family: var(--font, 'Montserrat', sans-serif);
  font-size: 11px;
  color: var(--muted, #666666);
}
#tmr-notepad-clear {
  background: none;
  border: none;
  color: #e53935;
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: inherit;
  opacity: .75;
  transition: opacity .13s;
}
#tmr-notepad-clear:hover { opacity: 1; }

/* ---- Poignée de redimensionnement (haut du panneau) ---- */
#tmr-notepad-resize {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  cursor: ns-resize;
  background: transparent;
}
#tmr-notepad-resize:hover {
  background: rgba(0,62,106,.12);
}

/* ---- Masqué sur mobile ---- */
@media (max-width: 767px) {
  #tmr-notepad-toggle,
  #tmr-notepad-panel {
    display: none !important;
  }
}
