/* Axper Europe — css/notes.css
   Outils → Bloc-notes : post-it colorés, légèrement inclinés, et rappels de la vue d'ensemble. */

:root {
  /* Couleurs des post-it : fond, ruban adhésif. Les post-it restent clairs, même en thème sombre. */
  --note-l: 0.955; --note-c: 0.07; --note-tape: oklch(1 0 0 / .55); --note-ink: oklch(0.27 0.035 var(--hue));
  --note-tool: oklch(0.27 0.035 var(--hue) / .08);
}
:root[data-theme="dark"] {
  --note-l: 0.86; --note-c: 0.075; --note-tape: oklch(1 0 0 / .32);
}
.c-jaune { --note-h: 95; }
.c-rose { --note-h: 355; }
.c-bleu { --note-h: 235; }
.c-vert { --note-h: 150; }
.c-violet { --note-h: 300; }
.c-jaune { --note-c-boost: .035; }

/* ============ Barre d'outils ============ */
.note-filters { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); flex-wrap: wrap; }
.note-filters .chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 0; border-radius: 10px;
  background: none; color: var(--muted); font-size: 13px; font-weight: 600; transition: background-color .2s, color .2s;
}
.note-filters .chip:hover { background: var(--surface-2); color: var(--text); }
.note-filters .chip.active { background: var(--accent); color: var(--on-accent); }
.note-filters .chip b { font-size: 11.5px; font-weight: 700; opacity: .7; font-variant-numeric: tabular-nums; }
.note-filters .chip b:empty { display: none; }

/* ============ Tableau de post-it ============ */
.notes-page { position: relative; z-index: 2; } /* le choix de la date passe au-dessus du pied de page */
.notes-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px 20px; align-items: start; padding: 6px 2px 10px; }
.notes-board.is-empty { display: block; }

.note {
  position: relative; display: flex; flex-direction: column; min-height: 190px; padding: 16px 14px 10px; border-radius: 4px 4px 18px 4px;
  background: linear-gradient(170deg, oklch(calc(var(--note-l) + .015) calc(var(--note-c) + var(--note-c-boost, 0) - .015) var(--note-h)), oklch(var(--note-l) calc(var(--note-c) + var(--note-c-boost, 0)) var(--note-h)));
  color: var(--note-ink); box-shadow: 0 1px 2px oklch(0.3 0.05 var(--note-h) / .12), 0 14px 26px -16px oklch(0.3 0.06 var(--note-h) / .45);
  color-scheme: light;
  transform: rotate(var(--tilt, 0deg)); transition: transform .45s var(--spring), box-shadow .3s;
}
/* Ruban adhésif en haut */
.note::before {
  content: ""; position: absolute; top: -9px; left: 50%; width: 64px; height: 20px; transform: translateX(-50%) rotate(-2deg);
  background: var(--note-tape); border-radius: 3px; box-shadow: 0 1px 2px oklch(0 0 0 / .06); backdrop-filter: blur(2px);
}
.note:hover, .note:focus-within { transform: rotate(0deg) translateY(-3px); box-shadow: 0 2px 4px oklch(0.3 0.05 var(--note-h) / .12), 0 22px 34px -18px oklch(0.3 0.06 var(--note-h) / .55); z-index: 1; }
.note-enter { animation: noteIn .45s var(--spring) both; }
@keyframes noteIn { from { opacity: 0; transform: rotate(var(--tilt, 0deg)) translateY(10px) scale(.94); } }
.note.flash { animation: noteFlash 1.6s var(--ease); }
@keyframes noteFlash { 0%, 35% { box-shadow: 0 0 0 4px var(--accent), 0 22px 34px -18px oklch(0.3 0.06 var(--note-h) / .55); } }

.note-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 26px; }
.note-owner { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; opacity: .62; }
.note-owner.shared { opacity: .85; }
.note-tools { display: flex; gap: 2px; opacity: 0; transition: opacity .2s; }
.note:is(:hover, :focus-within) .note-tools { opacity: 1; }
.note-tool, .note-done, .note-date button { border: 0; background: none; color: inherit; cursor: pointer; }
.note-tool { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; opacity: .7; transition: background-color .2s, opacity .2s, color .2s; }
.note-tool:hover { background: var(--note-tool); opacity: 1; }
.note-tool.danger:hover { color: var(--empty-ink); }

.note-text {
  flex: 1; width: 100%; min-height: 96px; margin: 4px 0 8px; padding: 0; border: 0; outline: none; resize: none; overflow: hidden;
  background: none; color: inherit; font: inherit; font-size: 15px; line-height: 1.5;
}
.note-text::placeholder { color: inherit; opacity: .45; }
.note-text:focus { box-shadow: none; }

.note-foot { display: flex; align-items: center; gap: 6px; min-height: 30px; }
.note-date { position: relative; display: inline-flex; align-items: center; min-width: 0; margin-right: auto; border-radius: 9px; transition: background-color .2s; }
.note-date button:first-of-type { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 8px; border-radius: 9px; font-size: 12.5px; font-weight: 600; opacity: .6; white-space: nowrap; }
.note-date:hover button:first-of-type, .note-date.set button:first-of-type { opacity: .9; }
.note-date button:first-of-type:hover { background: var(--note-tool); }
.note-date.today { background: oklch(0.27 0.035 var(--hue)); color: oklch(0.97 0.01 var(--hue)); }
.note-date.late { background: oklch(0.56 0.19 22); color: #fff; }
.note-date:is(.today, .late) button:first-of-type { opacity: 1; }
.note-date:is(.today, .late) .ico { animation: bellRing 2.4s ease-in-out infinite; transform-origin: 50% 10%; }
@keyframes bellRing { 0%, 70%, 100% { transform: rotate(0); } 76% { transform: rotate(14deg); } 84% { transform: rotate(-12deg); } 92% { transform: rotate(6deg); } }
.note-date-clear { width: 22px; height: 22px; margin-right: 3px; display: grid; place-items: center; border-radius: 50%; opacity: .6; }
.note-date-clear:hover { opacity: 1; background: var(--note-tool); }
/* Choix de la date de rappel : raccourcis + champ date */
.note.picking { z-index: 5; transform: rotate(0deg) translateY(-3px); }
.note-picker {
  position: absolute; left: -6px; top: calc(100% + 8px); z-index: 10; width: 232px; padding: 8px; border-radius: 16px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); color-scheme: light;
  display: grid; gap: 8px; animation: pickerIn .22s var(--ease) both; transform-origin: 20% 0;
}
@keyframes pickerIn { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
.note-picker-quick { display: grid; gap: 2px; }
.note-picker-quick button, .note-picker-clear {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 34px; padding: 0 10px; border: 0; border-radius: 10px;
  background: none; color: var(--text); font-size: 13.5px; font-weight: 600; text-align: left; transition: background-color .15s;
}
.note-picker-quick button small { font-size: 12px; font-weight: 500; color: var(--faint); }
.note-picker-quick button:hover, .note-picker-clear:hover { background: var(--surface-2); }
.note-picker-quick button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-ink); }
.note-picker-field { display: grid; gap: 4px; padding: 6px 10px 2px; border-top: 1px solid var(--line-soft); font-size: 12px; font-weight: 600; color: var(--muted); }
.note-picker-field input {
  height: 38px; width: 100%; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--input); color: var(--text); font-weight: 500; transition: border-color .2s, box-shadow .2s;
}
.note-picker-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
/* Le post-it est toujours clair ; son menu suit le thème (champ date, calendrier du navigateur). */
:root[data-theme="dark"] .note-picker { color-scheme: dark; }
.note-picker-clear { justify-content: flex-start; gap: 6px; color: var(--empty-ink); font-size: 13px; }

/* Choix de la couleur : petite palette sous le bouton, en haut de la note */
.note-palette-wrap { position: relative; display: inline-flex; }
.note-palette {
  position: absolute; top: calc(100% + 6px); right: -4px; z-index: 10; display: flex; gap: 6px; padding: 8px 10px; border-radius: 14px;
  background: var(--surface); box-shadow: var(--shadow-lg); animation: pickerIn .2s var(--ease) both; transform-origin: 90% 0;
}
.note-palette .swatch {
  width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: oklch(0.86 calc(0.12 + var(--note-c-boost, 0)) var(--note-h)); box-shadow: inset 0 0 0 1.5px oklch(0 0 0 / .12); transition: transform .25s var(--spring);
}
.note-palette .swatch:hover { transform: scale(1.15); }
.note-palette .swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.note.picking .note-tools { opacity: 1; }

.note-done { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; box-shadow: inset 0 0 0 1.5px currentColor; opacity: .45; transition: opacity .2s, background-color .2s, color .2s, transform .3s var(--spring); }
.note-done:hover { opacity: 1; transform: scale(1.08); }
.note-done[aria-pressed="true"] { opacity: 1; background: var(--ok); color: #fff; box-shadow: none; }
.note.is-done .note-text { text-decoration: line-through; text-decoration-color: oklch(0.5 0.02 var(--hue) / .5); opacity: .6; }
.note.is-done { filter: saturate(.55); }

/* Toujours visibles sur écran tactile (pas de survol) */
@media (hover: none) { .note-tools { opacity: 1; } }
@media (max-width: 600px) {
  .note-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .note-filters .chip { flex-shrink: 0; }
  .note { min-height: 150px; }
  .note-text { min-height: 60px; }
}

/* ============ Aucune note ============ */
.notes-empty { display: flex; align-items: center; gap: 36px; max-width: 640px; margin: 30px auto; padding: 10px; }
.notes-empty h2 { font-size: 20px; margin: 0 0 6px; text-wrap: balance; }
.notes-empty p { color: var(--muted); margin: 0 0 16px; line-height: 1.5; }
.note.demo { width: 150px; min-height: 150px; flex-shrink: 0; }
.note-lines { display: grid; gap: 12px; margin-top: 18px; }
.note-lines i { height: 7px; border-radius: 4px; background: oklch(0.3 0.04 var(--note-h) / .14); }
.note-lines i:nth-child(2) { width: 80%; }
.note-lines i:nth-child(3) { width: 55%; }
@media (max-width: 600px) { .notes-empty { flex-direction: column; text-align: center; } }

/* ============ Vue d'ensemble : rappels du jour ============ */
.reminder-card .dash-card-head h2 .ico { color: oklch(0.5 0.12 80); background: oklch(0.85 0.13 90 / .3); }
:root[data-theme="dark"] .reminder-card .dash-card-head h2 .ico { color: oklch(0.88 0.12 90); background: oklch(0.85 0.13 90 / .14); }
.reminder-count { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 20px; background: var(--surface-2); color: var(--muted); }
.note-swatch { width: 14px; height: 18px; flex-shrink: 0; border-radius: 3px 3px 7px 3px; background: oklch(var(--note-l) calc(var(--note-c) + .05 + var(--note-c-boost, 0)) var(--note-h)); box-shadow: 0 2px 5px -2px oklch(0.3 0.06 var(--note-h) / .5); transform: rotate(-4deg); }
.reminder-row .dash-site { text-decoration: none; color: inherit; }
.reminder-row .dash-site b { white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.reminder-row .late { color: var(--empty-ink); font-weight: 600; }
