/* === UNLIMITPDF UX PHASE 3: COMMAND PALETTE, COMPARE ORIGINAL & MOBILE DOCK === */

/* Botón buscador rápido Ctrl+K en cabecera */
.ux-cmdk-btn {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 9px;
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid #334155;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
@media (min-width: 768px) {
  .ux-cmdk-btn { display: inline-flex; }
}
.ux-cmdk-btn:hover {
  border-color: #3b82f6;
  color: #ffffff;
  background: rgba(37, 99, 235, 0.18);
}
.ux-cmdk-kbd {
  font-family: monospace;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 5px;
  background: #0f172a;
  border: 1px solid #475569;
  color: #93c5fd;
}
body.light-mode .ux-cmdk-btn {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
}
body.light-mode .ux-cmdk-btn:hover {
  background: #eff6ff !important;
  border-color: #2563eb !important;
  color: #1d4ed8 !important;
}
body.light-mode .ux-cmdk-kbd {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #1d4ed8 !important;
}

/* Modal Paleta Global de Comandos (Ctrl+K / Cmd+K) */
#uxCmdPaletteBackdrop {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(3, 7, 18, 0.72);
  backdrop-filter: blur(5px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh 14px 16px;
}
#uxCmdPaletteBackdrop.open { display: flex; }
.ux-cmd-dialog {
  width: 100%;
  max-width: 560px;
  border-radius: 18px;
  background: #0f172a;
  border: 1px solid #3b82f6;
  box-shadow: 0 25px 55px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}
body.light-mode .ux-cmd-dialog {
  background: #ffffff !important;
  border-color: #2563eb !important;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.2) !important;
}
.ux-cmd-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  border-bottom: 1px solid #1e293b;
}
body.light-mode .ux-cmd-head { border-color: #e2e8f0 !important; }
#uxCmdInput {
  flex: 1;
  background: transparent !important;
  border: 0 !important;
  outline: none !important;
  color: #f8fafc;
  font-size: 14px;
  font-weight: 600;
}
body.light-mode #uxCmdInput { color: #0f172a !important; }
.ux-cmd-list {
  max-height: 340px;
  overflow-y: auto;
  padding: 8px;
}
.ux-cmd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border-radius: 11px;
  border: 0;
  background: transparent;
  color: #e2e8f0;
  text-align: left;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
}
.ux-cmd-row.selected,
.ux-cmd-row:hover {
  background: #2563eb !important;
  color: #ffffff !important;
}
body.light-mode .ux-cmd-row { color: #1e293b; }
body.light-mode .ux-cmd-row.selected,
body.light-mode .ux-cmd-row:hover {
  background: #2563eb !important;
  color: #ffffff !important;
}
.ux-cmd-foot {
  padding: 7px 14px;
  border-top: 1px solid #1e293b;
  font-size: 10.5px;
  color: #94a3b8;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
body.light-mode .ux-cmd-foot {
  border-color: #e2e8f0 !important;
  color: #64748b !important;
  background: #f8fafc !important;
}

/* Botón Comparar con Original en el Visor PDF */
#uxCompareOrigBtn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.38);
  color: #93c5fd;
  cursor: pointer;
  user-select: none;
  margin-left: 4px;
}
#uxCompareOrigBtn:hover,
#uxCompareOrigBtn.peeking {
  background: #2563eb !important;
  color: #ffffff !important;
}
body.light-mode #uxCompareOrigBtn {
  background: #eff6ff !important;
  border-color: #93c5fd !important;
  color: #1d4ed8 !important;
}

/* Atenuar parches mientras se mantiene pulsado "Ver Original" */
body.ux-peeking-original #pdfCanvas ~ *:not(.textLayer) {
  opacity: 0.04 !important;
  transition: opacity 0.12s ease !important;
}

/* Barra Táctil Inferior en Móvil cuando hay un PDF abierto */
#uxMobileEditorDock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 65;
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(15, 23, 42, 0.96);
  border-top: 1px solid #334155;
  backdrop-filter: blur(10px);
}
@media (max-width: 639px) {
  #uxMobileEditorDock.active { display: grid; }
}
body.light-mode #uxMobileEditorDock {
  background: rgba(255, 255, 255, 0.97) !important;
  border-color: #cbd5e1 !important;
}
.ux-mob-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
  border-radius: 10px;
  font-size: 10.5px;
  font-weight: 700;
  background: #1e293b;
  border: 1px solid #334155;
  color: #f1f5f9;
}
.ux-mob-btn.primary {
  background: #2563eb !important;
  border-color: #3b82f6 !important;
  color: #ffffff !important;
}
body.light-mode .ux-mob-btn:not(.primary) {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}
