
/* ---- Dock principal ---- */
#app-dock {
  position: fixed;
  bottom: 13px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 7px 15px 9px;
  background: rgba(10, 17, 26, 0.75);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.6),
    0 2px 8px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  z-index: 1800;
  user-select: none;
  transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.38s;
}

#app-dock.dock-hidden {
  transform: translateX(-50%) translateY(calc(100% + 22px));
  opacity: 0;
  pointer-events: none;
}

/* ---- Bouton masquer le dock ---- */
#dock-hide-btn {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 38px;
  height: 16px;
  background: rgba(10, 17, 26, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  opacity: 0.35;
  transition: opacity 0.2s;
  color: rgba(255, 255, 255, 0.8);
  z-index: 1;
}
#dock-hide-btn:hover { opacity: 1; background: rgba(10, 17, 26, 0.9); }
#dock-hide-btn svg { width: 14px; height: 14px; pointer-events: none; }

/* ---- Languette "afficher le dock" ---- */
#dock-show-tab {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  background: rgba(10, 17, 26, 0.82);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  padding: 6px 22px 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  z-index: 1800;
  transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.38s;
  opacity: 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 11px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  user-select: none;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.35);
}
#dock-show-tab.dock-tab-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
#dock-show-tab:hover { background: rgba(20, 30, 44, 0.95); color: rgba(255,255,255,0.95); }
#dock-show-tab svg { width: 14px; height: 14px; }

#app-dock::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 18%;
  right: 18%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
}

/* ---- Icône du dock ---- */
.dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dock-item:hover {
  transform: translateY(-12px) scale(1.22);
}

.dock-item.dock-active {
  transform: translateY(-4px) scale(1.05);
}

/* ---- Tooltip (étiquette au survol, au-dessus de l'icône) ---- */
.dock-item::after {
  content: attr(data-label);
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%) translateY(5px);
  background: rgba(8, 14, 22, 0.92);
  color: rgba(255, 255, 255, 0.92);
  font-size: 11px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 500;
  white-space: nowrap;
  padding: 4px 11px 5px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 100;
}

.dock-item:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- Boîte icône ---- */
.dock-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: box-shadow 0.2s, filter 0.2s;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.55));
}

/* Couleurs individuelles */
.dock-item[data-tool="bloc-notes"] .dock-icon-box {
  background: linear-gradient(145deg, #c2410c 0%, #f97316 100%);
}
.dock-item[data-tool="calculatrice"] .dock-icon-box {
  background: linear-gradient(145deg, #1a4a2e 0%, #27703f 100%);
}
.dock-item[data-tool="convertisseur"] .dock-icon-box {
  background: linear-gradient(145deg, #3b1a6b 0%, #6730b8 100%);
}
.dock-item[data-tool="calendrier"] .dock-icon-box {
  background: linear-gradient(145deg, #9d174d 0%, #ec4899 100%);
}
.dock-item[data-tool="bot-assistant"] .dock-icon-box {
  background: linear-gradient(145deg, #1e40af 0%, #3b82f6 100%);
}

/* BOT Assistant : masqué par défaut, visible uniquement sur la page PHP */
.dock-item[data-tool="bot-assistant"] {
  display: none;
}
#app-dock.dock-has-bot .dock-item[data-tool="bot-assistant"] {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Pastille de notification style iOS */
.dock-notif-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: #ff3b30;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(10, 17, 26, 0.85);
  box-shadow: 0 1px 5px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,59,48,0.25);
  z-index: 10;
  line-height: 1;
  letter-spacing: -0.3px;
  pointer-events: none;
}

.dock-item:hover .dock-icon-box,
.dock-item.dock-active .dock-icon-box {
  border-color: rgba(255, 255, 255, 0.2);
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.65)) brightness(1.12);
}

.dock-icon-box svg {
  display: block;
  width: 82%;
  height: 82%;
}

/* Point indicateur d'outil ouvert */
.dock-item.dock-active::before {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
}

/* ---- Overlays (fond semi-transparent des dialogues) ---- */
.dock-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2100;
}

/* ---- Panneau du dialogue ---- */
.dock-dialog-panel {
  background: #020617;
  border: 1px solid #3c5068;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255,255,255,0.04);
  max-height: 90vh;
}

/* En-tête du dialogue */
.dock-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid #2a394a;
  flex-shrink: 0;
  background: rgba(255,255,255,0.02);
}

.dock-dialog-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #e2e8f0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dock-dialog-title svg {
  width: 17px;
  height: 17px;
  color: #7aa3cc;
  flex-shrink: 0;
}

.dock-close-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: #64748b;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.dock-close-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
}

/* Corps du dialogue */
.dock-dialog-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  min-height: 0;
}

/* ---- Tailles spécifiques des dialogues ---- */
#dock-dialog-bloc-notes .dock-dialog-panel {
  width: min(1800px, 96vw);
  height: min(96vh, 1060px);
}

#dock-dialog-calculatrice .dock-dialog-panel {
  width: 400px;
  /* pas de hauteur fixe : la boîte s'adapte au contenu */
}

#dock-dialog-convertisseur .dock-dialog-panel {
  width: min(980px, 96vw);
  height: min(76vh, 820px);
}
#dock-dialog-calendrier .dock-dialog-panel {
  width: min(1640px, 98vw);
  height: min(960px, 95vh);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ════════════════════════════════════════════════════════════════
   Styles des outils — embarqués ici pour fonctionner sur toutes
   les pages (même celles qui ne chargent pas styles.css)
   ════════════════════════════════════════════════════════════════ */

/* Variables locales résolues (fallbacks si styles.css absent) */
#dock-dialogs {
  --fg:     #e8eef3;
  --muted:  #9fb0bf;
  --accent: #2d77ff;
}

/* Base boutons dans les dialogues dock
   Spécificité [0,1,1] intentionnellement BASSE pour ne pas écraser
   les règles spécifiques des boutons de calculatrice (.calc-btn.operator = [0,2,0]) */
.dock-dialog-body button {
  background: #020617;
  color: #e8eef3;
  border: 1px solid #2a394a;
  border-radius: 12px;
  padding: .5rem .8rem;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.dock-dialog-body button:hover { background: #1e2b3b; border-color: #3c5068; }
.dock-dialog-body button:active { transform: scale(.98); }
.dock-dialog-body button:disabled { opacity: .45; cursor: not-allowed; }

/* Bouton "Ajouter une note" */
.dock-dialog-body .icon-btn {
  width: auto;
  height: 36px;
  padding: 0.4rem 0.9rem;
  display: inline-flex;
  align-items: center;
  border-radius: 12px;
}

/* ── Bloc-notes ── */
.bloc-notes-controls {
  flex-shrink: 0;
  text-align: left;
  margin-bottom: 1rem;
}
.bloc-notes-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  overflow-y: auto;
  flex-grow: 1;
  max-height: calc(96vh - 200px);
}
.note-wrapper {
  background: #020617;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  border: 1px solid #2a394a;
  position: relative;
  min-width: 200px;
  min-height: 400px;
}
.note-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}
.note-color-palette { display: flex; gap: 0.4rem; }
.note-color-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.2);
  cursor: pointer;
  transition: all .2s;
  padding: 0;
  background: transparent;
}
.note-color-btn:hover {
  transform: scale(1.15);
  border-color: rgba(0,0,0,0.4);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.note-color-btn:active { transform: scale(.95); }
.note-delete-btn {
  -webkit-appearance: none;
  appearance: none;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none;
  color: #555 !important;
  opacity: 1;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 0;
  font-size: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.note-delete-btn:hover { color: #e05252 !important; background: rgba(224,82,82,0.12) !important; }
.outils-textarea {
  flex-grow: 1;
  resize: none;
  background: transparent;
  border: none;
  color: #1a1a1a;
  font-size: 1rem;
  padding: 0.75rem;
}

/* ── Calculatrice ── */
.calculator-wrapper {
  max-width: 380px;
  margin: 0 auto;
  padding: 20px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.calc-display {
  background: rgba(0,0,0,0.28);
  border-radius: 16px;
  padding: 16px 22px 14px;
  text-align: right;
  border: 1px solid rgba(255,255,255,0.07);
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.calc-history {
  font-size: 1rem;
  color: rgba(180,200,225,0.45);
  min-height: 24px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calc-result {
  font-size: 2.8rem;
  font-weight: 300;
  color: #f1f5f9;
  letter-spacing: -1px;
  word-wrap: break-word;
}
.calc-buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.calc-btn {
  position: relative;
  overflow: hidden;
  height: 62px;
  font-size: 1.35rem;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
  background: #1e2d40;
  color: #dde8f4;
  cursor: pointer;
  transition: transform 0.08s, filter 0.1s;
}
.calc-btn::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: rgba(255,255,255,0.05);
  pointer-events: none;
}
.calc-btn:hover { filter: brightness(1.18); }
.calc-btn:active { transform: scale(0.92); }
.calc-btn.function { background: #2a3d52; color: #7aa3cc; font-size: 1.1rem; }
.calc-btn.function:hover { filter: brightness(1.2); }
.calc-btn.operator {
  background: linear-gradient(160deg, #1a5396, #2563eb);
  color: #fff;
  border-color: rgba(37,99,235,0.3);
  box-shadow: 0 3px 12px rgba(37,99,235,0.3);
}
.calc-btn.operator:hover { filter: brightness(1.15); }
.calc-btn.equals {
  grid-column: span 2;
  background: linear-gradient(160deg, #1a5396, #2563eb);
  color: #fff;
  border-color: rgba(37,99,235,0.3);
  box-shadow: 0 4px 16px rgba(37,99,235,0.4);
}
.calc-btn.equals:hover { filter: brightness(1.15); }
.calc-keyboard-hint {
  text-align: center;
  font-size: 11px;
  color: rgba(122,163,204,0.4);
  letter-spacing: 0.3px;
}

/* ── Convertisseur DI — design moderne ── */
.converter-wrapper {
  display: flex;
  align-items: stretch;
  height: 100%;
  padding: 16px;
  box-sizing: border-box;
  gap: 0;
}
.converter-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 16px;
}
.conv-pane-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.conv-icon { width: 15px; height: 15px; color: #60a5fa; flex-shrink: 0; }
.conv-pane-label {
  flex: 1;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: #7aa3cc;
}
.line-counter {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  background: rgba(96,165,250,0.1);
  border: 1px solid rgba(96,165,250,0.2);
  border-radius: 20px;
  color: #60a5fa;
}
.converter-textarea {
  flex: 1;
  width: 100%;
  resize: none;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  color: #dde8f4;
  font-size: 0.93rem;
  font-family: 'Cascadia Code', 'Consolas', 'SF Mono', monospace;
  padding: 12px 14px;
  line-height: 1.65;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.converter-textarea:focus {
  outline: none;
  border-color: rgba(96,165,250,0.35);
  box-shadow: 0 0 0 3px rgba(96,165,250,0.07);
}
.converter-textarea[readonly] { border-color: rgba(52,211,153,0.15); }
.converter-textarea[readonly]:focus {
  border-color: rgba(52,211,153,0.3);
  box-shadow: 0 0 0 3px rgba(52,211,153,0.06);
}
.converter-textarea::placeholder { color: rgba(122,163,204,0.35); font-style: italic; }
.conv-pane-foot { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
/* Colonne centrale */
.converter-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 130px;
  flex-shrink: 0;
  padding: 0 10px;
}
.conv-arrow {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(59,130,246,0.45), inset 0 1px 0 rgba(255,255,255,0.15);
  flex-shrink: 0;
}
.conv-arrow svg { width: 22px; height: 22px; color: #fff; }
.conv-ops { display: flex; flex-direction: column; gap: 8px; width: 100%; }
/* Boutons modernes */
.conv-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  padding: 8px 14px !important;
  border-radius: 9px !important;
  cursor: pointer !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  font-family: inherit !important;
  transition: all 0.18s !important;
  white-space: nowrap !important;
  transform: none;
}
.conv-btn-icon { width: 14px; height: 14px; flex-shrink: 0; }
.conv-btn-danger {
  background: rgba(239,68,68,0.1) !important;
  border: 1px solid rgba(239,68,68,0.22) !important;
  color: #f87171 !important;
}
.conv-btn-danger:hover {
  background: rgba(239,68,68,0.2) !important;
  border-color: rgba(239,68,68,0.4) !important;
  color: #fca5a5 !important;
  box-shadow: 0 2px 10px rgba(239,68,68,0.15) !important;
}
.conv-btn-success {
  background: linear-gradient(135deg, #065f46, #047857) !important;
  border: 1px solid rgba(5,150,105,0.4) !important;
  color: #fff !important;
  box-shadow: 0 2px 10px rgba(5,150,105,0.25);
}
.conv-btn-success:hover {
  background: linear-gradient(135deg, #047857, #059669) !important;
  box-shadow: 0 4px 16px rgba(5,150,105,0.35) !important;
  color: #fff !important;
  transform: translateY(-1px);
}
.conv-btn-op {
  background: rgba(59,130,246,0.1) !important;
  border: 1px solid rgba(59,130,246,0.2) !important;
  color: #93c5fd !important;
  width: 100%;
  font-size: 11px !important;
}
.conv-btn-op:hover {
  background: rgba(59,130,246,0.2) !important;
  border-color: rgba(59,130,246,0.35) !important;
  color: #bfdbfe !important;
  box-shadow: 0 2px 10px rgba(59,130,246,0.15) !important;
}

